Ethereal-dev: [ethereal-dev] Patch to "acinclude.m4" to fix UCD SNMP problem - please test

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Wed, 27 Oct 1999 14:39:36 -0700 (PDT)
>From a thread on "ethereal-cvs" - not everybody on "ethereal-dev" is
necessarily on "ethereal-cvs", so I'm sending this to "ethereal-dev":

> Date: Wed, 27 Oct 1999 16:19:29 -0400 (EDT)
> From: Bill Fumerola <billf@xxxxxxxxxxxxxx>
> To: Guy Harris <guy@xxxxxxxxxx>
> Cc: Guy Harris <guy@xxxxxxxxxxxx>, ethereal-cvs@xxxxxxxxxxxx
> Subject: Re: [ethereal-cvs] cvs commit: ethereal packet-snmp.c
> 
> On Wed, 27 Oct 1999, Guy Harris wrote:
> 
> > It seems to work for me at work if I just run "./configure" with no SNMP
> > option (compiled from a CVS tree, Solaris 2.5.1, CMU SNMP library
> > installed from source); I have had some problems at home (compiled from
> > a CVS tree, FreeBSD 3.x/UCD SNMP library installed as a binary package,
> > as I remember) - I think the problem was that it somehow found the
> > headers but not the libraries, or something such as that.  I installed
> > the UCD SNMP from source, and the problems went away.
> > 
> > When I get home, I'll see if I can reconstruct the problem, and try to
> > figure out how to eliminate it.
> 
> Odd. The FreeBSD package should put the headers in 
> /usr/local/include/ucd-snmp/ and the lib should be 
> /usr/local/lib/libsnmp.so.X

> From: Guy Harris <guy@xxxxxxxxxx>
> Subject: Re: [ethereal-cvs] cvs commit: ethereal packet-snmp.c
> To: Bill Fumerola <billf@xxxxxxxxxxxxxx>
> Date: Wed, 27 Oct 1999 14:26:16 -0700 (PDT)
> CC: Guy Harris <guy@xxxxxxxxxx>, Guy Harris <guy@xxxxxxxxxxxx>,
>         ethereal-cvs@xxxxxxxxxxxx
> 
> > Odd. The FreeBSD package should put the headers in 
> > /usr/local/include/ucd-snmp/ and the lib should be 
> > /usr/local/lib/libsnmp.so.X
> 
> Hmm.  I now seem to remember that the "AC_ETHEREAL_UCDSNMP_CHECK" macro
> (in "acinclude.m4") apparently failed to look in "/usr/local/include"
> for a "ucd-snmp" directory and header files therein, which might've been
> the problem I saw.
> 
> It checks "$ucdsnmp_user_dir" and "$prefix"; "$ucdsnmp_user_dir" is the
> directory specified by a "--with-ucdsnmp=" flag, and "$prefix" would, in
> theory, be the directory specified by a "-prefix=" flag, defaulting to
> "/usr/include", except that it's not set until fairly late in
> "configure" as generated by "autoconf" - i.e., by "AC_OUTPUT".
> 
> It should probably work around this by doing the same
> 
> 	test "x$prefix" = xNONE && prefix=$ac_default_prefix
> 
> stuff that "configure.in" does to set "DATAFILE_DIR".

> It should probably work around this by doing the same
> 
> 	test "x$prefix" = xNONE && prefix=$ac_default_prefix
> 
> stuff that "configure.in" does to set "DATAFILE_DIR".

I've attached a patch to "acinclude.m4" to make it do so; I don't have a
machine handy with UCD SNMP's headers installed in
"/usr/local/include/ucd-snmp", so could somebody who does (and who also
has the UCD SNMP library installed in "/usr/local/lib" apply this patch,
run "autogen.sh", and test the resulting configure script by running it
*without* any SNMP-related configure flags (i.e., don't tell it where to
look for the UCD SNMP library, just run "./configure" with no
arguments)?
Index: acinclude.m4
===================================================================
RCS file: /usr/local/cvsroot/ethereal/acinclude.m4,v
retrieving revision 1.10
diff -c -r1.10 acinclude.m4
*** acinclude.m4	1999/10/21 15:03:21	1.10
--- acinclude.m4	1999/10/27 21:31:27
***************
*** 222,228 ****
  	then
  		ucdsnmpdir=""
  
! 		for d in $ucdsnmp_user_dir $prefix
  		do
  			AC_MSG_CHECKING($d)
  
--- 222,239 ----
  	then
  		ucdsnmpdir=""
  
! 		#
! 		# "$prefix" isn't set at this point, so set
! 		# "$ucdsnmp_prefix" to "$prefix" and, if it's
! 		# "NONE", set it to "$ac_default_prefix".
! 		# (We don't want to set "$prefix" here, I assume,
! 		# given that it's not normally set by "autoconf"
! 		# scripts until "AC_OUTPUT" is run.)
! 		#
! 		ucdsnmp_prefix="$prefix"
! 		test "x$ucdsnmp_prefix" = xNONE && ucdsnmp_prefix=$ac_default_prefix
! 
! 		for d in $ucdsnmp_user_dir $ucdsnmp_prefix
  		do
  			AC_MSG_CHECKING($d)