Bumped version to 4.0.0; Updated ChangeLog.
[collectd.git] / configure.in
index 3d8cf40..b05f987 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 4.0.0-rc5)
+AC_INIT(collectd, 4.0.0)
 AC_CONFIG_SRCDIR(src/collectd.c)
 AC_CONFIG_HEADERS(src/config.h)
 AM_INIT_AUTOMAKE(dist-bzip2)
@@ -7,6 +7,8 @@ AC_LANG(C)
 
 AC_PREFIX_DEFAULT("/opt/collectd")
 
+AC_SYS_LARGEFILE
+
 #
 # Checks for programs.
 #
@@ -208,6 +210,7 @@ AC_CHECK_HEADERS(mach/kern_return.h)
 
 # For hddtemp module
 AC_CHECK_HEADERS(linux/major.h)
+AC_CHECK_HEADERS(libgen.h)
 
 # For the apple_sensors module
 AC_CHECK_HEADERS(CoreFoundation/CoreFoundation.h)
@@ -280,7 +283,7 @@ AC_CHECK_HEADERS(linux/netdevice.h, [], [],
 AC_CHECK_HEADERS(curl/curl.h)
 
 # For quota module
-AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h)
+AC_CHECK_HEADERS(pwd.h sys/ucred.h)
 AC_CHECK_HEADERS(ctype.h)
 AC_CHECK_HEADERS(limits.h)
 AC_CHECK_HEADERS(sys/quota.h)
@@ -984,6 +987,53 @@ 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_own_liboconfig="no"
+liboconfig_LDFLAGS="$LDFLAGS"
+liboconfig_CPPFLAGS="$CPPFLAGS"
+AC_ARG_WITH(liboconfig, [AS_HELP_STRING([--with-liboconfig@<:@=PREFIX@:>@], [Path to liboconfig.])],
+[
+       if test "x$withval" != "xno" && test "x$withval" != "xyes"
+       then
+               if test -d "$withval/lib"
+               then
+                       liboconfig_LDFLAGS="$LDFLAGS -L$withval/lib"
+               fi
+               if test -d "$withval/include"
+               then
+                       liboconfig_CPPFLAGS="$CPPFLAGS -I$withval/include"
+               fi
+       fi
+       if test "x$withval" = "xno"
+       then
+               AC_MSG_ERROR("liboconfig is required")
+       fi
+],
+[
+       with_liboconfig="yes"
+])
+
+save_LDFLAGS="$LDFLAGS"
+save_CPPFLAGS="$CPPFLAGS"
+LDFLAGS="$liboconfig_LDFLAGS"
+CPPFLAGS="$liboconfig_CPPFLAGS"
+AC_CHECK_LIB(oconfig, oconfig_parse_fh,
+[
+       with_liboconfig="yes"
+       with_own_liboconfig="no"
+],
+[
+       with_liboconfig="yes"
+       with_own_liboconfig="yes"
+       LDFLAGS="$save_LDFLAGS"
+       CPPFLAGS="$save_CPPFLAGS"
+])
+
+AM_CONDITIONAL(BUILD_WITH_OWN_LIBOCONFIG, test "x$with_own_liboconfig" = "xyes")
+if test "x$with_own_liboconfig" = "xyes"
+then
+       with_liboconfig="yes (shipped version)"
+fi
+
 #with_liboping="yes"
 with_own_liboping="no"
 liboping_LDFLAGS="$LDFLAGS"
@@ -1073,12 +1123,14 @@ AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$collect_libpcap],
        [Wether or not to use the pcap library])
 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
 
+perl_interpreter="perl"
 AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
 [
        if test "x$withval" != "xno" && test "x$withval" != "xyes"
        then
                LDFLAGS="$LDFLAGS -L$withval/lib"
                CPPFLAGS="$CPPFLAGS -I$withval/include"
+               perl_interpreter="$withval/bin/perl"
                with_libperl="yes"
        fi
 ],
@@ -1089,8 +1141,10 @@ if test "x$with_libperl" = "xyes"
 then
   SAVE_CFLAGS=$CFLAGS
   SAVE_LDFLAGS=$LDFLAGS
-  CFLAGS="$CFLAGS `perl -MExtUtils::Embed -e ccopts`"
-  LDFLAGS="$LDFLAGS `perl -MExtUtils::Embed -e ldopts`"
+  PERL_CFLAGS=`$perl_interpreter -MExtUtils::Embed -e ccopts`
+  PERL_LDFLAGS=`$perl_interpreter -MExtUtils::Embed -e ldopts`
+  CFLAGS="$CFLAGS $PERL_CFLAGS"
+  LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
 
   AC_CACHE_CHECK([for libperl],
     [have_libperl],
@@ -1104,7 +1158,7 @@ then
       [[
        PerlInterpreter *perl = NULL;
        Perl_load_module (perl, PERL_LOADMOD_NOIMPORT,
-                        Perl_newSVpvf (perl, "Collectd::Plugin::%s", "foo"),
+                        newSVpv ("Collectd::Plugin::FooBar", 24),
                         Nullsv);
       ]]),
       [have_libperl="yes"],
@@ -1115,6 +1169,8 @@ then
   if test "x$have_libperl" = "xyes"
   then
          AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
+         AC_SUBST(PERL_CFLAGS)
+         AC_SUBST(PERL_LDFLAGS)
   else
          with_libperl="no"
   fi
@@ -1320,6 +1376,7 @@ Configuration:
     libiptc . . . . . . $with_libiptc
     libkstat  . . . . . $with_kstat
     libmysql  . . . . . $with_libmysql
+    liboconfig  . . . . $with_liboconfig
     liboping  . . . . . $with_liboping
     libpcap . . . . . . $with_libpcap
     libperl . . . . . . $with_libperl