From: Tim-Philipp Müller Date: Thu, 24 Jan 2008 23:28:54 +0000 (+0000) Subject: configure.ac: Use AC_TRY_COMPILE instead of AC_TRY_RUN to check for _POSIX_TIMER... X-Git-Tag: RELEASE-0_10_16~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ab5970c4e5fb0b0da7e8cac4390d86e92a468cc;p=platform%2Fupstream%2Fgstreamer.git configure.ac: Use AC_TRY_COMPILE instead of AC_TRY_RUN to check for _POSIX_TIMER, _POSIX_MONOTONIC_CLOCK, etc. Makes ... 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). --- diff --git a/ChangeLog b/ChangeLog index 3249230..87aa100 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-01-24 Tim-Philipp Müller + + * 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 * docs/manuals.mak: diff --git a/common b/common index 662f544..571dce3 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 662f544d56a6d6ef20b8ea5f56e975f9e139bc78 +Subproject commit 571dce3335f9be76978009b3842c050dbb900e6f diff --git a/configure.ac b/configure.ac index 5d59d0d..94a820e 100644 --- a/configure.ac +++ b/configure.ac @@ -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 #ifdef HAVE_UNISTD_H #include #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 #ifdef HAVE_UNISTD_H #include #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])