Check for <sys/sysctl.h> in configure

Also check for <sys/param.h>, which is a prerequisite on OpenBSD
This commit is contained in:
pooler 2012-04-07 14:55:50 +02:00
parent 132863599c
commit 3151311af0
2 changed files with 16 additions and 4 deletions

View file

@ -18,7 +18,15 @@ AC_PROG_RANLIB
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS([sys/param.h syslog.h])
# sys/sysctl.h requires sys/types.h on FreeBSD
# sys/sysctl.h requires sys/param.h on OpenBSD
AC_CHECK_HEADERS([sys/sysctl.h], [], [],
[#include <sys/types.h>
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
])
AC_FUNC_ALLOCA

View file

@ -18,14 +18,18 @@
#include <unistd.h>
#include <sys/time.h>
#include <time.h>
#if defined(WIN32)
#ifdef WIN32
#include <windows.h>
#elif defined(sun) || defined(__sun)
#include <sys/resource.h>
#else
#include <sys/resource.h>
#if HAVE_SYS_SYSCTL_H
#include <sys/types.h>
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#include <sys/sysctl.h>
#endif
#endif
#include <getopt.h>
#include <jansson.h>
#include <curl/curl.h>