From: Harlan Stenn Date: Sat, 13 Sep 2008 08:58:45 +0000 (-0400) Subject: net-snmp-config cleanup X-Git-Tag: NTP_4_2_5P130~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f64e05befc4b925f0ba1f1450c3059f51a6805cf;p=thirdparty%2Fntp.git net-snmp-config cleanup bk: 48cb80c5V25NMe44cPJi6ufJvlo92g --- diff --git a/ChangeLog b/ChangeLog index fa09a2ce9..62548eb84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* net-snmp-config cleanup. * [Bug 1063] ntpSnmpSubagentObject.h is missing from the distribution. (4.2.5p129) 2008/09/11 Released by Harlan Stenn * Quiet some libntpq-related warnings. diff --git a/configure.ac b/configure.ac index b4ed63f3c..2a001b42c 100644 --- a/configure.ac +++ b/configure.ac @@ -366,7 +366,34 @@ AC_C_VOLATILE AC_ISC_POSIX AC_PATH_PROG(PATH_SH, sh) AC_PATH_PROG(PATH_PERL, perl) -AC_PATH_PROG(PATH_NET_SNMP_CONFIG, net-snmp-config) + +AC_ARG_WITH(net-snmp-config, + AC_HELP_STRING([--with-net-snmp-config], [+ =net-snmp-config]), +[ans=$withval], [ans=yes]) +case "$ans" in + no) ;; + yes) + ans=net-snmp-config + ;; + /*) ;; + */*) + AC_MSG_ERROR([--with-net-snmp-config takes either a name or an absolute path]) + ;; + *) + ;; +esac +AC_MSG_CHECKING(for net-snmp-config) +AC_MSG_RESULT($ans) +PROG_NET_SNMP_CONFIG=$ans + +case "$PROG_NET_SNMP_CONFIG" in + no) ;; + /*) + PATH_NET_SNMP_CONFIG=$PROG_NET_SNMP_CONFIG + ;; + *) AC_PATH_PROG([PATH_NET_SNMP_CONFIG], [$PROG_NET_SNMP_CONFIG]) + ;; +esac case "$host" in *-*-vxworks*) @@ -3783,7 +3810,7 @@ esac AC_MSG_CHECKING(if we want to build ntpsnmpd) AC_ARG_WITH(ntpsnmpd, - AC_HELP_STRING([--with-ntpsnmpd], [? Build the ntpsnmpd code?]), + AC_HELP_STRING([--with-ntpsnmpd], [s Build the ntpsnmpd code?]), [ans=$withval], [case "$PATH_NET_SNMP_CONFIG" in /*) ans=yes ;; @@ -3795,9 +3822,24 @@ case "$ans" in yes) case "$PATH_NET_SNMP_CONFIG" in /*) - NTPSNMPD_DIR=ntpsnmpd SNMP_LIBS=`$PATH_NET_SNMP_CONFIG --agent-libs` AC_SUBST(SNMP_LIBS) + # HMS: we really want to separate CPPFLAGS and CFLAGS + foo=`$PATH_NET_SNMP_CONFIG --cflags` + SNMP_CPPFLAGS= + SNMP_CFLAGS= + for i in $foo; do + case "$i" in + -D*|-U*|-I*) + SNMP_CPPFLAGS="$SNMP_CPPFLAGS $i" + ;; + *) SNMP_CFLAGS="$SNMP_CFLAGS $i" + ;; + esac + done + AC_SUBST(SNMP_CPPFLAGS) + AC_SUBST(SNMP_CFLAGS) + NTPSNMPD_DIR=ntpsnmpd ;; *) AC_MSG_WARN([Cannot build ntpsnmpd as desired - net-snmp-config cannot be found]) ;; diff --git a/ntpsnmpd/Makefile.am b/ntpsnmpd/Makefile.am index 38a886edf..4e8035722 100644 --- a/ntpsnmpd/Makefile.am +++ b/ntpsnmpd/Makefile.am @@ -5,16 +5,5 @@ ntpsnmpd_SOURCES= ntpsnmpd.c ntpSnmpSubagentObject.c noinst_HEADERS= ntpSnmpSubagentObject.h # HMS: we probably want a version.o file here, too. LDADD= ../ntpq/libntpq.a ../libntp/libntp.a @SNMP_LIBS@ -AM_CPPFLAGS= -I$(top_srcdir)/ntpq -I$(top_srcdir)/include `net-snmp-config --cflags` - -#CFLAGS=-I. -I../ntp-dev/ntpq -I../ntp-dev/include -I../net-snmp/include `net-snmp-config --cflags` -g -#BUILDLIBS=`net-snmp-config --libs` -#BUILDAGENTLIBS=`net-snmp-config --agent-libs` -#BUILDNTPLIBS=-L ../ntp-dev/libntp -lntp -L../ntp-dev/ntpq -lntpq - -#ntpsnmpd: $(OBJS) -# $(CC) -o ntpsnmpd $(OBJS) $(BUILDNTPLIBS) $(BUILDAGENTLIBS) -# -#ntpSnmpPluginObject.so: ntpSnmpPluginObject.c Makefile -# $(CC) $(CFLAGS) $(DLFLAGS) -c -o ntpSnmpPluginObject.o ntpSnmpPluginObject.c -# $(CC) $(CFLAGS) $(DLFLAGS) -o ntpSnmpPluginObject.so ntpSnmpPluginObject.o +AM_CPPFLAGS= -I$(top_srcdir)/ntpq -I$(top_srcdir)/include @SNMP_CPPFLAGS@ +AM_CFLAGS= @SNMP_CFLAGS@