Ethereal-dev: [Ethereal-dev] 0.9.13 patches

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: Thu, 12 Jun 2003 18:07:57 -0500
1. configure.in
   a) Don't set CFLAGS so early, especially when $(top_srcdir) isn't
      resolved. This just clutters config.log.
   b) Minor mods to net-snmp detection. You set NETSNMPCONFIG but don't
      use it. Rather, you use net-snmp-config assuming it's in $PATH.
      Don't AC_MSG_CHECKING followed by AC_MSG_CHECKING. You get:
        blah blah blah... blah blah blah...
      Use AC_MSG_NOTICE for the first AC_MSG_CHECKING instead. Set
      CPPFLAGS before checking for net-snmp headers else they might
      not be found.
   c) Why call AM_PROG_LIBTOOL at the end after you've already called
      AC_PROG_LIBTOOL earlier?
2. wiretap/ascend-scanner.c
   "config.h" should always be the first include file

-- 
albert chin (china@xxxxxxxxxxxxxxxxxx)

-- snip snip
--- configure.in.orig	Thu Jun 12 07:45:15 2003
+++ configure.in	Thu Jun 12 11:09:37 2003
@@ -136,9 +138,6 @@
 	esac
 fi
 
-CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap"
-CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap"
-
 dnl Look in /usr/local for header files and libraries ?
 dnl XXX FIXME don't include /usr/local if it is already in the system
 dnl search path as this causes gcc 3.2 on Linux to complain about a change
@@ -584,19 +543,19 @@
 	fi
 fi
 
-AC_MSG_CHECKING(whether to use UCD SNMP/NET-SNMP library if available)
+AC_MSG_NOTICE([checking if UCD SNMP/NET-SNMP library is 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
@@ -604,7 +563,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
@@ -761,8 +720,10 @@
 AC_SUBST(plugindir)
 
 dnl libtool defs
-AM_PROG_LIBTOOL
 AC_SUBST(LIBTOOL_DEPS)
+
+CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap"
+CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap"
 
 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_shared = xno)
 AM_CONFIG_HEADER(config.h)
--- wiretap/ascend-scanner.c.orig	Thu Jun 12 07:44:52 2003
+++ wiretap/ascend-scanner.c	Thu Jun 12 07:50:46 2003
@@ -26,6 +26,10 @@
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdio.h>
 
 
@@ -663,10 +667,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
  */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
 
 #include <stdio.h>
 #include <stdlib.h>