Ethereal-dev: [Ethereal-dev] Minor fix to autoconf test for net-snmp

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Albert Chin <ethereal-dev@xxxxxxxxxxxxxxxxxx>
Date: Tue, 9 Sep 2003 20:55:45 -0500
While the test for net-snmp is correct, the test output is incorrect.
The AC_MSG_CHECKING text will appear on a line with no newline. Then
AC_CHECK_HEADERS comes along and spits out text on the *same* line.
Then the AC_MSG_RESULT's come on a line different from the
AC_MSG_CHECKING text, which is confusing. I've corrected this below.

Against 0.9.14.

-- 
albert chin (china@xxxxxxxxxxxxxxxxxx)

-- snip snip
--- configure.in.orig	Tue Sep  9 17:03:18 2003
+++ configure.in	Tue Sep  9 17:31:20 2003
@@ -586,19 +490,19 @@
 	fi
 fi
 
-AC_MSG_CHECKING(whether to use UCD SNMP/NET-SNMP library if available)
+AC_MSG_NOTICE([whether to use UCD SNMP/NET-SNMP library if available])
 if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
 	dnl other choices for flags to use here: could also use
 	dnl --prefix or --exec-prefix if you don't want the full list.
 
+	ac_save_CPPFLAGS="$CPPFLAGS"
+	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
-		CFLAGS="$CFLAGS `net-snmp-config --cflags`"
-		CPPFLAGS="$CPPLAGS `net-snmp-config --cflags`"
-		SNMP_LIBS=`net-snmp-config --libs`
+		CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags`"
+		SNMP_LIBS=`$NETSNMPCONFIG --libs`
 		AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for NET-SNMP])
 		have_net_snmp="yes"
-		AC_MSG_RESULT(yes (net-snmp))
 	else
 		# technically, we should retry ucd-snmp but it's
 		# unlikely they have installed net-snmp-config and not
@@ -606,7 +510,7 @@
 		# headers.  This would likely be a broken system to
 		# try and use anyway.
 		NETSNMPCONFIG="no"
-		AC_MSG_RESULT(no)
+		CPPFLAGS="$ac_save_CPPFLAGS"
 	fi	
 else
 	if test "x$want_ucdsnmp" = "xno" ; then