diff --git a/configure b/configure
index ac543f09a2e115c5df6d0d77256bfaf802ecd5a9..d3253a2ca7628a95dedcebe53c8c4cb6c5d66e65 100755
--- a/configure
+++ b/configure
@@ -17688,8 +17688,10 @@ fi
 done
 
 
-ac_save_LIBS=$LIBS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+case $host_os in
+    darwin*|macosx*) ;;
+    *) ac_save_LIBS=$LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
 $as_echo_n "checking for library containing clock_gettime... " >&6; }
 if ${ac_cv_search_clock_gettime+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -17749,7 +17751,9 @@ $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
 
 fi
 
-LIBS=$ac_save_LIBS
+    LIBS=$ac_save_LIBS
+    ;;
+esac
 
 if test "x$with_ldap" != "xno"
 then
diff --git a/configure.ac b/configure.ac
index 10cef9c7b7a4e7b42f7b982ce0e74af70b721542..c7f5236cf8547d3a126228c6c0330bed468679f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2169,11 +2169,15 @@ AC_CHECK_FUNCS(\
 )
 
 dnl Check for clock_gettime which may be in -lrt
-ac_save_LIBS=$LIBS
-AC_SEARCH_LIBS(clock_gettime, rt,
-               [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define to 1 if you have the `clock_gettime' function.])
+case $host_os in
+    darwin*|macosx*) ;;
+    *) ac_save_LIBS=$LIBS
+        AC_SEARCH_LIBS(clock_gettime, rt,
+            [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define to 1 if you have the `clock_gettime' function.])
                 test "$ac_res" = "none required" || AC_SUBST(RT_LIBS,"$ac_res")])
-LIBS=$ac_save_LIBS
+    LIBS=$ac_save_LIBS
+    ;;
+esac
 
 dnl **** Check for OpenLDAP ***
 if test "x$with_ldap" != "xno"