Stolen from head: Fix building SNMP support on Solaris 9
authorphampson <phampson>
Sun, 13 Feb 2005 01:03:20 +0000 (01:03 +0000)
committerphampson <phampson>
Sun, 13 Feb 2005 01:03:20 +0000 (01:03 +0000)
Taken from aclocal.m4 1.29, patch by Michael J Mitchell

aclocal.m4
doc/ChangeLog

index fc9d205..159c8b3 100644 (file)
@@ -3782,7 +3782,7 @@ dnl #  If not, look for it in a number of directories and in ucd-snmp.
 dnl #
 if test "x$ucdsnmp" = "x"; then
   old_CFLAGS="$CFLAGS"
-  for try in /usr/include /usr/local/include $snmp_include_dir; do
+  for try in /usr/include /usr/local/include $with_snmp_include_dir; do
     CFLAGS="$old_CFLAGS -I$try"
     AC_TRY_COMPILE([
 #ifdef HAVE_SYS_TYPES_H
@@ -3815,7 +3815,7 @@ fi
 
 if test "x$ucdsnmp" = "x"; then
   old_CFLAGS="$CFLAGS"
-  for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
+  for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $with_snmp_include_dir; do
     CFLAGS="$old_CFLAGS -I$try"
 dnl #
 dnl #  First, see if we can build it WITHOUT using any special includes and without ucd-snmp
@@ -3854,7 +3854,7 @@ dnl #  If not, look for it in a number of directories and without ucd-snmp
 dnl #
 if test "x$ucdsnmp" = "x"; then
   old_CFLAGS="$CFLAGS"
-  for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
+  for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $with_snmp_include_dir; do
     CFLAGS="$old_CFLAGS -I$try"
     AC_TRY_COMPILE([
 #ifdef HAVE_SYS_TYPES_H
@@ -3911,7 +3911,7 @@ dnl #
               SNMP_LIBS=)
 
   if test "x$SNMP_LIBS" = "x"; then
-    for try in /usr/lib /usr/local/lib /usr/local/snmp/lib $snmp_lib_dir; do
+    for try in /usr/lib /usr/local/lib /usr/local/snmp/lib $with_snmp_lib_dir; do
       LIBS="$old_LIBS -L$try -lsnmp"
       AC_TRY_LINK([extern char snmp_build_var_op();],
                   [ snmp_build_var_op()],
@@ -3932,6 +3932,19 @@ dnl   #
       if test "x$SNMP_LIBS" != "x"; then
         break;
       fi
+dnl   #
+dnl   #  That didn't work.  Try adding the '-lkstat' line.
+dnl   #  Some SNMP libraries are linked against Kernel Statistics,
+dnl   #  in particular, Solaris 9...
+dnl   #
+      LIBS="$old_LIBS -L$try -lsnmp -lcrypto -lkstat"
+      AC_TRY_LINK([extern char snmp_build_var_op();],
+                  [ snmp_build_var_op()],
+                  SNMP_LIBS="-L$try -lsnmp -lcrypto -lkstat",
+                  SNMP_LIBS=)
+      if test "x$SNMP_LIBS" != "x"; then
+        break;
+      fi
     done
   fi
   LIBS="$old_LIBS"
index 2df966e..27451df 100644 (file)
@@ -18,6 +18,7 @@ FreeRADIUS 1.0.2 ; $Date$, urgency=medium
          processes or home RADIUS servers
        * Fix building on gcc-4.0 by not trying to access static auth_port from
          other files.
+       * Fix building SNMP support on Solaris 9, which needs -lkstat
 
 FreeRADIUS 1.0.1 ; Date: 2004/09/02 10:52:03 , urgency=high
        Denial-of-Service Security Fix