Code

octo@casella:~/collectd $ svn merge -r753:807 trunk branches/processes
[collectd.git] / configure.in
index de7dbea590af01ca7172cf541f70116e59127548..8ca08a11314412e4edc3e7c174f7b872806f20ec 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.9.2)
+AC_INIT(collectd, 3.10.0-alpha3)
 AC_CONFIG_SRCDIR(src/collectd.c)
 AC_CONFIG_HEADERS(src/config.h)
 AM_INIT_AUTOMAKE(dist-bzip2)
@@ -44,6 +44,7 @@ AC_CHECK_HEADERS(assert.h)
 AC_CHECK_HEADERS(sys/types.h)
 AC_CHECK_HEADERS(sys/socket.h)
 AC_CHECK_HEADERS(sys/select.h)
+AC_CHECK_HEADERS(sys/poll.h)
 AC_CHECK_HEADERS(netdb.h)
 AC_CHECK_HEADERS(arpa/inet.h)
 AC_CHECK_HEADERS(sys/resource.h)
@@ -54,11 +55,17 @@ AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
 [#if HAVE_STDINT_H
 # include <stdint.h>
 #endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
 ])
 AC_CHECK_HEADERS(netinet/in.h, [], [],
 [#if HAVE_STDINT_H
 # include <stdint.h>
 #endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
 #if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
@@ -67,6 +74,9 @@ AC_CHECK_HEADERS(netinet/ip.h, [], [],
 [#if HAVE_STDINT_H
 # include <stdint.h>
 #endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
 #if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
@@ -78,6 +88,9 @@ AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
 [#if HAVE_STDINT_H
 # include <stdint.h>
 #endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
 #if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
@@ -92,6 +105,9 @@ AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
 [#if HAVE_STDINT_H
 # include <stdint.h>
 #endif
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
 #if HAVE_NETINET_IN_SYSTM_H
 # include <netinet/in_systm.h>
 #endif
@@ -711,6 +727,59 @@ AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql],
        [Wether or not to use mysql library])
 AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
 
+#with_liboping="yes"
+with_own_liboping="no"
+liboping_LDFLAGS="$LDFLAGS"
+liboping_CPPFLAGS="$CPPFLAGS"
+AC_ARG_WITH(liboping, [AS_HELP_STRING([--with-liboping@<:@=PREFIX@:>@], [Path to liboping.])],
+[
+       if test "x$withval" != "xno" && test "x$withval" != "xyes"
+       then
+               if test -d "$withval/lib"
+               then
+                       liboping_LDFLAGS="$LDFLAGS -L$withval/lib"
+               fi
+               if test -d "$withval/include"
+               then
+                       liboping_CPPFLAGS="$CPPFLAGS -I$withval/include"
+               fi
+       fi
+       if test "x$withval" = "xno"
+       then
+               with_liboping="no"
+               with_own_liboping="no"
+       fi
+],
+[
+       #753
+       with_liboping="yes"
+])
+
+if test "x$with_liboping" = "xyes"
+then
+       save_LDFLAGS="$LDFLAGS"
+       save_CPPFLAGS="$CPPFLAGS"
+       LDFLAGS="$liboping_LDFLAGS"
+       CPPFLAGS="$liboping_CPPFLAGS"
+       AC_CHECK_LIB(oping, ping_construct,
+       [
+               with_liboping="yes"
+               with_own_liboping="no"
+       ],
+       [
+               with_liboping="yes"
+               with_own_liboping="yes"
+               LDFLAGS="$save_LDFLAGS"
+               CPPFLAGS="$save_CPPFLAGS"
+       ])
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBOPING, test "x$with_liboping" = "xyes")
+AM_CONDITIONAL(BUILD_WITH_OWN_LIBOPING, test "x$with_own_liboping" = "xyes")
+if test "x$with_liboping" = "xyes" -a "x$with_own_liboping" = "xyes"
+then
+       with_liboping="yes (shipped version)"
+fi
+
 # Define `step' and `hearbeat' values..
 declare -i collectd_step=10
 declare -i collectd_heartbeat=25
@@ -833,6 +902,7 @@ AC_COLLECTD([load],      [disable], [module], [system load statistics])
 AC_COLLECTD([memory],    [disable], [module], [memory statistics])
 AC_COLLECTD([mysql],     [disable], [module], [mysql statistics])
 AC_COLLECTD([nfs],       [disable], [module], [nfs statistics])
+AC_COLLECTD([ntpd],      [disable], [module], [nfs statistics])
 AC_COLLECTD([ping],      [disable], [module], [ping statistics])
 AC_COLLECTD([processes], [disable], [module], [processes statistics])
 AC_COLLECTD([sensors],   [disable], [module], [lm_sensors statistics])
@@ -844,7 +914,7 @@ AC_COLLECTD([users],     [disable], [module], [user count statistics])
 AC_COLLECTD([vserver],   [disable], [module], [vserver statistics])
 AC_COLLECTD([wireless],  [disable], [module], [wireless link statistics])
 
-AC_OUTPUT(Makefile src/libconfig/Makefile src/liboping/Makefile src/Makefile)
+AC_OUTPUT(Makefile src/Makefile src/libconfig/Makefile src/liboping/Makefile)
 
 cat <<EOF;
 
@@ -852,6 +922,7 @@ Configuration:
   Libraries:
     libcurl . . . . . . $with_libcurl
     libiokit  . . . . . $with_libiokit
+    liboping  . . . . . $with_liboping
     librrd  . . . . . . $with_rrdtool
     lm_sensors  . . . . $with_lm_sensors
     libstatgrab . . . . $with_libstatgrab
@@ -878,6 +949,7 @@ Configuration:
     memory  . . . . . . $enable_memory
     mysql . . . . . . . $enable_mysql
     nfs . . . . . . . . $enable_nfs
+    ntpd  . . . . . . . $enable_ntpd
     ping  . . . . . . . $enable_ping
     processes . . . . . $enable_processes
     sensors . . . . . . $enable_sensors