diff --git a/m4/clock_gettime b/m4/clock_gettime index aa9542c5ec..9f872a8f1c 100644 --- a/m4/clock_gettime +++ b/m4/clock_gettime @@ -17,6 +17,7 @@ AC_DEFUN([AC_CLOCK], if test "$have_clock_gettime" = "no"; then AC_MSG_CHECKING([for clock_gettime in -lrt]) + SAVED_LIBS=$LIBS LIBS="$LIBS -lrt" AC_TRY_LINK([ #include ], [struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);], [ @@ -68,8 +69,9 @@ AC_DEFUN([AC_CLOCK], if test "$have_clock_get_time" = "yes"; then AC_DEFINE([HAVE_CLOCK_GET_TIME], 1, [do we have clock_get_time?]) fi - RT_LIBS=LIBS + RT_LIBS=$LIBS AC_SUBST(RT_LIBS) + SAVED_LIBS=$LIBS ]) dnl Local Variables: