X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=232d45503d8f7a8cd8622e63c4a37ebfe19a6e23;hb=f9d51dc8fabe44f3cd17499713d63b518f0e1853;hp=0b41015f94c98f38bae06568e618809fdc4e56de;hpb=ca5af2937040553d53be13b5d5e049c6495c6423;p=collectd.git diff --git a/configure.in b/configure.in index 0b41015f..232d4550 100644 --- a/configure.in +++ b/configure.in @@ -9,6 +9,7 @@ m4_ifdef([LT_PACKAGE_VERSION], LT_CONFIG_LTDL_DIR([libltdl]) LT_INIT([dlopen]) LTDL_INIT([convenience]) + AC_DEFINE(LIBTOOL_VERSION, 2, [Define to used libtool version.]) ] , # libtool <= 1.5 @@ -18,6 +19,7 @@ m4_ifdef([LT_PACKAGE_VERSION], AC_SUBST(LIBLTDL) AC_LIBTOOL_DLOPEN AC_CONFIG_SUBDIRS(libltdl) + AC_DEFINE(LIBTOOL_VERSION, 1, [Define to used libtool version.]) ] ) @@ -2653,6 +2655,102 @@ AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread], AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes") # }}} +# --with-python {{{ +with_python_prog="" +with_python_path="$PATH" +AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])], +[ + if test "x$withval" = "xyes" || test "x$withval" = "xno" + then + with_python="$withval" + else if test -x "$withval" + then + with_python_prog="$withval" + with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path" + with_python="yes" + else if test -d "$withval" + then + with_python_path="$withval$PATH_SEPARATOR$with_python_path" + with_python="yes" + else + AC_MSG_WARN([Argument not recognized: $withval]) + fi; fi; fi +], [with_python="yes"]) + +SAVE_PATH="$PATH" +PATH="$with_python_path" + +if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x" +then + AC_MSG_CHECKING([for python]) + with_python_prog="`which python 2>/dev/null`" + if test "x$with_python_prog" = "x" + then + AC_MSG_RESULT([not found]) + with_python="no (interpreter not found)" + else + AC_MSG_RESULT([$with_python_prog]) + fi +fi + +PATH="$SAVE_PATH" + +if test "x$with_python" = "xyes" +then + AC_MSG_CHECKING([for Python CPPFLAGS]) + python_include_path=`echo "import distutils.sysconfig;print distutils.sysconfig.get_python_inc()" | "$with_python_prog" 2>/dev/null` + python_config_status=$? + + if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x" + then + AC_MSG_RESULT([failed with status $python_config_status]) + with_python="no" + else + AC_MSG_RESULT([$python_include_path]) + fi +fi + +if test "x$with_python" = "xyes" +then + AC_MSG_CHECKING([for Python LDFLAGS]) + python_library_path=`echo "import distutils.sysconfig;print distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0)" | "$with_python_prog" 2>&1` + python_config_status=$? + + if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x" + then + AC_MSG_RESULT([failed with status $python_config_status]) + with_python="no" + else + AC_MSG_RESULT([$python_library_path]) + fi +fi + +if test "x$with_python" = "xyes" +then + AC_MSG_CHECKING([for Python LIBS]) + python_library_flags=`echo "import distutils.sysconfig;print distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0)" | "$with_python_prog" 2>&1` + python_config_status=$? + + if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x" + then + AC_MSG_RESULT([failed with status $python_config_status]) + with_python="no" + else + AC_MSG_RESULT([$python_library_flags]) + fi +fi + +if test "x$with_python" = "xyes" +then + BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path" + BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path" + BUILD_WITH_PYTHON_LIBS="$python_library_flags" + AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS) + AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS) + AC_SUBST(BUILD_WITH_PYTHON_LIBS) +fi +# }}} --with-python + # --with-librouteros {{{ AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])], [ @@ -3955,6 +4053,7 @@ AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics]) AC_PLUGIN([powerdns], [yes], [PowerDNS statistics]) AC_PLUGIN([processes], [$plugin_processes], [Process statistics]) AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics]) +AC_PLUGIN([python], [$with_python], [Embed a Python interpreter]) AC_PLUGIN([routeros], [$with_librouteros], [RouterOS plugin]) AC_PLUGIN([rrdcached], [$librrd_rrdc_update], [RRDTool output plugin]) AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output plugin]) @@ -4189,6 +4288,7 @@ Configuration: libxmms . . . . . . . $with_libxmms libyajl . . . . . . . $with_libyajl oracle . . . . . . . $with_oracle + python . . . . . . . $with_python Features: daemon mode . . . . . $enable_daemon @@ -4262,6 +4362,7 @@ Configuration: powerdns . . . . . . $enable_powerdns processes . . . . . . $enable_processes protocols . . . . . . $enable_protocols + python . . . . . . . $enable_python routeros . . . . . . $enable_routeros rrdcached . . . . . . $enable_rrdcached rrdtool . . . . . . . $enable_rrdtool