From 19ae4438ab53be2dc3a0ddd2bfd94c5a78e40363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 5 Sep 2018 13:29:28 +0200 Subject: [PATCH] Replace custom HAVE_SYSCONF with proper AC_CHECK_FUNCS call --- acconfig.h | 3 --- config.h.in | 6 +++--- configure | 9 +++++++-- configure.in | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/acconfig.h b/acconfig.h index 43a2e90993..2ab1a827cd 100644 --- a/acconfig.h +++ b/acconfig.h @@ -20,9 +20,6 @@ /** define if your system has sigwait() */ #undef HAVE_SIGWAIT -/** define if sysconf() is available */ -#undef HAVE_SYSCONF - /** define if sysctlbyname() is available */ #undef HAVE_SYSCTLBYNAME diff --git a/config.h.in b/config.h.in index f2ad6c379e..3cc00140c0 100644 --- a/config.h.in +++ b/config.h.in @@ -20,9 +20,6 @@ /** define if your system has sigwait() */ #undef HAVE_SIGWAIT -/** define if sysconf() is available */ -#undef HAVE_SYSCONF - /** define if sysctlbyname() is available */ #undef HAVE_SYSCTLBYNAME @@ -413,6 +410,9 @@ /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY +/* Define to 1 if you have the `sysconf' function. */ +#undef HAVE_SYSCONF + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CAPABILITY_H diff --git a/configure b/configure index dda2137af9..701d58e226 100755 --- a/configure +++ b/configure @@ -15358,11 +15358,16 @@ done # # Look for sysconf to allow detection of the number of processors. # -ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" +for ac_func in sysconf +do : + ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" if test "x$ac_cv_func_sysconf" = xyes; then : - $as_echo "#define HAVE_SYSCONF 1" >>confdefs.h + cat >>confdefs.h <<_ACEOF +#define HAVE_SYSCONF 1 +_ACEOF fi +done diff --git a/configure.in b/configure.in index ce82ce1dc0..fd135f7436 100644 --- a/configure.in +++ b/configure.in @@ -761,7 +761,7 @@ AC_CHECK_HEADERS([pthread_np.h], [], [], [#include ]) # # Look for sysconf to allow detection of the number of processors. # -AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),) +AC_CHECK_FUNCS([sysconf]) AC_SUBST(ALWAYS_DEFINES)