Updated tests for SNMP libraries, to not do too much work.
authoraland <aland>
Mon, 24 Sep 2001 15:45:51 +0000 (15:45 +0000)
committeraland <aland>
Mon, 24 Sep 2001 15:45:51 +0000 (15:45 +0000)
aclocal.m4
configure

index 319629c..f894d11 100644 (file)
@@ -873,30 +873,30 @@ dnl #
               SNMP_LIBS="-lsnmp",
               SNMP_LIBS=)
 
-
-  for try in /usr/lib /usr/local/lib /usr/local/snmp/lib $snmp_lib_dir; do
-    LIBS="$old_LIBS -L$try -lsnmp"
-    AC_TRY_LINK([extern char snmp_build_var_op();],
-                [ snmp_build_var_op()],
-                SNMP_LIBS="-L$try -lsnmp",
-                SNMP_LIBS=)
-    if test "x$SNMP_LIBS" != "x"; then
-      break;
-    fi
-
-dnl #
-dnl #  That didn't work.  Try adding the '-lcrypto' line.
-dnl #  Some SNMP libraries are linked against SSL...
-dnl #
-    LIBS="$old_LIBS -L$try -lsnmp -lcrypto"
-    AC_TRY_LINK([extern char snmp_build_var_op();],
-                [ snmp_build_var_op()],
-                SNMP_LIBS="-L$try -lsnmp -lcrypto",
-                SNMP_LIBS=)
-    if test "x$SNMP_LIBS" != "x"; then
-      break;
-    fi
-  done
+  if test "x$SNMP_LIBS" = "x"; then
+    for try in /usr/lib /usr/local/lib /usr/local/snmp/lib $snmp_lib_dir; do
+      LIBS="$old_LIBS -L$try -lsnmp"
+      AC_TRY_LINK([extern char snmp_build_var_op();],
+                  [ snmp_build_var_op()],
+                  SNMP_LIBS="-L$try -lsnmp",
+                  SNMP_LIBS=)
+      if test "x$SNMP_LIBS" != "x"; then
+        break;
+      fi
+dnl   #
+dnl   #  That didn't work.  Try adding the '-lcrypto' line.
+dnl   #  Some SNMP libraries are linked against SSL...
+dnl   #
+      LIBS="$old_LIBS -L$try -lsnmp -lcrypto"
+      AC_TRY_LINK([extern char snmp_build_var_op();],
+                  [ snmp_build_var_op()],
+                  SNMP_LIBS="-L$try -lsnmp -lcrypto",
+                  SNMP_LIBS=)
+      if test "x$SNMP_LIBS" != "x"; then
+        break;
+      fi
+    done
+  fi
   LIBS="$old_LIBS"
 
   dnl #
index b1950c1..2614874 100755 (executable)
--- a/configure
+++ b/configure
@@ -3894,10 +3894,10 @@ else
 fi
 rm -f conftest*
 
-
-  for try in /usr/lib /usr/local/lib /usr/local/snmp/lib $snmp_lib_dir; do
-    LIBS="$old_LIBS -L$try -lsnmp"
-    cat > conftest.$ac_ext <<EOF
+  if test "x$SNMP_LIBS" = "x"; then
+    for try in /usr/lib /usr/local/lib /usr/local/snmp/lib $snmp_lib_dir; do
+      LIBS="$old_LIBS -L$try -lsnmp"
+      cat > conftest.$ac_ext <<EOF
 #line 3902 "configure"
 #include "confdefs.h"
 extern char snmp_build_var_op();
@@ -3915,20 +3915,19 @@ else
   SNMP_LIBS=
 fi
 rm -f conftest*
-    if test "x$SNMP_LIBS" != "x"; then
-      break;
-    fi
-
-    LIBS="$old_LIBS -L$try -lsnmp -lcrypto"
-    cat > conftest.$ac_ext <<EOF
-#line 3925 "configure"
+      if test "x$SNMP_LIBS" != "x"; then
+        break;
+      fi
+      LIBS="$old_LIBS -L$try -lsnmp -lcrypto"
+      cat > conftest.$ac_ext <<EOF
+#line 3924 "configure"
 #include "confdefs.h"
 extern char snmp_build_var_op();
 int main() {
  snmp_build_var_op()
 ; return 0; }
 EOF
-if { (eval echo configure:3932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   SNMP_LIBS="-L$try -lsnmp -lcrypto"
 else
@@ -3938,10 +3937,11 @@ else
   SNMP_LIBS=
 fi
 rm -f conftest*
-    if test "x$SNMP_LIBS" != "x"; then
-      break;
-    fi
-  done
+      if test "x$SNMP_LIBS" != "x"; then
+        break;
+      fi
+    done
+  fi
   LIBS="$old_LIBS"
 
           CFLAGS="$old_CFLAGS"