"Fossies" - the Fresh Open Source Software Archive

Member "fityk-1.3.1/m4/ax_cxx_have_isfinite.m4" (13 May 2016, 891 Bytes) of package /linux/misc/fityk-1.3.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 dnl test from https://svn.code.sf.net/p/cppunit/code/trunk/cppunit/config/ax_cxx_have_isfinite.m4 
    2 dnl with <math.h> changed to <cmath> (no std:: added)
    3 dnl ---
    4 dnl @synopsis AX_CXX_HAVE_ISFINITE
    5 dnl
    6 dnl If isfinite() is available to the C++ compiler:
    7 dnl   define HAVE_ISFINITE
    8 dnl   add "-lm" to LIBS
    9 dnl
   10 AC_DEFUN([AX_CXX_HAVE_ISFINITE],
   11   [ax_cxx_have_isfinite_save_LIBS=$LIBS
   12    LIBS="$LIBS -lm"
   13 
   14    AC_CACHE_CHECK(for isfinite, ax_cv_cxx_have_isfinite,
   15     [AC_LANG_SAVE
   16      AC_LANG_CPLUSPLUS
   17      AC_LINK_IFELSE(
   18        [AC_LANG_PROGRAM(
   19          [[#include <cmath>]],
   20          [[int f = isfinite( 3 );]])],
   21        [ax_cv_cxx_have_isfinite=yes],
   22        [ax_cv_cxx_have_isfinite=no])
   23      AC_LANG_RESTORE])
   24 
   25    if test "$ax_cv_cxx_have_isfinite" = yes; then
   26      AC_DEFINE([HAVE_ISFINITE],1,[define if compiler has isfinite])
   27    else
   28      LIBS=$ax_cxx_have_isfinite_save_LIBS
   29    fi
   30 ])