diff options
| author | Nathan Kinder <nkinder@redhat.com> | 2005-03-28 23:53:31 +0000 |
|---|---|---|
| committer | Nathan Kinder <nkinder@redhat.com> | 2005-03-28 23:53:31 +0000 |
| commit | cf3fe16e4e3f31280be2eb194eb3c022e7b3e5d3 (patch) | |
| tree | 0012aad4cab5c5ac2d8db288cf1cbbd8cfbeaecc | |
| parent | 54fdf73874abce4f4f5adaaa4d7782113cfd2264 (diff) | |
| download | ds-cf3fe16e4e3f31280be2eb194eb3c022e7b3e5d3.tar.gz ds-cf3fe16e4e3f31280be2eb194eb3c022e7b3e5d3.tar.xz ds-cf3fe16e4e3f31280be2eb194eb3c022e7b3e5d3.zip | |
Enable building of SNMP subagent
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | component_versions.mk | 6 | ||||
| -rw-r--r-- | components.mk | 18 | ||||
| -rw-r--r-- | internal_buildpaths.mk | 5 | ||||
| -rw-r--r-- | internal_comp_deps.mk | 39 | ||||
| -rw-r--r-- | ldap/servers/Makefile | 2 | ||||
| -rw-r--r-- | ldap/servers/snmp/Makefile | 45 | ||||
| -rw-r--r-- | ldap/servers/snmp/ldap-agent.c | 5 | ||||
| -rw-r--r-- | ldap/servers/snmp/ldap-agent.h | 6 | ||||
| -rw-r--r-- | ldap/servers/snmp/main.c | 3 |
10 files changed, 70 insertions, 61 deletions
@@ -99,7 +99,7 @@ help: ifeq ($(INTERNAL_BUILD), 1) COMPONENT_DEPENDENCIES = $(ADMINUTIL_DEP) $(NSPR_DEP) $(ARLIB_DEP) $(DBM_DEP) $(SECURITY_DEP) $(SVRCORE_DEP) \ - $(ICU_DEP) $(SETUPSDK_DEP) $(LDAPSDK_DEP) $(DB_LIB_DEP) $(SASL_DEP) $(PEER_DEP) \ + $(ICU_DEP) $(SETUPSDK_DEP) $(LDAPSDK_DEP) $(DB_LIB_DEP) $(SASL_DEP) $(NETSNMP_DEP) \ $(AXIS_DEP) $(DSMLJAR_DEP) $(DSDOC_DEP) endif diff --git a/component_versions.mk b/component_versions.mk index b8af3dab..50e31f55 100644 --- a/component_versions.mk +++ b/component_versions.mk @@ -96,9 +96,9 @@ ifndef ADM_VERSDIR ADM_VERSDIR = adminserver/70$(BUILD_MODE) endif -# peer -ifndef PEER_RELDATE - PEER_RELDATE = DS7.0 +# Net-SNMP +ifndef NETSNMP_VER + NETSNMP_VER = v5.2.1 endif # setup sdk diff --git a/components.mk b/components.mk index b9652e9a..15d4e053 100644 --- a/components.mk +++ b/components.mk @@ -358,6 +358,24 @@ else endif ########################################################### +### Net-SNMP package ###################################### +ifdef NETSNMP_SOURCE_ROOT + NETSNMP_LIBPATH = $(NETSNMP_SOURCE_ROOT)/lib + NETSNMP_INCDIR = $(NETSNMP_SOURCE_ROOT)/include +else + NETSNMP_LIBPATH = $(NETSNMP_BUILD_DIR)/lib + NETSNMP_INCDIR = $(NETSNMP_BUILD_DIR)/include +endif + +NETSNMP_INCLUDE = -I$(NETSNMP_INCDIR) +NETSNMP_LIBNAMES = netsnmp netsnmpagent netsnmpmibs netsnmphelpers +NETSNMP_LINK = -L$(NETSNMP_LIBPATH) $(addprefix -l, $(NETSNMP_LIBNAMES)) +ifneq ($(ARCH), WINNT) + NETSNMP_SOLIBS = $(addsuffix .$(DLL_SUFFIX).5, $(addprefix $(LIB_PREFIX), $(NETSNMP_LIBNAMES))) + LIBS_TO_PKG += $(addprefix $(NETSNMP_LIBPATH)/,$(NETSNMP_SOLIBS)) +endif +########################################################### + ### ICU package ########################################## ICU_LIB_VERSION = 24 diff --git a/internal_buildpaths.mk b/internal_buildpaths.mk index 9fbbd833..2b0f21cf 100644 --- a/internal_buildpaths.mk +++ b/internal_buildpaths.mk @@ -74,6 +74,11 @@ ifndef SASL_SOURCE_ROOT SASL_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/sasl endif # SASL_SOURCE_ROOT +#NETSNMP_SOURCE_ROOT = $(BUILD_ROOT)/../net-snmp +ifndef NETSNMP_SOURCE_ROOT +NETSNMP_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/net-snmp +endif # NETSNMP_SOURCE_ROOT + #ICU_SOURCE_ROOT = $(BUILD_ROOT)/../icu ifndef ICU_SOURCE_ROOT ICU_BUILD_DIR = $(NSCP_DISTDIR_FULL_RTL)/libicu diff --git a/internal_comp_deps.mk b/internal_comp_deps.mk index 7a9010bf..e16b0220 100644 --- a/internal_comp_deps.mk +++ b/internal_comp_deps.mk @@ -334,36 +334,25 @@ endif fi ########################################################### -# Peer +# Net-SNMP -PEER_BUILD_DIR = $(NSCP_DISTDIR)/peer -ifeq ($(ARCH), WINNT) -# PEER_RELEASE = $(COMPONENTS_DIR)/peer/$(PEER_RELDATE) -# PEER_FILES = include -else -PEER_RELEASE = $(COMPONENTS_DIR)/peer/$(PEER_RELDATE)/$(NSOBJDIR_NAME) -PEER_FILES = obj -PEER_DEP = $(PEER_OBJPATH)/ns-ldapagt -endif -# PEER_MGMTPATH = $(PEER_BUILD_DIR)/dev -# PEER_INCDIR = $(PEER_BUILD_DIR)/include -# PEER_BINPATH = $(PEER_BUILD_DIR)/dev -PEER_OBJPATH = $(PEER_BUILD_DIR)/obj -# PEER_INCLUDE = -I$(PEER_INCDIR) - -ifndef PEER_PULL_METHOD -PEER_PULL_METHOD = $(COMPONENT_PULL_METHOD) +ifndef NETSNMP_SOURCE_ROOT +NETSNMP_RELEASE = $(COMPONENTS_DIR_DEV)/net-snmp/$(NETSNMP_VER)/$(NSOBJDIR_NAME) +NETSNMP_DEP = $(NETSNMP_INCDIR)/net-snmp/net-snmp-includes.h +ifndef NETSNMP_PULL_METHOD +NETSNMP_PULL_METHOD = $(COMPONENT_PULL_METHOD) endif - -$(PEER_DEP): $(NSCP_DISTDIR) + +$(NETSNMP_DEP): $(NSCP_DISTDIR_FULL_RTL) ifdef COMPONENT_DEPS - $(FTP_PULL) -method $(PEER_PULL_METHOD) \ - -objdir $(PEER_BUILD_DIR) -componentdir $(PEER_RELEASE) \ - -files $(PEER_FILES) + $(FTP_PULL) -method $(NETSNMP_PULL_METHOD) \ + -objdir $(NETSNMP_BUILD_DIR) -componentdir $(NETSNMP_RELEASE) \ + -files lib,include +endif -@if [ ! -f $@ ] ; \ - then echo "Error: could not get component PEER file $@" ; \ + then echo "Error: could not get component NETSNMP file $@" ; \ fi -endif +endif # NETSNMP_SOURCE_ROOT ########################################################### diff --git a/ldap/servers/Makefile b/ldap/servers/Makefile index a0666859..01b2797c 100644 --- a/ldap/servers/Makefile +++ b/ldap/servers/Makefile @@ -48,9 +48,7 @@ _plugins: cd plugins; $(MAKE) $(MFLAGS) all _snmp: -ifdef still_waiting_for_net_snmp cd snmp; $(MAKE) $(MFLAGS) all -endif _slapdtools: cd slapd/tools; $(MAKE) $(MFLAGS) all diff --git a/ldap/servers/snmp/Makefile b/ldap/servers/snmp/Makefile index 1951308c..f8c77720 100644 --- a/ldap/servers/snmp/Makefile +++ b/ldap/servers/snmp/Makefile @@ -22,29 +22,32 @@ NOSTDCLEAN=true # don't let nsconfig.mk define target clean NOSTDSTRIP=true # don't let nsconfig.mk define target strip NSPR20=true # probably should be defined somewhere else (not sure where) -OBJDEST = $(OBJDIR)/ns-ldapagt/obj -INCLDEST = $(OBJDIR)/ns-ldapagt/include +OBJDEST = $(OBJDIR)/ldap-agent BINDIR = $(LDAP_SERVER_RELDIR) -EXTDEST = $(BINDIR) include $(BUILD_ROOT)/nsconfig.mk include $(LDAP_SRC)/nsldap.mk -MCC_SERVER= - ARCH := $(shell uname -s) ifneq ($(ARCH), WINNT) ARCH := $(shell $(BUILD_ROOT)/nsarch) endif +SNMP_OBJS = main.o ldap-agent.o agtmmap.o +OBJS = $(addprefix $(OBJDEST)/, $(SNMP_OBJS)) +SNMPMODULE = ldap-agent +AGTMMAP_DIR = $(LDAP_SRC)/servers/slapd -SNMPMODULE = ns-ldapagt +ifneq ($(ARCH), WINNT) +INCLUDES += -I. $(NETSNMP_INCLUDE) $(NSPR_INCLUDE) +EXTRA_LIBS += $(NETSNMP_LINK) -ldl -lcrypto -lelf -lm +endif -# the netscape-ldap.mib goes in the plugins/snmp directory, and the other mib like +# the redhat-directory.mib goes in the plugins/snmp directory, and the other mib like # files go in the plugins/snmp/mibs directory -NSMIB_DEST_DIR = $(RELDIR)/plugins/snmp -NSMIB_SRC_FILES = netscape-ldap.mib -MIBS_DEST_DIR = $(NSMIB_DEST_DIR)/mibs +MIB_DEST_DIR = $(RELDIR)/plugins/snmp +MIB_SRC_FILES =redhat-directory.mib +MIBS_DEST_DIR = $(MIB_DEST_DIR)/mibs MIBS_SRC_FILES = NETWORK-SERVICES-MIB.txt \ RFC1155-SMI.txt \ RFC-1215.txt \ @@ -52,31 +55,33 @@ MIBS_SRC_FILES = NETWORK-SERVICES-MIB.txt \ SNMPv2-SMI.txt \ SNMPv2-TC.txt MIB_DEST_FILES = $(addprefix $(MIBS_DEST_DIR)/,$(notdir $(MIBS_SRC_FILES))) \ - $(addprefix $(NSMIB_DEST_DIR)/,$(NSMIB_SRC_FILES)) + $(addprefix $(MIB_DEST_DIR)/,$(MIB_SRC_FILES)) default: all ifneq ($(ARCH), WINNT) -all: $(EXTDEST)/$(SNMPMODULE) $(NSMIB_DEST_DIR)/$(NSMIB_SRC_FILES) $(MIB_DEST_FILES) +all: $(OBJDEST) $(BINDIR)/$(SNMPMODULE) $(MIB_DEST_DIR)/$(MIB_SRC_FILES) $(MIB_DEST_FILES) else OBJ_SUFFIX=obj all: $(MIB_DEST_FILES) cd ntagt; $(MAKE) $(MFLAGS) all endif +# Rule to make agtmmap +$(OBJDEST)/agtmmap.o: $(AGTMMAP_DIR)/agtmmap.c + $(CC) $(CFLAGS) -g -o $@ -c $< + # Rule to create destination directories -$(MIBS_DEST_DIR) $(NSMIB_DEST_DIR): +$(MIBS_DEST_DIR) $(MIB_DEST_DIR) $(OBJDEST): $(MKDIR) $@ -# Rule to copy subagent binary to release area -$(EXTDEST)/$(SNMPMODULE): $(EXTDEST) -ifneq ($(ARCH), WINNT) - $(CP) $(NSCP_DISTDIR)/peer/obj/$(SNMPMODULE) $(EXTDEST)/$(SNMPMODULE) -endif +# Rule to build subagent binary +$(BINDIR)/$(SNMPMODULE): $(OBJS) + $(LINK_EXE) # this rule is for mib files in the local directory that go in the nsmib directory -$(NSMIB_DEST_DIR)/$(NSMIB_SRC_FILES): $(NSMIB_DEST_DIR) - $(CP) ./$(NSMIB_SRC_FILES) $@ +$(MIB_DEST_DIR)/$(MIB_SRC_FILES): $(MIB_DEST_DIR) + $(CP) ./$(MIB_SRC_FILES) $@ # this rule is for mib files which go in the mibs subdir $(MIBS_DEST_DIR)/%: % $(MIBS_DEST_DIR) diff --git a/ldap/servers/snmp/ldap-agent.c b/ldap/servers/snmp/ldap-agent.c index 80b5dea1..b5bfa23e 100644 --- a/ldap/servers/snmp/ldap-agent.c +++ b/ldap/servers/snmp/ldap-agent.c @@ -5,11 +5,6 @@ #include <stdio.h> #include <time.h> -#include <net-snmp/net-snmp-config.h> -#include <net-snmp/net-snmp-includes.h> -#include <net-snmp/agent/net-snmp-agent-includes.h> -#include <net-snmp/library/snmp_assert.h> - #include "ldap-agent.h" static netsnmp_handler_registration *ops_handler = NULL; diff --git a/ldap/servers/snmp/ldap-agent.h b/ldap/servers/snmp/ldap-agent.h index eeb010c5..250a3d60 100644 --- a/ldap/servers/snmp/ldap-agent.h +++ b/ldap/servers/snmp/ldap-agent.h @@ -10,11 +10,13 @@ extern "C" { #endif - #include <net-snmp/net-snmp-config.h> +#include <net-snmp/net-snmp-includes.h> +#include <net-snmp/agent/net-snmp-agent-includes.h> +#include <net-snmp/library/snmp_assert.h> #include <net-snmp/library/container.h> #include <net-snmp/agent/table_array.h> -#include "agtmmap.h" +#include "../slapd/agtmmap.h" #define MAXLINE 4096 #define CACHE_REFRESH_INTERVAL 15 diff --git a/ldap/servers/snmp/main.c b/ldap/servers/snmp/main.c index 87ff65d5..3d5e654d 100644 --- a/ldap/servers/snmp/main.c +++ b/ldap/servers/snmp/main.c @@ -3,9 +3,6 @@ * All rights reserved. * --- END COPYRIGHT BLOCK --- */ -#include <net-snmp/net-snmp-config.h> -#include <net-snmp/net-snmp-includes.h> -#include <net-snmp/agent/net-snmp-agent-includes.h> #include <signal.h> #include <string.h> #include <stdio.h> |
