Code

Merge branch 'collectd-4.4'
authorFlorian Forster <octo@noris.net>
Mon, 14 Jul 2008 07:46:27 +0000 (09:46 +0200)
committerFlorian Forster <octo@noris.net>
Mon, 14 Jul 2008 07:46:27 +0000 (09:46 +0200)
Conflicts:

configure.in

1  2 
configure.in
src/ntpd.c

diff --cc configure.in
index 6873d8f1e3d254692ef26f3fe6476a4c7425edd2,41ee95555c9a5c419d44601f182cab0e8d962b61..2be53f65aeabc7f6f6f408a0cf79d1d9aff34fd6
  fi
  AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
  
- with_upsclient_config="libupsclient-config"
- with_upsclient_cflags=""
- with_upsclient_libs=""
- AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to libupsclient.])],
- [
-       if test "x$withval" = "xno"
 +PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
 +              [with_libnotify="yes"],
 +              [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
 +
+ with_libupsclient="no (pkg-config isn't available)"
+ with_libupsclient_cflags=""
+ with_libupsclient_libs=""
+ if test "x$PKG_CONFIG" != "x"
+ then
+       pkg-config --exists 'libupsclient' 2>/dev/null
+       if test "$?" = "0"
        then
-               with_libupsclient="no"
-       else
-               if test "x$withval" != "xyes"
-               then
-                       if test -f "$withval" && test -x "$withval";
-                       then
-                               with_upsclient_config="$withval"
-                       else
-                               with_upsclient_config="$withval/bin/libupsclient-config"
-                       fi
-               fi
                with_libupsclient="yes"
+       else
+               with_libupsclient="no (pkg-config doesn't know library)"
        fi
- ],
- [
-       with_libupsclient="yes"
- ])
+ fi
  if test "x$with_libupsclient" = "xyes"
  then
-       with_upsclient_cflags=`$with_upsclient_config --cflags 2>/dev/null`
-       upsclient_config_status=$?
-       if test $upsclient_config_status -ne 0
+       with_libupsclient_cflags="`pkg-config --cflags 'libupsclient'`"
+       if test $? -ne 0
        then
-               with_libupsclient="no ($with_upsclient_config failed)"
+               with_libupsclient="no"
+       fi
+       with_libupsclient_libs="`pkg-config --libs 'libupsclient'`"
+       if test $? -ne 0
+       then
+               with_libupsclient="no"
        fi
  fi
  if test "x$with_libupsclient" = "xyes"
diff --cc src/ntpd.c
Simple merge