Ethereal-dev: Re: [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: Wed, 10 Sep 2003 11:45:25 -0500
On Wed, Sep 10, 2003 at 09:15:05AM +0200, Joerg Mayer wrote:
> On Tue, Sep 09, 2003 at 08:55:45PM -0500, Albert Chin wrote:
> > 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.
> 
> Please check out the new release (0.9.15): It should contain a fix for
> this problem. If not, please send an updated patch :)

Attached patch against 0.9.15. Before you AC_CHECK_HEADERS, you should
prepend the net-snmp CFLAGS to CPPFLAGS. Also, use $NETSNMPCONFIG
rather than calling net-snmp-config directly as you
AC_PATH_PROG(NETSNMPCONFIG,net-snmp-config) earlier.

-- 
albert chin (china@xxxxxxxxxxxxxxxxxx)

-- snip snip
--- configure.in.orig	Wed Sep 10 10:11:55 2003
+++ configure.in	Wed Sep 10 10:12:08 2003
@@ -602,11 +506,11 @@
 	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`
+		SNMP_LIBS=`$NETSNMPCONFIG --libs`
 		AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for NET-SNMP])
 		have_net_snmp="yes"
 	else
@@ -616,6 +520,7 @@
 		# headers.  This would likely be a broken system to
 		# try and use anyway.
 		NETSNMPCONFIG="no"
+		CPPFLAGS="$ac_save_CPPFLAGS"
 	fi	
 else
 	AC_MSG_CHECKING(whether to use UCD SNMP library if available)