~barry-leslie/drizzle/blobcontainer

« back to all changes in this revision

Viewing changes to m4/cxx_cmath.m4

  • Committer: Brian Aker
  • Date: 2008-11-03 21:00:47 UTC
  • mfrom: (520.9.5 devel)
  • Revision ID: brian@tangent.org-20081103210047-wfkeyyefrfl2vh4l
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# HAVE_BOOST_CMATH depending
5
5
# on location.
6
6
 
 
7
m4_define([_AH_NEED_FUNCS],
 
8
[m4_foreach_w([AC_Func], [$1],
 
9
  [AH_TEMPLATE(AS_TR_CPP([NEED_]m4_defn([AC_Func])),
 
10
    [Define to 1 if you need to build a local version of `]m4_defn([AC_Func])[' function.])])])
 
11
 
7
12
AC_DEFUN([AC_CXX_CMATH],
8
13
  [AC_MSG_CHECKING(the location of cmath)
9
 
  AC_LANG_SAVE
10
 
   AC_LANG_CPLUSPLUS
 
14
   AC_LANG_PUSH(C++)
11
15
   ac_cv_cxx_cmath=""
12
16
   ac_cv_cxx_cmath_namespace=""
13
17
   for location in tr1/cmath boost/cmath cmath; do
27
31
      ac_cv_cxx_cmath_namespace=""
28
32
      AC_MSG_RESULT()
29
33
      AC_MSG_WARN([Could not find a cmath header.])
 
34
      
 
35
      _AH_NEED_FUNCS([isinf isnan isfinite])
 
36
      for ac_func in isinf isnan isfinite ; do
 
37
        AC_TRY_COMPILE([#include <math.h>],
 
38
                       [double x=1.0; $ac_func(x)],
 
39
                       [],[AC_DEFINE_UNQUOTED(AS_TR_CPP([NEED_$ac_func]))])
 
40
      done
30
41
   fi
31
42
   AC_DEFINE_UNQUOTED(CMATH_H,$ac_cv_cxx_cmath,
32
43
                      [the location of <cmath>])
35
46
     AC_DEFINE_UNQUOTED(CMATH_NAMESPACE,$ac_cv_cxx_cmath_namespace,
36
47
                        [the namespace of C99 math extensions])
37
48
   fi
 
49
   AC_LANG_POP()
38
50
])