From 816e5c7e8f8220820200840f7f8bd694035eff0e Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Mon, 25 Apr 2016 10:54:37 -0700 Subject: [PATCH] Update buildsys to detect posix_fadvise() --- config.h.in | 6 ++++++ configure | 23 +++++++++++++++++++++++ configure.in | 3 +++ src/twtest/Makefile.in | 0 4 files changed, 32 insertions(+) mode change 100755 => 100644 src/twtest/Makefile.in diff --git a/config.h.in b/config.h.in index 6258a87..9aea382 100644 --- a/config.h.in +++ b/config.h.in @@ -12,6 +12,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_BITS_SIGNUM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + /* Uses the GNU gcc compiler */ #undef HAVE_GCC @@ -48,6 +51,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SHA_H +/* Define to 1 if you have the `posix_fadvise' function. */ +#undef HAVE_POSIX_FADVISE + /* Define to 1 if you have the header file. */ #undef HAVE_SIGNUM_H diff --git a/configure b/configure index e3499db..2856078 100755 --- a/configure +++ b/configure @@ -5864,6 +5864,29 @@ fi done +for ac_header in fcntl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FCNTL_H 1 +_ACEOF + for ac_func in posix_fadvise +do : + ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" +if test "x$ac_cv_func_posix_fadvise" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POSIX_FADVISE 1 +_ACEOF + +fi +done + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lc" >&5 $as_echo_n "checking for socket in -lc... " >&6; } diff --git a/configure.in b/configure.in index da9f7fd..41ec342 100644 --- a/configure.in +++ b/configure.in @@ -106,6 +106,9 @@ dnl ############################# AC_CHECK_FUNCS(strftime gethostname gethostid) AC_CHECK_FUNCS(mkstemp mktemp, break) +dnl check for posix_fadvise +AC_CHECK_HEADERS(fcntl.h, [AC_CHECK_FUNCS(posix_fadvise)]) + dnl ############################################## dnl Checks for various platform specific libraries dnl ############################################## diff --git a/src/twtest/Makefile.in b/src/twtest/Makefile.in old mode 100755 new mode 100644