Ethereal-dev: [Ethereal-dev] net-snmp detection in configure.in is broken?

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

From: "D. Manzella" <manzella@xxxxxxxxxx>
Date: Tue, 16 Dec 2003 14:25:55 +0100
Hello folks,
Maybe it's just me, but I think that
the Check for net-snmp in configure.in is
faulty (ethereal-0.10.0a).
I'm attaching a trivial patch that
fill fix detection and adding appropriate
flags for compiler/linker when, for instance,
net-snmp is available in non-standard path.

Cheers,
D. Manzella
--- configure.in.0	Sat Dec 13 17:57:41 2003
+++ configure.in.2003-12-16	Tue Dec 16 13:51:29 2003
@@ -659,11 +659,15 @@
 	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_CFLAGS="$CFLAGS"
+	_save_CPPFLAGS="$CPPLAGS"
+	CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags`"
+	CPPFLAGS="$CPPLAGS `$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
@@ -673,6 +677,8 @@
 		# headers.  This would likely be a broken system to
 		# try and use anyway.
 		NETSNMPCONFIG="no"
+		CFLAGS="$_save_CFLAGS"
+		CPPFLAGS="$_save_CPPFLAGS"
 	fi	
 else
 	AC_MSG_CHECKING(whether to use UCD SNMP library if available)