File: ax_cxx_have_isfinite.m4

package info (click to toggle)
cppunit 1.13.2-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,980 kB
  • ctags: 3,579
  • sloc: cpp: 18,338; sh: 14,983; ansic: 3,011; makefile: 423; xml: 58; csh: 6
file content (27 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
dnl @synopsis AX_CXX_HAVE_ISFINITE
dnl
dnl If isfinite() is available to the C++ compiler:
dnl   define HAVE_ISFINITE
dnl   add "-lm" to LIBS
dnl
AC_DEFUN([AX_CXX_HAVE_ISFINITE],
  [ax_cxx_have_isfinite_save_LIBS=$LIBS
   LIBS="$LIBS -lm"

   AC_CACHE_CHECK(for isfinite, ax_cv_cxx_have_isfinite,
    [AC_LANG_SAVE
     AC_LANG_CPLUSPLUS
     AC_LINK_IFELSE(
       [AC_LANG_PROGRAM(
         [[#include <math.h>]],
         [[int f = isfinite( 3 );]])],
       [ax_cv_cxx_have_isfinite=yes],
       [ax_cv_cxx_have_isfinite=no])
     AC_LANG_RESTORE])

   if test "$ax_cv_cxx_have_isfinite" = yes; then
     AC_DEFINE([HAVE_ISFINITE],1,[define if compiler has isfinite])
   else
     LIBS=$ax_cxx_have_isfinite_save_LIBS
   fi
])