If cross-compiling, test for the existence of pthread_condattr_setclock only
authorMartin Willi <martin@strongswan.org>
Mon, 9 Nov 2009 10:43:15 +0000 (11:43 +0100)
committerMartin Willi <martin@strongswan.org>
Mon, 9 Nov 2009 14:07:01 +0000 (15:07 +0100)
configure.in

index 8efa643..a6fdfa7 100644 (file)
@@ -286,8 +286,14 @@ AC_TRY_RUN(
                pthread_condattr_init(&attr);
                return pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);}],
        [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_CONDATTR_CLOCK_MONOTONIC])],
-       [AC_MSG_RESULT([no])]
+       [AC_MSG_RESULT([no])],
+       dnl Check existence of pthread_condattr_setclock if cross-compiling
+       [AC_MSG_RESULT([unknown]);
+        AC_CHECK_FUNCS(pthread_condattr_setclock,
+               [AC_DEFINE([HAVE_CONDATTR_CLOCK_MONOTONIC])]
+       )]
 )
+
 LIBS=$saved_LIBS
 
 AC_CHECK_FUNCS(prctl)