From 5ddcfa019d027d9d690c98151c708eb4e7d5f72b Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Tue, 14 May 2019 09:53:41 +0100 Subject: [PATCH] configure: Don't define HAVE_CLOCK_GETTIME on macOS. Using clock_gettime() on macOS is problematical; see commit 27c71e09ad51ba6aa672a46379efd10b5959863f for an explanation. Possible configure tests for this end up being quite ugly, so avoiding it altogether seems simplest. Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- configure | 10 +++++++--- configure.ac | 12 ++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/configure b/configure index ac543f09a2e..d3253a2ca76 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 10cef9c7b7a..c7f5236cf85 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"