]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
net-snmp-config cleanup
authorHarlan Stenn <stenn@ntp.org>
Sat, 13 Sep 2008 08:58:45 +0000 (04:58 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 13 Sep 2008 08:58:45 +0000 (04:58 -0400)
bk: 48cb80c5V25NMe44cPJi6ufJvlo92g

ChangeLog
configure.ac
ntpsnmpd/Makefile.am

index fa09a2ce9bd973c38977f0fcb4af95baf013d665..62548eb8496d98ba1b81c426d223322a7b57ba0c 100644 (file)
--- 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 <stenn@ntp.org>
 * Quiet some libntpq-related warnings.
index b4ed63f3c36d0ee6ec7f01b0f010c31bc94e5695..2a001b42cc3db9fdcd4345547671c6a58535ebb1 100644 (file)
@@ -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])
        ;;
index 38a886edf0f5524558acba33a0d917844924ec8c..4e80357221fa786951a46811137e4b9927286b1e 100644 (file)
@@ -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@