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.
This commit is contained in:
James Abbatiello 2021-01-19 13:51:59 -05:00 committed by BenBE
parent 03824da684
commit b20bb543ce
1 changed files with 4 additions and 3 deletions

View File

@ -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])