]> granicus.if.org Git - check/commitdiff
autotools: fix floor() check
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 19 Jun 2014 01:53:30 +0000 (01:53 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 19 Jun 2014 01:53:30 +0000 (01:53 +0000)
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

AUTHORS
configure.ac

diff --git a/AUTHORS b/AUTHORS
index 8b22163cccf98499dc822809e319976a74a3e190..6595ca308edba305c000aa337359083f970144ab 100644 (file)
--- 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 
index 6582759c6a614f97afe6c541d8ac5c422a4f4d90..062ec1882f94ebdf5d5af5772b91866b4783c256 100644 (file)
@@ -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