Browse Source

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
OPENBSD_6_0
Brent Cook 8 years ago
parent
commit
9d85444811
2 changed files with 6 additions and 4 deletions
  1. +2
    -2
      configure.ac
  2. +4
    -2
      m4/check-libc-compat.m4

+ 2
- 2
configure.ac View File

@ -51,10 +51,10 @@ AC_SEARCH_LIBS([ibuf_open], [util])
AC_CHECK_FUNCS([ibuf_open]) AC_CHECK_FUNCS([ibuf_open])
# time-specific system functions # 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_getres],[rt posix4])
AC_SEARCH_LIBS([clock_gettime],[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_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_GETRES], [test "x$ac_cv_func_clock_getres" = xyes])
AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "x$ac_cv_func_clock_gettime" = xyes]) AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "x$ac_cv_func_clock_gettime" = xyes])


+ 4
- 2
m4/check-libc-compat.m4 View File

@ -56,8 +56,10 @@ AM_CONDITIONAL([HAVE_ARC4RANDOM_BUF],
# Check for getentropy fallback dependencies # Check for getentropy fallback dependencies
AC_CHECK_FUNC([getauxval]) 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], [ AC_DEFUN([CHECK_VA_COPY], [


Loading…
Cancel
Save