From da00482b66a0a33c9129a8abe3d2c856d3235e8a Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 16 Mar 2005 23:53:49 +0000 Subject: Capitalize "Net-SNMP" the way the Net-SNMP project capitalizes it. Note that the "=PATH" argument to "--with-net-snmp" is optional. If "--with-net-snmp" is specified, give an error if Net-SNMP is found but "--with-ssl" wasn't specified, as the user has specified that they really want a version of Ethereal with Net-SNMP; if it's not specified, just warn of that and drive on, as we did before. svn path=/trunk/; revision=13786 --- acinclude.m4 | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) (limited to 'acinclude.m4') diff --git a/acinclude.m4 b/acinclude.m4 index 6b089c4ea4..eab3ab5887 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -733,6 +733,76 @@ AC_DEFUN([AC_ETHEREAL_LIBPCRE_CHECK], fi ]) +# +# AC_ETHEREAL_NETSNMP_CHECK +# +AC_DEFUN([AC_ETHEREAL_NETSNMP_CHECK], +[ + dnl get the net-snmp-config binary + if test "x$netsnmpconfig" = "x" ; then + # + # The user didn't specify where net-snmp-config is + # located; search for it. + # + AC_PATH_PROG(NETSNMPCONFIG, net-snmp-config) + else + NETSNMPCONFIG=$netsnmpconfig + if test ! -x $NETSNMPCONFIG -o ! -f $NETSNMPCONFIG ; then + NETSNMPCONFIG=$netsnmpconfig/bin/net-snmp-config + if test ! -x $NETSNMPCONFIG -o ! -f $NETSNMPCONFIG ; then + AC_MSG_ERROR(Invalid net-snmp-config: $netsnmpconfig) + fi + fi + fi + + # + # XXX - check whether $NETSNMPCONFIG is executable? + # if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then + # We already did that if it was set; presumably AC_PATH_PROG + # will fail if it doesn't find an executable version. + # + + dnl other choices for flags to use here: could also use + dnl --prefix or --exec-prefix if you don't want the full list. + + # + # Save the current settings of CFLAGS and CPPFLAGS, and add + # the output of "$NETSNMPCONFIG --cflags" to it, so that when + # searching for the Net-SNMP headers, we look in whatever + # directory that output specifies. + # + ethereal_save_CFLAGS="$CFLAGS" + ethereal_save_CPPFLAGS="$CPPFLAGS" + CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags`" + CPPFLAGS="$CPPFLAGS `$NETSNMPCONFIG --cflags`" + + AC_CHECK_HEADERS(net-snmp/net-snmp-config.h net-snmp/library/default_store.h) + if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = "xyes" -a "x$ac_cv_header_net_snmp_library_default_store_h" = "xyes" ; then + SNMP_LIBS=`$NETSNMPCONFIG --libs` + if echo "$SNMP_LIBS" | grep crypto >/dev/null && test "x$SSL_LIBS" = "x"; then + if test "x$want_netsnmp" = "xyes" ; then + AC_MSG_ERROR(Net-SNMP requires openssl but ssl not enabled) + else + AC_MSG_RESULT(Net-SNMP requires openssl but ssl not enabled - disabling Net-SNMP) + fi + CFLAGS="$ethereal_save_CFLAGS" + CPPFLAGS="$ethereal_save_CPPFLAGS" + SNMP_LIBS= + else + AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for Net-SNMP]) + have_net_snmp="yes" + fi + else + # + # Restore the versions of CFLAGS and CPPFLAGS before + # we added the output of '$NETSNMPCONFIG --cflags", + # as we didn't actually find Net-SNMP there. + # + CFLAGS="$ethereal_save_CFLAGS" + CPPFLAGS="$ethereal_save_CPPFLAGS" + fi +]) + # # AC_ETHEREAL_UCDSNMP_CHECK # @@ -1179,4 +1249,3 @@ AC_DEFUN([AC_ETHEREAL_KRB5_CHECK], fi AC_SUBST(KRB5_LIBS) ]) - -- cgit v1.2.3