X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=b05f98731269f59751283e8cc88286a421059ede;hb=b2b34e32f8eb39b3374d09b4d23100da5da2db90;hp=3d8cf403b2d31736f4a8428045a1b1a4038df064;hpb=5c54fc80580131b5c5dd64c61e43f0045bdbc7c2;p=collectd.git diff --git a/configure.in b/configure.in index 3d8cf403..b05f9873 100644 --- a/configure.in +++ b/configure.in @@ -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