configure.ac: Use AC_TRY_COMPILE instead of AC_TRY_RUN to check for _POSIX_TIMER...
authorTim-Philipp Müller <tim@centricular.net>
Thu, 24 Jan 2008 23:28:54 +0000 (23:28 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Thu, 24 Jan 2008 23:28:54 +0000 (23:28 +0000)
Original commit message from CVS:
* configure.ac:
Use AC_TRY_COMPILE instead of AC_TRY_RUN to check for
_POSIX_TIMER, _POSIX_MONOTONIC_CLOCK, etc. Makes configure
not fail when trying to crosscompile on OpenEmbedded (#511750).

ChangeLog
common
configure.ac

index 3249230..87aa100 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-24  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * configure.ac:
+         Use AC_TRY_COMPILE instead of AC_TRY_RUN to check for
+         _POSIX_TIMER, _POSIX_MONOTONIC_CLOCK, etc. Makes configure
+         not fail when trying to crosscompile on OpenEmbedded (#511750).
+
 2008-01-20  Sebastian Dröge  <slomo@circular-chaos.org>
 
        * docs/manuals.mak:
diff --git a/common b/common
index 662f544..571dce3 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 662f544d56a6d6ef20b8ea5f56e975f9e139bc78
+Subproject commit 571dce3335f9be76978009b3842c050dbb900e6f
index 5d59d0d..94a820e 100644 (file)
@@ -372,18 +372,23 @@ AC_CHECK_FUNCS(clock_gettime, [], [
   ])
 ])
 
-AC_CACHE_CHECK(for posix timers, gst_cv_posix_timers,AC_TRY_RUN([
+AC_CACHE_CHECK(for posix timers, gst_cv_posix_timers,
+    AC_TRY_COMPILE([
 #include <time.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-      int main() {
-#if defined(_POSIX_TIMERS) && _POSIX_TIMERS >= 0 && defined(CLOCK_REALTIME)
-        return 0;
-#else
-        return 1;
+    ], [
+#if !defined(_POSIX_TIMERS) || _POSIX_TIMERS < 0 || !defined(CLOCK_REALTIME)
+#error Either _POSIX_TIMERS or CLOCK_REALTIME not defined
 #endif
-      }],gst_cv_posix_timers=yes,gst_cv_posix_timers=no))
+      return 0;
+    ], [
+      gst_cv_posix_timers=yes
+    ], [
+      gst_cv_posix_timers=no
+    ])
+)
 
 if test "$gst_cv_posix_timers" = "yes"; then
   AC_DEFINE(HAVE_POSIX_TIMERS,1,[Have posix timers])
@@ -394,18 +399,23 @@ fi
 AC_SUBST(GST_HAVE_POSIX_TIMERS_DEFINE)
 AM_CONDITIONAL(GST_HAVE_POSIX_TIMERS, test "$gst_cv_posix_timers" = "yes")
 
-AC_CACHE_CHECK(for monotonic clock, gst_cv_monotonic_clock,AC_TRY_RUN([
+AC_CACHE_CHECK(for monotonic clock, gst_cv_monotonic_clock,
+    AC_TRY_COMPILE([
 #include <time.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-      int main() {
-#if defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC)
-        return 0;
-#else
-        return 1;
+    ], [
+#if !defined(_POSIX_MONOTONIC_CLOCK) || _POSIX_MONOTONIC_CLOCK < 0 || !defined(CLOCK_MONOTONIC)
+#error Either _POSIX_MONOTONIC_CLOCK or CLOCK_MONOTONIC not defined
 #endif
-      }],gst_cv_monotonic_clock=yes,gst_cv_monotonic_clock=no))
+      return 0;
+    ], [
+      gst_cv_monotonic_clock=yes
+    ], [
+      gst_cv_monotonic_clock=no
+    ])
+)
 
 if test "$gst_cv_monotonic_clock" = "yes"; then
   AC_DEFINE(HAVE_MONOTONIC_CLOCK,1,[Have a monotonic clock])