From 2a3e405f7ca8ac1b7b09026fb1779e254e2f1fc8 Mon Sep 17 00:00:00 2001 From: aland Date: Mon, 12 Mar 2001 15:56:33 +0000 Subject: [PATCH] Massive changes to get SNMP auto-configured && working. --- Make.inc.in | 3 +++ acconfig.h | 10 ++-------- configure.in | 41 +++++++++++------------------------------ src/include/autoconf.h.in | 19 ++++++++----------- src/main/Makefile | 6 +++--- 5 files changed, 27 insertions(+), 52 deletions(-) diff --git a/Make.inc.in b/Make.inc.in index 69c6777..53776ec 100644 --- a/Make.inc.in +++ b/Make.inc.in @@ -50,6 +50,9 @@ USE_SHARED_LIBS = @USE_SHARED_LIBS@ USE_STATIC_LIBS = @USE_STATIC_LIBS@ STATIC_MODULES = @STATIC_MODULES@ +SNMP_INCLUDE = @SNMP_INCLUDE@ +SNMP_LIBS = @SNMP_LIBS@ + # # SQL driver defines # diff --git a/acconfig.h b/acconfig.h index 7a3cb08..df207aa 100644 --- a/acconfig.h +++ b/acconfig.h @@ -86,20 +86,14 @@ config.h - created by autoconf; contains defines generated by autoconf /* Define if you have the header file. */ #undef HAVE_SNMP_H -/* Define if you have the header file. */ -#undef HAVE_UCD_SNMP_SNMP_H - /* Define if you have the header file. */ #undef HAVE_SNMP_IMPL_H -/* Define if you have the header file. */ -#undef HAVE_UCD_SNMP_SNMP_IMPL_H - /* Define if you have the header file. */ #undef HAVE_ASN1_H -/* Define if you have the header file. */ -#undef HAVE_UCD_SNMP_ASN1_H +/* Define if you have the snmp library (-lsnmp). */ +#undef HAVE_LIBSNMP /* define if you have the header file. */ #undef HAVE_LIBPQ_FE_H diff --git a/configure.in b/configure.in index 5442196..af57905 100644 --- a/configure.in +++ b/configure.in @@ -391,20 +391,6 @@ dnl Check if we need -lnsl. Usually if we want to dnl link against -lsocket we need to include -lnsl as well. AC_CHECK_LIB(nsl, inet_ntoa) -dnl # -dnl # Look for the SNMP libraries. -dnl # If we can't link to them, try adding -lcrypto to LIBS, -dnl # and try linking again. -dnl # -if test "x$WITH_SNMP" = "xyes"; then - AC_CHECK_LIB(snmp, snmp_build_var_op) -fi - -POSTGRESQL_CHECKS -MYSQL_CHECKS -ORACLE_CHECKS -ODBC_CHECKS - dnl ############################################################# dnl # dnl # 3. Checks for header files @@ -430,6 +416,8 @@ AC_CHECK_HEADERS( \ syslog.h \ inttypes.h \ stdint.h \ + stdio.h \ + netdb.h \ arpa/inet.h \ netinet/in.h \ sys/types.h \ @@ -437,18 +425,6 @@ AC_CHECK_HEADERS( \ sys/time.h ) -dnl # -dnl # If we have SNMP libraries, check for SNMP header files. -dnl # -if test "x$WITH_SNMP" = "xyes"; then - AC_CHECK_HEADER(snmp.h, AC_DEFINE(HAVE_SNMP_H), - AC_CHECK_HEADER(ucd-snmp/snmp.h, AC_DEFINE(HAVE_UCD_SNMP_SNMP_H))) - AC_CHECK_HEADER(snmp_impl.h, AC_DEFINE(HAVE_SNMP_IMPL_H), - AC_CHECK_HEADER(ucd-snmp/snmp_impl.h, AC_DEFINE(HAVE_UCD_SNMP_SNMP_IMPL_H))) - AC_CHECK_HEADER(asn1.h, AC_DEFINE(HAVE_ASN1_H), - AC_CHECK_HEADER(ucd-snmp/asn1.h, AC_DEFINE(HAVE_UCD_SNMP_ASN1_H))) -fi - REGEX=no AC_CHECK_HEADER(regex.h, REGEX=yes) @@ -599,6 +575,15 @@ else AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT)) fi +if test "x$WITH_SNMP" = "xyes"; then + SNMP_CHECKS +fi + +POSTGRESQL_CHECKS +MYSQL_CHECKS +ORACLE_CHECKS +ODBC_CHECKS + dnl ############################################################# dnl # dnl # 8. Checks for system services @@ -634,10 +619,6 @@ AC_SUBST(STATIC_MODULES) AC_SUBST(REGEX) AC_SUBST(REGEX_EXTENDED) -if test "x$WITH_SNMP" = "xyes"; then - AC_DEFINE(WITH_SNMP) -fi - AC_OUTPUT(\ ./Make.inc \ ./src/include/build-radpaths-h \ diff --git a/src/include/autoconf.h.in b/src/include/autoconf.h.in index 62e77d8..5b39ac3 100644 --- a/src/include/autoconf.h.in +++ b/src/include/autoconf.h.in @@ -72,20 +72,14 @@ config.h - created by autoconf; contains defines generated by autoconf /* Define if you have the header file. */ #undef HAVE_SNMP_H -/* Define if you have the header file. */ -#undef HAVE_UCD_SNMP_SNMP_H - /* Define if you have the header file. */ #undef HAVE_SNMP_IMPL_H -/* Define if you have the header file. */ -#undef HAVE_UCD_SNMP_SNMP_IMPL_H - /* Define if you have the header file. */ #undef HAVE_ASN1_H -/* Define if you have the header file. */ -#undef HAVE_UCD_SNMP_ASN1_H +/* Define if you have the snmp library (-lsnmp). */ +#undef HAVE_LIBSNMP /* define if you have the header file. */ #undef HAVE_LIBPQ_FE_H @@ -183,6 +177,9 @@ config.h - created by autoconf; contains defines generated by autoconf /* Define if you have the header file. */ #undef HAVE_NDIR_H +/* Define if you have the header file. */ +#undef HAVE_NETDB_H + /* Define if you have the header file. */ #undef HAVE_NETINET_IN_H @@ -198,6 +195,9 @@ config.h - created by autoconf; contains defines generated by autoconf /* Define if you have the header file. */ #undef HAVE_STDINT_H +/* Define if you have the header file. */ +#undef HAVE_STDIO_H + /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H @@ -237,9 +237,6 @@ config.h - created by autoconf; contains defines generated by autoconf /* Define if you have the resolv library (-lresolv). */ #undef HAVE_LIBRESOLV -/* Define if you have the snmp library (-lsnmp). */ -#undef HAVE_LIBSNMP - /* Define if you have the socket library (-lsocket). */ #undef HAVE_LIBSOCKET diff --git a/src/main/Makefile b/src/main/Makefile index bdfbfed..4d62e2c 100644 --- a/src/main/Makefile +++ b/src/main/Makefile @@ -8,11 +8,11 @@ SERVER_OBJS = radiusd.o files.o util.o acct.o nas.o log.o valuepair.o \ version.o proxy.o exec.o auth.o timestr.o conffile.o \ modules.o modcall.o session.o xlat.o threads.o smux.o \ radius_snmp.o client.o request_list.o -INCLUDES = ../include/radiusd.h ../include/conf.h ../include/autoconf.h +INCLUDES = ../include/radiusd.h ../include/conf.h ../include/autoconf.h -CFLAGS += -I../include +CFLAGS += -I../include $(SNMP_INCLUDE) LDFLAGS += -L../lib -LIBS += -lradius +LIBS += -lradius $(SNMP_LIBS) MODULE_LIBS = $(STATIC_MODULES) # -- 2.1.4