+ 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