]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Make --enable-snmp cross compile and make libcrypto optional with --without-crypto
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Tue, 13 May 2008 18:03:32 +0000 (20:03 +0200)
committerJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Mon, 25 Aug 2008 07:48:30 +0000 (09:48 +0200)
Autoconfig work by me, the rest was done by
"Kirill K. Smirnov" <lich@math.spbu.ru>

bgpd/bgp_snmp.c
configure.ac
lib/smux.c
ospf6d/ospf6_snmp.c
ospfd/ospf_snmp.c
ripd/rip_snmp.c
zebra/zebra_snmp.c

index 3d26890ebb3762dcd5936aeefee3e0026158187d..576e3e093e6f9a38c339f58640feee07778be2a1 100644 (file)
@@ -23,10 +23,12 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #ifdef HAVE_SNMP
 #ifdef HAVE_NETSNMP
 #include <net-snmp/net-snmp-config.h>
-#endif
+#include <net-snmp/net-snmp-includes.h>
+#else
 #include <asn1.h>
 #include <snmp.h>
 #include <snmp_impl.h>
+#endif
 
 #include "if.h"
 #include "log.h"
index 87ec96c4fafe95d1bd1012df11a59c64b1c42fac..547b68666ec6e427ccdd820dea5e21cfe88ed3d6 100755 (executable)
@@ -206,6 +206,8 @@ AC_ARG_ENABLE(netlink,
 [  --enable-netlink        force to use Linux netlink interface])
 AC_ARG_ENABLE(broken-aliases,
 [  --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
+AC_ARG_WITH(crypto,
+[  --without-crypto        do not use libcrypto in SNMP])
 AC_ARG_ENABLE(snmp,
 [  --enable-snmp           enable SNMP support])
 AC_ARG_WITH(libpam,
@@ -1254,29 +1256,19 @@ dnl ------------------
 dnl check Net-SNMP library
 dnl ------------------
 if test "${enable_snmp}" = "yes"; then
-    LIBS="${LIBS} -lcrypto"
+    if test "$with_crypto" != "no"; then
+        LIBS="${LIBS} -lcrypto";
+    fi
     AC_CHECK_LIB(netsnmp, asn_parse_int,
        [AC_DEFINE(HAVE_NETSNMP,,Net SNMP) 
         AC_DEFINE(HAVE_SNMP,,SNMP)
         LIBS="${LIBS} -lnetsnmp"],
        [AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])])
-    
-    for ac_snmp in /usr/include \
-               /usr/local/include \
-               /dev/null; do
-       test -f "${ac_snmp}/net-snmp/library/asn1.h" && break
-    done
-    
-    case ${ac_snmp} in
-       /dev/null)
-               AC_MSG_ERROR([--enable-snmp given, but can not find header])
-               ;;
-       *)
-               SNMP_INCLUDES="-I${ac_snmp}/net-snmp"
-               SNMP_INCLUDES="${SNMP_INCLUDES} -I${ac_snmp}/net-snmp/library"
-               ;;
-    esac
-    
+
+    AC_CHECK_HEADER([net-snmp/net-snmp-config.h],
+        [],
+        [AC_MSG_ERROR([--enable-snmp given, but cannot find net-snmp-config.h])],
+       QUAGGA_INCLUDES)
     AC_SUBST(SNMP_INCLUDES)
 fi
 
index 6285c94df5e673f635e1a03ed88c8e2dc2dc7875..4a3696c704f50ce6ac5bd32193ee1094dfb2f6e7 100644 (file)
 #ifdef HAVE_SNMP
 #ifdef HAVE_NETSNMP
 #include <net-snmp/net-snmp-config.h>
-#endif
+#include <net-snmp/net-snmp-includes.h>
+#else
 #include <asn1.h>
 #include <snmp.h>
 #include <snmp_impl.h>
+#endif
 
 #include "log.h"
 #include "thread.h"
index a1d8d4c97cf8036a14c215a8ac4ac56f1524e477..8d9842cee11e5552449cfa019b452c0333ca797d 100644 (file)
 
 #ifdef HAVE_NETSNMP
 #include <net-snmp/net-snmp-config.h>
-#endif /*HAVE_NETSNMP*/
-
+#include <net-snmp/net-snmp-includes.h>
+#else
 #include <asn1.h>
 #include <snmp.h>
 #include <snmp_impl.h>
+#endif
 
 #include "log.h"
 #include "vty.h"
index 6e972605f1f61533dabba974a53b820d9178f851..e6ce1f018e63f36384920a006153574831eadcde 100644 (file)
 #ifdef HAVE_SNMP
 #ifdef HAVE_NETSNMP
 #include <net-snmp/net-snmp-config.h>
-#endif
+#include <net-snmp/net-snmp-includes.h>
+#else
 #include <asn1.h>
 #include <snmp.h>
 #include <snmp_impl.h>
+#endif
 
 #include "if.h"
 #include "log.h"
index c1bec762b90b873fbf2544ddf29909f9fde3bb64..d02c7610bac36b53c14a1606ae806217af1b7b61 100644 (file)
 #ifdef HAVE_SNMP
 #ifdef HAVE_NETSNMP
 #include <net-snmp/net-snmp-config.h>
-#endif
+#include <net-snmp/net-snmp-includes.h>
+#else
 #include <asn1.h>
 #include <snmp.h>
 #include <snmp_impl.h>
+#endif
 
 #include "if.h"
 #include "log.h"
index 4536026f524886a609224a1b78ea9276efce284d..7e66e2f67787e7db641021dde68654375b407e59 100644 (file)
 #ifdef HAVE_SNMP
 #ifdef HAVE_NETSNMP
 #include <net-snmp/net-snmp-config.h>
-#endif
+#include <net-snmp/net-snmp-includes.h>
+#else
 #include <asn1.h>
 #include <snmp.h>
 #include <snmp_impl.h>
+#endif
 
 #include "if.h"
 #include "log.h"