From: brarcher Date: Mon, 23 Jun 2014 04:12:55 +0000 (+0000) Subject: autotools: change check for floor() and __floor() X-Git-Tag: 0.10.0~71 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6e0d6353f02eecae06150b85ba0ab95e4790352;p=check autotools: change check for floor() and __floor() The reason AIX is having difficulty with floor() is that the AC_CHECK_LIB([m], [floor]) finds floor() in libm, however due to some header file stuff (maybe) floor() cannot be used directly. Instead, there is likely a definition for __floor() -> floor(). To check for this, floor() is detected in libm as normal. After, determine if floor() can be used directly. If not, check if __floor() is defined (not necessarily a function). If floor() is usable, do that. If not but __floor() is available, try using that. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1147 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/NEWS b/NEWS index 5b25c8e..31472df 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ In Development: # Mentioning Check 0.9.13 for now, to fix distcheck target until next release +* Changes to (unofficially for now) support Solaris and AIX platforms. + Fri May 30, 2014: Released Check 0.9.13 based on r1137 (2014-05-26 21:03:09 +0000) diff --git a/configure.ac b/configure.ac index 062ec18..a575471 100644 --- a/configure.ac +++ b/configure.ac @@ -189,8 +189,17 @@ ACX_PTHREAD CC="$PTHREAD_CC" # Check if floor is in the math library, and if so add -lm to LIBS -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()?])], [])]) +AC_CHECK_LIB([m], [floor]) + +# On some versions of AIX, although floor() is found in libm, +# it cannot be used directly. Instead __floor() must be used. +# This checks if this is the case. +AC_CHECK_FUNC([floor], + [AC_DEFINE([HAVE_FLOOR], [1], [Can the system use floor() directly?])], + [AC_CHECK_DECL([__floor], + [AC_DEFINE([HAVE___FLOOR], [1], [Does the system define __floor() instead?])], + []) + ]) # Check if clock_gettime, timer_create, timer_settime, and timer_delete are available in lib rt, and if so, # add -lrt to LIBS