Ethereal-dev: [ethereal-dev] UCD SNMP in weird location -- same player shoots again

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

From: Bert Driehuis <driehuis@xxxxxxxxxxxxx>
Date: Thu, 02 Sep 1999 00:46:25 +0200
I've cleaned up the ability to specify that UCD-SNMP lives in a weird
location. As a side effect, it automagically detecs if UCD-SNMP is
installed in $prefix if $prefix is not /usr/local.

Also include a patch to not hardcode "make" in Makefile.am.

Cheers,

					-- Bert
-- 
Bert Driehuis -- driehuis@xxxxxxxxxxxxx -- +31-20-3116119
The grand leap of the whale up the Fall of Niagara is esteemed, by all
who have seen it, as one of the finest spectacles in nature.
                -- Benjamin Franklin.
Index: acinclude.m4
===================================================================
RCS file: /cvsroot/ethereal/acinclude.m4,v
retrieving revision 1.4
diff -c -r1.4 acinclude.m4
*** acinclude.m4	1999/08/31 23:24:25	1.4
--- acinclude.m4	1999/09/01 22:38:21
***************
*** 190,192 ****
--- 190,234 ----
  	AC_CHECK_LIB(pcap, pcap_open_offline,, AC_MSG_ERROR(Library libpcap not found.))
  ])
  
+ #
+ # AC_ETHEREAL_UCDSNMP_CHECK
+ #
+ AC_DEFUN(AC_ETHEREAL_UCDSNMP_CHECK,
+ [
+ 	want_ucdsnmp=yes
+ 
+ 	AC_ARG_WITH(ucdsnmp,
+ 	--with-ucdsnmp=<directory>   use UCD SNMP client library, [
+ 	if test $withval = no
+ 	then
+ 		want_ucdsnmp=no
+ 	else
+ 		want_ucdsnmp=yes
+ 		ucdsnmp_user_dir=$withval
+ 	fi
+ 	])
+ 
+ 	if test $want_ucdsnmp = yes
+ 	then
+ 		ucdsnmpdir=""
+ 
+ 		for d in $ucdsnmp_user_dir $prefix
+ 		do
+ 			AC_MSG_CHECKING($d)
+ 
+ 			if test x$d != x/usr/local && test -f $d/include/ucd-snmp/snmp.h
+ 			then
+ 				AC_MSG_RESULT(found ucd-snmp in $d)
+ 				ucdsnmpdir=$d
+ 				break
+ 			fi
+ 		done
+ 
+ 		if test x$ucdsnmpdir != x
+ 		then
+ 			AC_MSG_RESULT(added $d to paths)
+ 			CFLAGS="$CFLAGS -I${ucdsnmpdir}/include/ucdsnmp"
+ 			LIBS="$LIBS -L${ucdsnmpdir}/lib"
+ 		fi
+ 	fi
+ ])
Index: configure.in
===================================================================
RCS file: /cvsroot/ethereal/configure.in,v
retrieving revision 1.41
diff -c -r1.41 configure.in
*** configure.in	1999/08/31 05:51:59	1.41
--- configure.in	1999/09/01 22:38:22
***************
*** 100,105 ****
--- 100,106 ----
  	AC_MSG_RESULT(no)
  else
  	AC_MSG_RESULT(yes)
+ 	AC_ETHEREAL_UCDSNMP_CHECK
  	AC_CHECK_HEADERS(ucd-snmp/snmp.h snmp/snmp.h)
  	AC_CHECK_LIB(snmp, asn_parse_header,
  		[
Index: Makefile.am
===================================================================
RCS file: /cvsroot/ethereal/Makefile.am,v
retrieving revision 1.64
diff -c -r1.64 Makefile.am
*** Makefile.am	1999/09/01 03:04:09	1.64
--- Makefile.am	1999/09/01 22:38:20
***************
*** 162,168 ****
  
  ethereal.1: ethereal doc/ethereal.pod.template
  	(cd doc ; \
! 	make ../ethereal.1 )
  
  dfilter-scanner.c : dfilter-scanner.l
  	$(LEX) -Pdfilter_ -t $(srcdir)/dfilter-scanner.l > dfilter-scanner.c
--- 162,168 ----
  
  ethereal.1: ethereal doc/ethereal.pod.template
  	(cd doc ; \
! 	$(MAKE) ../ethereal.1 )
  
  dfilter-scanner.c : dfilter-scanner.l
  	$(LEX) -Pdfilter_ -t $(srcdir)/dfilter-scanner.l > dfilter-scanner.c