X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=8f6eadeedfc825cc74cf60a20b5d6f4d339712fd;hb=b86dd62eef146a35d43b60efa20d30756ce78d00;hp=b3a7dcc8064820029757a15e244bd505c23b1e1b;hpb=3bd6fcdfd20002eee1f1803460728449c0c98f86;p=collectd.git diff --git a/configure.in b/configure.in index b3a7dcc8..8f6eadee 100644 --- a/configure.in +++ b/configure.in @@ -88,6 +88,10 @@ if test "x$ac_system" = "xSolaris" then AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.]) fi +if test "x$ac_system" = "xAIX" +then + AC_DEFINE(_THREAD_SAFE_ERRNO, 1, [Define to use the thread-safe version of errno under AIX.]) +fi # Where to install .pc files. pkgconfigdir="${libdir}/pkgconfig" @@ -115,7 +119,7 @@ AC_HEADER_SYS_WAIT AC_HEADER_DIRENT AC_HEADER_STDBOOL -AC_CHECK_HEADERS(stdio.h stdint.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h) +AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h) # For ping library AC_CHECK_HEADERS(netinet/in_systm.h, [], [], @@ -477,10 +481,17 @@ AC_HEADER_TIME # Checks for library functions. # AC_PROG_GCC_TRADITIONAL -AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf) +AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv) AC_FUNC_STRERROR_R +SAVE_CFLAGS="$CFLAGS" +# Emulate behavior of src/Makefile.am +if test "x$GCC" = "xyes" +then + CFLAGS="$CFLAGS -Wall -Werror" +fi + AC_CACHE_CHECK([for strtok_r], [c_cv_have_strtok_r_default], AC_LINK_IFELSE( @@ -511,7 +522,6 @@ AC_CACHE_CHECK([for strtok_r], if test "x$c_cv_have_strtok_r_default" = "xno" then - SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -D_REENTRANT=1" AC_CACHE_CHECK([if strtok_r needs _REENTRANT], @@ -543,6 +553,12 @@ then ) fi +CFLAGS="$SAVE_CFLAGS" +if test "x$c_cv_have_strtok_r_reentrant" = "xyes" +then + CFLAGS="$CFLAGS -D_REENTRANT=1" +fi + AC_CHECK_FUNCS(getpwnam_r getgrnam_r setgroups regcomp regerror regexec regfree) socket_needs_socket="no" @@ -550,8 +566,16 @@ AC_CHECK_FUNCS(socket, [], AC_CHECK_LIB(socket, socket, [socket_needs_socket="ye AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes") nanosleep_needs_rt="no" -AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep))) +nanosleep_needs_posix4="no" +AC_CHECK_FUNCS(nanosleep, + [], + AC_CHECK_LIB(rt, nanosleep, + [nanosleep_needs_rt="yes"], + AC_CHECK_LIB(posix4, nanosleep, + [nanosleep_needs_posix4="yes"], + AC_MSG_ERROR(cannot find nanosleep)))) AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes") +AM_CONDITIONAL(BUILD_WITH_LIBPOSIX4, test "x$nanosleep_needs_posix4" = "xyes") AC_CHECK_FUNCS(sysctl, [have_sysctl="yes"], [have_sysctl="no"]) AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"]) @@ -707,6 +731,9 @@ if test "x$fp_layout_type" = "xunknown"; then #if HAVE_STDINT_H # include #endif +#if HAVE_INTTYPES_H +# include +#endif #if HAVE_STDBOOL_H # include #endif @@ -751,6 +778,9 @@ if test "x$fp_layout_type" = "xunknown"; then #if HAVE_STDINT_H # include #endif +#if HAVE_INTTYPES_H +# include +#endif #if HAVE_STDBOOL_H # include #endif @@ -803,6 +833,9 @@ if test "x$fp_layout_type" = "xunknown"; then #if HAVE_STDINT_H # include #endif +#if HAVE_INTTYPES_H +# include +#endif #if HAVE_STDBOOL_H # include #endif @@ -931,6 +964,27 @@ if test "x$have_getmntent" = "xgen"; then [Define if the function getmntent exists. It's the version from libgen.]) fi +# Check for htonll +AC_MSG_CHECKING([if have htonll defined]) + + have_htonll="no" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ +#include +#include +#if HAVE_INTTYPES_H +# include +#endif + ], [ + return htonll(0); + ]) + ], [ + have_htonll="yes" + AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.]) + ]) + +AC_MSG_RESULT([$have_htonll]) + # Check for structures AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors], [AC_DEFINE(HAVE_STRUCT_IF_DATA, 1, [Define if struct if_data exists and is usable.])], @@ -3877,7 +3931,7 @@ then plugin_vserver="yes" plugin_wireless="yes" - if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes" + if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes" then plugin_ipvs="yes" fi @@ -4338,7 +4392,7 @@ then with_librrd="yes (warning: librrd is not thread-safe)" fi -if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes" +if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes" then with_libiptc="yes (shipped version)" fi