Code

Merge branch 'collectd-4.4' into collectd-4.5
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 16 Feb 2009 11:35:23 +0000 (12:35 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 16 Feb 2009 11:35:23 +0000 (12:35 +0100)
Conflicts:

configure.in

1  2 
configure.in
contrib/collection.cgi

diff --cc configure.in
index 7a4c151708fd59cb5cdd003d71c4e70b2552cdb6,e99ade7c50e7bee4c9aa75f48c7a2ff00cfa7798..2bab6b32cab6f2cbbd7390d1fbdd06f9bf226f38
  fi
  AM_CONDITIONAL(BUILD_WITH_LIBNETSNMP, test "x$with_libnetsnmp" = "xyes")
  
- with_libupsclient="no (pkg-config isn't available)"
 +PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
 +              [with_libnotify="yes"],
 +              [with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"])
 +
+ with_libupsclient_config=""
  with_libupsclient_cflags=""
  with_libupsclient_libs=""
- if test "x$PKG_CONFIG" != "x"
- then
-       pkg-config --exists 'libupsclient' 2>/dev/null
-       if test "$?" = "0"
+ AC_ARG_WITH(libupsclient, [AS_HELP_STRING([--with-libupsclient@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
+ [
+       if test "x$withval" = "xno"
+       then
+               with_libupsclient="no"
+       else if test "x$withval" = "xyes"
        then
-               with_libupsclient="yes"
+               with_libupsclient="use_pkgconfig"
        else
+               if test -x "$withval"
+               then
+                       with_libupsclient_config="$withval"
+                       with_libupsclient="use_libupsclient_config"
+               else if test -x "$withval/bin/libupsclient-config"
+               then
+                       with_libupsclient_config="$withval/bin/net-snmp-config"
+                       with_libupsclient="use_libupsclient_config"
+               else
+                       AC_MSG_NOTICE([Not checking for libupsclient: Manually configured])
+                       with_libupsclient_cflags="-I$withval/include"
+                       with_libupsclient_libs="-L$withval/lib -lupsclient"
+                       with_libupsclient="yes"
+               fi; fi
+       fi; fi
+ ],
+ [with_libupsclient="use_pkgconfig"])
+ # configure using libupsclient-config
+ if test "x$with_libupsclient" = "xuse_libupsclient_config"
+ then
+       AC_MSG_NOTICE([Checking for libupsclient using $with_libupsclient_config])
+       with_libupsclient_cflags="`$with_libupsclient_config --cflags`"
+       if test $? -ne 0
+       then
+               with_libupsclient="no ($with_libupsclient_config failed)"
+       fi
+       with_libupsclient_libs="`$with_libupsclient_config --libs`"
+       if test $? -ne 0
+       then
+               with_libupsclient="no ($with_libupsclient_config failed)"
+       fi
+ fi
+ if test "x$with_libupsclient" = "xuse_libupsclient_config"
+ then
+       with_libupsclient="yes"
+ fi
+ # configure using pkg-config
+ if test "x$with_libupsclient" = "xuse_pkgconfig"
+ then
+       if test "x$PKG_CONFIG" = "x"
+       then
+               with_libupsclient="no (Don't have pkg-config)"
+       fi
+ fi
+ if test "x$with_libupsclient" = "xuse_pkgconfig"
+ then
+       AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
+       $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
+       if test $? -ne 0
+       then
                with_libupsclient="no (pkg-config doesn't know library)"
        fi
  fi
Simple merge