~ubuntu-branches/ubuntu/raring/hivex/raring

« back to all changes in this revision

Viewing changes to m4/float_h.m4

  • Committer: Package Import Robot
  • Author(s): Hilko Bengen
  • Date: 2011-12-01 22:09:50 UTC
  • mfrom: (6.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20111201220950-bm48fpock4e7l6rd
* New upstream version
* [1f9e20f] Cleared patch queue, added gnulib fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# float_h.m4 serial 7
 
1
# float_h.m4 serial 9
2
2
dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
33
33
          ;;
34
34
      esac
35
35
      ;;
 
36
    linux*)
 
37
      case "$host_cpu" in
 
38
        powerpc*)
 
39
          FLOAT_H=float.h
 
40
          ;;
 
41
      esac
 
42
      ;;
36
43
  esac
37
44
  case "$host_os" in
38
 
    aix* | freebsd*)
 
45
    aix* | freebsd* | linux*)
39
46
      if test -n "$FLOAT_H"; then
40
47
        REPLACE_FLOAT_LDBL=1
41
48
      fi
42
49
      ;;
43
50
  esac
 
51
 
 
52
  dnl Test against glibc-2.7 Linux/SPARC64 bug.
 
53
  REPLACE_ITOLD=0
 
54
  AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
 
55
    [gl_cv_func_itold_works],
 
56
    [
 
57
      AC_RUN_IFELSE(
 
58
        [AC_LANG_SOURCE([[
 
59
int i = -1;
 
60
volatile long double ld;
 
61
int main ()
 
62
{
 
63
  ld += i * 1.0L;
 
64
  if (ld > 0)
 
65
    return 1;
 
66
  return 0;
 
67
}]])],
 
68
        [gl_cv_func_itold_works=yes],
 
69
        [gl_cv_func_itold_works=no],
 
70
        [case "$host" in
 
71
           sparc*-*-linux*)
 
72
             AC_EGREP_CPP([yes],
 
73
               [#if defined __LP64__ || defined __arch64__
 
74
                yes
 
75
                #endif],
 
76
               [gl_cv_func_itold_works="guessing no"],
 
77
               [gl_cv_func_itold_works="guessing yes"])
 
78
             ;;
 
79
           *) gl_cv_func_itold_works="guessing yes" ;;
 
80
         esac
 
81
        ])
 
82
    ])
 
83
  case "$gl_cv_func_itold_works" in
 
84
    *no)
 
85
      REPLACE_ITOLD=1
 
86
      dnl We add the workaround to <float.h> but also to <math.h>,
 
87
      dnl to increase the chances that the fix function gets pulled in.
 
88
      FLOAT_H=float.h
 
89
      ;;
 
90
  esac
 
91
 
44
92
  if test -n "$FLOAT_H"; then
45
93
    gl_NEXT_HEADERS([float.h])
46
94
  fi
47
95
  AC_SUBST([FLOAT_H])
48
96
  AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"])
 
97
  AC_SUBST([REPLACE_ITOLD])
49
98
])