From: brarcher Date: Thu, 19 Jun 2014 01:53:30 +0000 (+0000) Subject: autotools: fix floor() check X-Git-Tag: 0.10.0~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59b542f66861bdf9fe15af4b8185ff1e65287a34;p=check autotools: fix floor() check The floor check did not work properly on Solaris. The check yields this in config.h: #define HAVE_FLOOR $HAVE_FLOOR which results in the following build failure: "libcompat.h", line 127: token not allowed in directive: $ This fix is provided by Georg Sauthoff. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1144 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/AUTHORS b/AUTHORS index 8b22163..6595ca3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -47,7 +47,7 @@ Contributors: Julien Godin (configure.ac patch for Check example) Kosma Moczek (fix for string formatting in ck_assert_*() methods with %) Tim Müller (Use _exit() instead of exit() on _ck_assert_failed()) - Georg Sauthoff (Solaris support) + Georg Sauthoff (Solaris support, misc autotools fixes) Anybody who has contributed code to Check or Check's build system is considered an author. Send patches to this file to diff --git a/configure.ac b/configure.ac index 6582759..062ec18 100644 --- a/configure.ac +++ b/configure.ac @@ -189,15 +189,8 @@ ACX_PTHREAD CC="$PTHREAD_CC" # Check if floor is in the math library, and if so add -lm to LIBS -HAVE__FLOOR=0 -AC_SEARCH_LIBS([floor], [m], [HAVE_FLOOR=1], [HAVE_FLOOR=0]) -if test "x$HAVE_FLOOR" = "x0"; then - # floor() is not available in libm (e.g. using AIX platform's compiler). - # Maybe __floor() is defined instead - AC_CHECK_FUNCS(__floor) -fi -AC_DEFINE([HAVE_FLOOR], [$HAVE_FLOOR], [Does the system have floor()?]) -AC_DEFINE([HAVE___FLOOR], [$HAVE___FLOOR], [Does the system have __floor()?]) +AC_SEARCH_LIBS([floor], [m], [AC_DEFINE([HAVE_FLOOR], [1], [Does the system have floor()?])], +[AC_CHECK_FUNCS(__floor, [AC_DEFINE([HAVE___FLOOR], [1], [Does the system have __floor()?])], [])]) # Check if clock_gettime, timer_create, timer_settime, and timer_delete are available in lib rt, and if so, # add -lrt to LIBS