[Nut-upsdev] patch for m4/nut_check_libnetsnmp.m4

Tim Rice tim at multitalents.net
Tue Dec 15 21:40:58 UTC 2009


It looks like the change to m4/nut_check_libnetsnmp.m4 in r1968 broke
the test on at least Solaris 10. Here is one possible fix.

----------------------------
--- m4/nut_check_libnetsnmp.m4.old	2009-12-15 09:30:48.000000000 -0800
+++ m4/nut_check_libnetsnmp.m4	2009-12-15 11:12:15.291295000 -0800
@@ -9,7 +9,8 @@
 if test -z "${nut_have_libnetsnmp_seen}"; then
    nut_have_libnetsnmp_seen=yes
 
-   dnl save CFLAGS and LDFLAGS
+   dnl save CPPFLAGS CFLAGS and LDFLAGS
+   CPPFLAGS_ORIG="${CFLAGS}"
    CFLAGS_ORIG="${CFLAGS}"
    LDFLAGS_ORIG="${LDFLAGS}"
 
@@ -38,6 +39,7 @@
    fi
 
    AC_MSG_CHECKING(for Net-SNMP headers)
+   CPPFLAGS="${CPPFLAGS} ${CFLAGS}"
    AC_TRY_CPP([#include <net-snmp/net-snmp-config.h>],
 			[AC_MSG_RESULT(yes)
 			],
@@ -49,7 +51,8 @@
 	LIBNETSNMP_LDFLAGS="${LDFLAGS}"
    fi
 
-   dnl restore original CFLAGS and LDFLAGS
+   dnl restore original CPPFLAGS CFLAGS and LDFLAGS
+   CPPFLAGS="${CFLAGS_ORIG}"
    CFLAGS="${CFLAGS_ORIG}"
    LDFLAGS="${LDFLAGS_ORIG}"
 
----------------------------


-- 
Tim Rice				Multitalents	(707) 887-1469
tim at multitalents.net





More information about the Nut-upsdev mailing list