Imported Upstream version 2.6.0

This commit is contained in:
arnaud.quette@free.fr 2011-01-26 10:35:08 +01:00
parent 26fb71b504
commit 459aaf9392
510 changed files with 40508 additions and 18859 deletions

View file

@ -1,6 +1,6 @@
dnl Check for LIBNETSNMP compiler flags. On success, set
dnl nut_have_libnetsnmp="yes" and set LIBNETSNMP_CFLAGS and
dnl LIBNETSNMP_LDFLAGS. On failure, set nut_have_libnetsnmp="no".
dnl LIBNETSNMP_LIBS. On failure, set nut_have_libnetsnmp="no".
dnl This macro can be run multiple times, but will do the checking only
dnl once.
@ -9,30 +9,47 @@ AC_DEFUN([NUT_CHECK_LIBNETSNMP],
if test -z "${nut_have_libnetsnmp_seen}"; then
nut_have_libnetsnmp_seen=yes
dnl save CFLAGS and LDFLAGS
dnl save CFLAGS and LIBS
CFLAGS_ORIG="${CFLAGS}"
LDFLAGS_ORIG="${LDFLAGS}"
LIBS_ORIG="${LIBS}"
dnl See which version of the Net-SNMP library (if any) is installed
AC_MSG_CHECKING(for Net-SNMP version via net-snmp-config)
SNMP_VERSION=`net-snmp-config --version 2>/dev/null`
if test "$?" = "0"; then
AC_MSG_RESULT(${SNMP_VERSION} found)
else
AC_MSG_RESULT(not found)
if test "$?" != "0" -o -z "${SNMP_VERSION}"; then
SNMP_VERSION="none"
fi
AC_MSG_RESULT(${SNMP_VERSION} found)
AC_MSG_CHECKING(for Net-SNMP cflags)
AC_ARG_WITH(snmp-includes, [
AC_HELP_STRING([--with-snmp-includes=CFLAGS], [include flags for the Net-SNMP library])
], [CFLAGS="${withval}"], [CFLAGS="`net-snmp-config --cflags 2>/dev/null`"])
AC_ARG_WITH(snmp-includes,
AS_HELP_STRING([@<:@--with-snmp-includes=CFLAGS@:>@], [include flags for the Net-SNMP library]),
[
case "${withval}" in
yes|no)
AC_MSG_ERROR(invalid option --with(out)-snmp-includes - see docs/configure.txt)
;;
*)
CFLAGS="${withval}"
;;
esac
], [CFLAGS="`net-snmp-config --base-cflags 2>/dev/null`"])
AC_MSG_RESULT([${CFLAGS}])
AC_MSG_CHECKING(for Net-SNMP libs)
AC_ARG_WITH(snmp-libs, [
AC_HELP_STRING([--with-snmp-libs=LDFLAGS], [linker flags for the Net-SNMP library])
], [LDFLAGS="${withval}"], [LDFLAGS="`net-snmp-config --libs 2>/dev/null`"])
AC_MSG_RESULT([${LDFLAGS}])
AC_ARG_WITH(snmp-libs,
AS_HELP_STRING([@<:@--with-snmp-libs=LIBS@:>@], [linker flags for the Net-SNMP library]),
[
case "${withval}" in
yes|no)
AC_MSG_ERROR(invalid option --with(out)-snmp-libs - see docs/configure.txt)
;;
*)
LIBS="${withval}"
;;
esac
], [LIBS="`net-snmp-config --libs 2>/dev/null`"])
AC_MSG_RESULT([${LIBS}])
dnl Check if the Net-SNMP library is usable
AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [nut_have_libnetsnmp=yes], [nut_have_libnetsnmp=no], [AC_INCLUDES_DEFAULT])
@ -40,11 +57,11 @@ if test -z "${nut_have_libnetsnmp_seen}"; then
if test "${nut_have_libnetsnmp}" = "yes"; then
LIBNETSNMP_CFLAGS="${CFLAGS}"
LIBNETSNMP_LDFLAGS="${LDFLAGS}"
LIBNETSNMP_LIBS="${LIBS}"
fi
dnl restore original CFLAGS and LDFLAGS
dnl restore original CFLAGS and LIBS
CFLAGS="${CFLAGS_ORIG}"
LDFLAGS="${LDFLAGS_ORIG}"
LIBS="${LIBS_ORIG}"
fi
])