From b20bb543ced602748d3d5fad191dda07919be13d Mon Sep 17 00:00:00 2001 From: James Abbatiello Date: Tue, 19 Jan 2021 13:51:59 -0500 Subject: [PATCH] Find the correct library for clock_gettime before trying to use it Otherwise if clock_gettime is librt then this code will incorrectly believe that the function does not exist at all. --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 1feeb0fc..59081807 100644 --- a/configure.ac +++ b/configure.ac @@ -92,6 +92,10 @@ AC_TYPE_UINT64_T # ---------------------------------------------------------------------- AC_FUNC_CLOSEDIR_VOID AC_FUNC_STAT + +AC_SEARCH_LIBS([dlopen], [dl dld]) +AC_SEARCH_LIBS([clock_gettime], [rt]) + AC_CHECK_FUNCS([\ clock_gettime\ faccessat\ @@ -101,9 +105,6 @@ AC_CHECK_FUNCS([\ readlinkat\ ]) -AC_SEARCH_LIBS([dlopen], [dl dld]) -AC_SEARCH_LIBS([clock_gettime], [rt]) - save_cflags="${CFLAGS}" CFLAGS="${CFLAGS} -std=c99" AC_MSG_CHECKING([whether cc -std=c99 option works])