Bug 752280 - Use LIBS instead of LDFLAGS when testing for clock_gettime in librt. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 07 May 2012 14:18:07 +0200
changeset 94729 0321d95b860d3d4d258df8a6fd6213e6808a6c58
parent 94728 b65d61a1d0eef5b737f2217049ed237e74f26bf9
child 94730 052109db69ab2143b555fcfb9fcbdad1b60fc513
push idunknown
push userunknown
push dateunknown
reviewersted
bugs752280
milestone15.0a1
Bug 752280 - Use LIBS instead of LDFLAGS when testing for clock_gettime in librt. r=ted
configure.in
--- a/configure.in
+++ b/configure.in
@@ -3581,25 +3581,25 @@ AC_FUNC_MEMCMP
 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
 AC_CHECK_FUNCS(flockfile getpagesize)
 AC_CHECK_FUNCS(localtime_r strtok_r)
 
 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
                ac_cv_clock_monotonic,
                [for libs in "" -lrt; do
-                    _SAVE_LDFLAGS="$LDFLAGS"
-                    LDFLAGS="$LDFLAGS $libs"
+                    _SAVE_LIBS="$LIBS"
+                    LIBS="$LIBS $libs"
                     AC_TRY_LINK([#include <time.h>],
                                  [ struct timespec ts;
                                    clock_gettime(CLOCK_MONOTONIC, &ts); ],
                                  ac_cv_clock_monotonic=$libs
                                  break,
                                  ac_cv_clock_monotonic=no)
-                    LDFLAGS="$_SAVE_LDFLAGS"
+                    LIBS="$_SAVE_LIBS"
                 done])
 if test "$ac_cv_clock_monotonic" != "no"; then
     HAVE_CLOCK_MONOTONIC=1
     REALTIME_LIBS=$ac_cv_clock_monotonic
     AC_DEFINE(HAVE_CLOCK_MONOTONIC)
     AC_SUBST(HAVE_CLOCK_MONOTONIC)
     AC_SUBST(REALTIME_LIBS)
 fi