Amir Guindehi <amir@datacore.ch>:

Fix up build for OSPF-API (dependent on opaque-lsa)
Add disable-ospfapi.
Fix up net-snmp detection.
This commit is contained in:
paul 2003-03-21 15:16:05 +00:00
parent 2be32b7bc1
commit 1ef74ef70b
2 changed files with 60 additions and 39 deletions

View File

@ -69,8 +69,6 @@ AC_ARG_ENABLE(ripngd,
[ --disable-ripngd do not build ripngd]) [ --disable-ripngd do not build ripngd])
AC_ARG_ENABLE(ospfd, AC_ARG_ENABLE(ospfd,
[ --disable-ospfd do not build ospfd]) [ --disable-ospfd do not build ospfd])
AC_ARG_ENABLE(ospfclient,
[ --disable-ospfclient do not build ospfclient])
AC_ARG_ENABLE(ospf6d, AC_ARG_ENABLE(ospf6d,
[ --disable-ospf6d do not build ospf6d]) [ --disable-ospf6d do not build ospf6d])
AC_ARG_ENABLE(bgp-announce, AC_ARG_ENABLE(bgp-announce,
@ -89,7 +87,13 @@ dnl Temporary option until OSPF NSSA implementation complete
AC_ARG_ENABLE(nssa, AC_ARG_ENABLE(nssa,
[ --enable-nssa enable OSPF NSSA option]) [ --enable-nssa enable OSPF NSSA option])
AC_ARG_ENABLE(opaque-lsa, AC_ARG_ENABLE(opaque-lsa,
[ --enable-opaque-lsa enable OSPF Opaque-LSA support (RFC2370)]) [ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
AC_ARG_ENABLE(ospfapi,
[ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database,
(this is the default if --enable-opaque-lsa is not set)])
AC_ARG_ENABLE(ospfclient,
[ --disable-ospfclient do not build OSPFAPI client for OSPFAPI,
(this is the default if --disable-ospfapi is set)])
AC_ARG_ENABLE(ospf-te, AC_ARG_ENABLE(ospf-te,
[ --enable-ospf-te enable Traffic Engineering Extension to OSPF]) [ --enable-ospf-te enable Traffic Engineering Extension to OSPF])
AC_ARG_ENABLE(multipath, AC_ARG_ENABLE(multipath,
@ -536,11 +540,18 @@ else
OSPFD="ospfd" OSPFD="ospfd"
fi fi
if test "${enable_ospfclient}" = "no";then OSPFAPI=""
OSPFCLIENT="" OSPFCLIENT=""
else if test "${enable_opaque_lsa}" = "yes"; then
if test "${enable_ospfapi}" != "no";then
OSPFAPI="-DSUPPORT_OSPF_API"
if test "${enable_ospfclient}" != "no";then
OSPFCLIENT="ospfclient" OSPFCLIENT="ospfclient"
fi fi
fi
fi
case "${enable_ripngd}" in case "${enable_ripngd}" in
"yes") RIPNGD="ripngd";; "yes") RIPNGD="ripngd";;
@ -568,6 +579,7 @@ AC_SUBST(VTYSH)
AC_SUBST(INCLUDES) AC_SUBST(INCLUDES)
AC_SUBST(CURSES) AC_SUBST(CURSES)
AC_SUBST(OSPFCLIENT) AC_SUBST(OSPFCLIENT)
AC_SUBST(OSPFAPI)
AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)]) AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)]) AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
AC_CHECK_LIB(crypt, crypt) AC_CHECK_LIB(crypt, crypt)
@ -596,52 +608,61 @@ dnl check SNMP library
dnl ------------------ dnl ------------------
if test "${enable_snmp}" = "yes";then if test "${enable_snmp}" = "yes";then
dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
if test "${HAVE_SNMP}" = ""; then
old_libs="${LIBS}" old_libs="${LIBS}"
LIBS="-L/usr/local/lib" LIBS="-L/usr/lib"
unset ac_cv_lib_snmp_asn_parse_int
AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
if test "${NEED_CRYPTO}" = ""; then
AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ])
else
AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
fi
LIBS="${old_libs}"
fi
if test "${HAVE_SNMP}" = ""; then
old_libs="${LIBS}"
LIBS="-L/usr/lib"
unset ac_cv_lib_snmp_asn_parse_int unset ac_cv_lib_snmp_asn_parse_int
AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, ) AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, )
if test "${HAVE_SNMP}" = ""; then if test "${HAVE_SNMP}" = ""; then
unset ac_cv_lib_snmp_asn_parse_int unset ac_cv_lib_snmp_asn_parse_int
AC_CHECK_LIB(crypto, main, [NEED_CRYPTO=yes ], ) AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
if test "${NEED_CRYPTO}" = ""; then if test "${NEED_CRYPTO}" = "yes"; then
AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes ],)
else
AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto") AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
fi fi
fi fi
LIBS="${old_libs}" LIBS="${old_libs}"
fi
if test "${HAVE_SNMP}" = ""; then if test "${HAVE_SNMP}" = ""; then
old_libs="${LIBS}" old_libs="${LIBS}"
LIBS="-L/usr/local/lib" LIBS="-L/usr/local/lib"
unset ac_cv_lib_snmp_asn_parse_int
AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes)
LIBS="${old_libs}"
fi
if test "${HAVE_SNMP}" = ""; then if test "${HAVE_SNMP}" = ""; then
if test "${NEED_CRYPTO}" = ""; then unset ac_cv_lib_snmp_asn_parse_int
old_libs="${LIBS}" AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, )
LIBS="-L/usr/lib" if test "${NEED_CRYPTO}" = "yes"; then
AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ]) AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto")
LIBS="${old_libs}"
else
old_libs="${LIBS}"
LIBS="-L/usr/lib"
AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto")
LIBS="${old_libs}"
fi fi
fi fi
LIBS="${old_libs}"
fi
if test "${HAVE_SNMP}" = "yes"; then if test "${HAVE_SNMP}" = "yes"; then
for ac_snmp in /usr/include/net-snmp/library/asn1.h /usr/include/ucd-snmp/asn1.h /usr/local/include/ucd-snmp/asn1.h /dev/null for ac_snmp in /usr/include/net-snmp/library/asn1.h /usr/include/ucd-snmp/asn1.h /usr/local/include/ucd-snmp/asn1.h /dev/null
do do
test -f "${ac_snmp}" && break test -f "${ac_snmp}" && break
done done
case ${ac_snmp} in case ${ac_snmp} in
/usr/include/net-snmp/*) /usr/include/net-snmp/*)
AC_DEFINE(HAVE_SNMP,,SNMP) AC_DEFINE(HAVE_SNMP,,SNMP)
AC_DEFINE(HAVE_NETSNMP,,SNMP)
AC_DEFINE(UCD_COMPATIBLE,,SNMP) AC_DEFINE(UCD_COMPATIBLE,,SNMP)
CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library" CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
if test "${HAVE_NETSNMP}" = "yes"; then if test "${HAVE_NETSNMP}" = "yes"; then
AC_DEFINE(HAVE_NETSNMP,,SNMP)
LIBS="${LIBS} -lnetsnmp" LIBS="${LIBS} -lnetsnmp"
else else
LIBS="${LIBS} -lsnmp" LIBS="${LIBS} -lsnmp"

View File

@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in. ## Process this file with automake to produce Makefile.in.
INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib
LOCAL_OPTS =-DSUPPORT_OSPF_API LOCAL_OPTS = @OSPFAPI@
DEFS = @DEFS@ $(LOCAL_OPTS) -DSYSCONFDIR=\"$(sysconfdir)/\" DEFS = @DEFS@ $(LOCAL_OPTS) -DSYSCONFDIR=\"$(sysconfdir)/\"
INSTALL_SDATA=@INSTALL@ -m 600 INSTALL_SDATA=@INSTALL@ -m 600