From ab763014f53af00a2aebc4e710a1388c85f4c7e0 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sun, 24 Apr 2016 03:22:23 -0500 Subject: [PATCH] use AC_SEARCH_LIBS for checking if a function exists After importing the libc detection functions from libressl, it caused the detection to go out of order, leading to a link failure on older Linux versions. fix #23 --- configure.ac | 4 ++-- m4/check-libc-compat.m4 | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 1d19e0c..f8b10f8 100644 --- a/configure.ac +++ b/configure.ac @@ -51,10 +51,10 @@ AC_SEARCH_LIBS([ibuf_open], [util]) AC_CHECK_FUNCS([ibuf_open]) # time-specific system functions -AC_CHECK_FUNCS([adjfreq ntp_adjtime adjtimex]) -AC_CHECK_FUNCS([clock_gettime clock_getres]) AC_SEARCH_LIBS([clock_getres],[rt posix4]) AC_SEARCH_LIBS([clock_gettime],[rt posix4]) +AC_CHECK_FUNCS([adjfreq ntp_adjtime adjtimex]) +AC_CHECK_FUNCS([clock_gettime clock_getres]) AM_CONDITIONAL([HAVE_ADJFREQ], [test "x$ac_cv_func_adjfreq" = xyes]) AM_CONDITIONAL([HAVE_CLOCK_GETRES], [test "x$ac_cv_func_clock_getres" = xyes]) AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "x$ac_cv_func_clock_gettime" = xyes]) diff --git a/m4/check-libc-compat.m4 b/m4/check-libc-compat.m4 index f790780..cad0819 100644 --- a/m4/check-libc-compat.m4 +++ b/m4/check-libc-compat.m4 @@ -56,8 +56,10 @@ AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF], # Check for getentropy fallback dependencies AC_CHECK_FUNC([getauxval]) -AC_CHECK_FUNC([clock_gettime],, [AC_SEARCH_LIBS([clock_gettime],[rt posix4])]) -AC_CHECK_FUNC([dl_iterate_phdr],, [AC_SEARCH_LIBS([dl_iterate_phdr],[dl])]) +AC_SEARCH_LIBS([clock_gettime],[rt posix4]) +AC_CHECK_FUNC([clock_gettime]) +AC_SEARCH_LIBS([dl_iterate_phdr],[dl]) +AC_CHECK_FUNC([dl_iterate_phdr]) ]) AC_DEFUN([CHECK_VA_COPY], [