Merge branch 'pull/collectd-4.1' into collectd-4.1
[collectd.git] / configure.in
index 8544ca4..6829954 100644 (file)
@@ -789,7 +789,7 @@ then
 
        if test $curl_config_status -ne 0
        then
-               with_libcurl="no"
+               with_libcurl="no ($with_curl_config failed)"
        else
                SAVE_CFLAGS=$CFLAGS
                CFLAGS="$CFLAGS $with_curl_cflags"
@@ -806,15 +806,10 @@ then
 
        if test $curl_config_status -ne 0
        then
-               with_libcurl="no"
+               with_libcurl="no ($with_curl_config failed)"
        else
                AC_CHECK_LIB(curl, curl_easy_init,
-                [
-                 # We need to do this to have `HAVE_LIBCURL' defined but
-                 # `-lcurl' NOT added to the default LDFLAGS.
-                       AC_DEFINE(HAVE_LIBCURL, 1,
-                                 [Define to 1 if you have the curl library.])
-                ],
+                [with_libcurl="yes"],
                 [with_libcurl="no (symbol 'curl_easy_init' not found)"],
                 [$with_curl_libs])
        fi
@@ -986,13 +981,8 @@ then
                with_libmysql="no"
        else
                AC_CHECK_LIB(mysqlclient, mysql_init,
-                [
-                 # We need to do this to have `HAVE_LIBMYSQLCLIENT' defined
-                 # but `-lmysqlclient' NOT added to the default LDFLAGS.
-                       AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1,
-                                 [Define to 1 if you have the mysqlclient library.])
-                ],
-                [with_libmysql="no (libmysql not found)"],
+                [with_libmysql="yes"],
+                [with_libmysql="no (symbol 'mysql_init' not found)"],
                 [$with_mysql_libs])
        fi
 fi
@@ -1271,7 +1261,12 @@ AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@],
                with_libupsclient="yes"
                if "x$withval" != "xyes"
                then
-                       with_upsclient_config="$withval/bin/libupsclient-config"
+                       if test -x "$withval"
+                       then
+                               with_upsclient_config="$withval"
+                       else
+                               with_upsclient_config="$withval/bin/libupsclient-config"
+                       fi
                fi
        fi
 ],
@@ -1285,25 +1280,30 @@ then
 
        if test $upsclient_config_status -ne 0
        then
-               with_libupsclient="no"
+               with_libupsclient="no ($with_upsclient_config failed)"
        fi
 fi
 if test "x$with_libupsclient" = "xyes"
 then
+       SAVE_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $with_upsclient_cflags"
+
+       AC_CHECK_HEADERS(upsclient.h, [], [with_libupsclient="no (upsclient.h not found)"])
+
+       CFLAGS="$SAVE_CFLAGS"
+fi
+if test "x$with_libupsclient" = "xyes"
+then
        with_upsclient_libs=`$with_upsclient_config --libs 2>/dev/null`
        upsclient_config_status=$?
 
        if test $upsclient_config_status -ne 0
        then
-               with_libupsclient="no"
+               with_libupsclient="no ($with_upsclient_config failed)"
        fi
 fi
 if test "x$with_libupsclient" = "xyes"
 then
-       CFLAGS_ORIG=$CFLAGS
-       CFLAGS="$CFLAGS $with_upsclient_cflags"
-       LDFLAGS_ORIG=$LDFLAGS
-       LDFLAGS="$LDFLAGS $with_upsclient_libs"
        AC_CHECK_LIB(upsclient, upscli_connect,
        [
                BUILD_WITH_LIBUPSCLIENT_CFLAGS="$with_upsclient_cflags"
@@ -1312,14 +1312,8 @@ then
                AC_SUBST(BUILD_WITH_LIBUPSCLIENT_LIBS)
        ],
        [
-               with_libupsclient="no"
-       ])
-       CFLAGS=$CFLAGS_ORIG
-       LDFLAGS=$LDFLAGS_ORIG
-fi
-if test "x$with_libupsclient" = "xyes"
-then
-       AC_DEFINE(HAVE_LIBUPSCLIENT, 1, [Define to 1 if you have the upsclient library (-lupsclient).])
+               with_libupsclient="no (symbol 'upscli_connect' not found)"
+       ], [$with_upsclient_libs])
 fi
 if test "x$with_libupsclient" = "xyes"
 then
@@ -1431,7 +1425,13 @@ then
        SAVE_CFLAGS=$CFLAGS
        CFLAGS="$CFLAGS $with_libnetlink_cflags"
 
-       AC_CHECK_HEADERS(iproute/libnetlink.h, [], [with_libnetlink="no (iproute/libnetlink.h not found)"],
+       with_libnetlink="no (libnetlink.h not found)"
+
+       AC_CHECK_HEADERS(libnetlink.h iproute/libnetlink.h linux/libnetlink.h,
+       [
+        with_libnetlink="yes"
+        break
+       ], [],
 [#include <stdio.h>
 #include <sys/types.h>
 #include <asm/types.h>