summaryrefslogtreecommitdiffstats
path: root/package/netsnmp/netsnmp.mk
diff options
context:
space:
mode:
Diffstat (limited to 'package/netsnmp/netsnmp.mk')
-rw-r--r--package/netsnmp/netsnmp.mk110
1 files changed, 72 insertions, 38 deletions
diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index f51699cb7..b8dff4bd6 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -3,25 +3,26 @@
# netsnmp
#
#############################################################
-NETSNMP_VERSION:=5.1.2
-NETSNMP_PATCH_VERSION:=6.2
-NETSNMP_URL:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/net-snmp/
+NETSNMP_VERSION:=5.4.1
+NETSNMP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/net-snmp/
NETSNMP_DIR:=$(BUILD_DIR)/net-snmp-$(NETSNMP_VERSION)
NETSNMP_SOURCE:=net-snmp-$(NETSNMP_VERSION).tar.gz
-NETSNMP_PATCH1:=net-snmp_$(NETSNMP_VERSION)-$(NETSNMP_PATCH_VERSION).diff.gz
-NETSNMP_PATCH1_URL:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/n/net-snmp/
-$(DL_DIR)/$(NETSNMP_SOURCE):
- $(WGET) -P $(DL_DIR) $(NETSNMP_URL)/$(NETSNMP_SOURCE)
+NETSNMP_WO_TRANSPORT:=
+ifneq ($(BR2_INET_IPX),y)
+NETSNMP_WO_TRANSPORT+= IPX
+endif
+ifneq ($(BR2_INET_IPV6),y)
+NETSNMP_WO_TRANSPORT+= UDPIPv6 TCPIPv6
+endif
-$(DL_DIR)/$(NETSNMP_PATCH1):
- $(WGET) -P $(DL_DIR) $(NETSNMP_PATCH1_URL)/$(NETSNMP_PATCH1)
+$(DL_DIR)/$(NETSNMP_SOURCE):
+ $(WGET) -P $(DL_DIR) $(NETSNMP_SITE)/$(NETSNMP_SOURCE)
-$(NETSNMP_DIR)/.unpacked: $(DL_DIR)/$(NETSNMP_SOURCE) $(DL_DIR)/$(NETSNMP_PATCH1)
+$(NETSNMP_DIR)/.unpacked: $(DL_DIR)/$(NETSNMP_SOURCE)
$(ZCAT) $(DL_DIR)/$(NETSNMP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- $(ZCAT) $(DL_DIR)/$(NETSNMP_PATCH1) | patch -p1 -d $(NETSNMP_DIR)
- toolchain/patch-kernel.sh $(NETSNMP_DIR) package/netsnmp/ \*.patch
- touch $(NETSNMP_DIR)/.unpacked
+ toolchain/patch-kernel.sh $(NETSNMP_DIR) package/netsnmp/ \*$(NETSNMP_VERSION)\*.patch
+ touch $@
ifeq ($(BR2_ENDIAN),"BIG")
NETSNMP_ENDIAN=big
@@ -29,21 +30,47 @@ else
NETSNMP_ENDIAN=little
endif
-# We set CAN_USE_SYSCTL to no and use /proc since the
-# sysctl code in this thing is apparently intended for
-# freebsd or some such thing...
+ifeq ($(BR2_HAVE_PERL),y)
+NETSNMP_CONFIGURE_PERL_ENV:=\
+ PERLCC="$(TARGET_CC)"
+NETSNMP_CONFIGURE_PERL:=\
+ --disable-embedded-perl \
+ --disable-perl-cc-checks \
+ --enable-as-needed
+else
+NETSNMP_CONFIGURE_PERL_ENV:=
+NETSNMP_CONFIGURE_PERL:=\
+ --disable-embedded-perl \
+ --disable-perl-cc-checks \
+ --without-perl-modules
+endif
+
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+NETSNMP_CONFIGURE_OPENSSL:=--with-openssl=$(STAGING_DIR)/usr/include/openssl
+else
+NETSNMP_CONFIGURE_OPENSSL:=--without-openssl
+endif
+
+ifneq ($(findstring y,$(BR2_HAVE_MANPAGES)$(BR2_HAVE_INFOPAGES)),y)
+NETSNMP_DOCS:=--disable-manuals
+endif
+
$(NETSNMP_DIR)/.configured: $(NETSNMP_DIR)/.unpacked
(cd $(NETSNMP_DIR); rm -f config.cache; \
autoconf && \
- ac_cv_CAN_USE_SYSCTL=no \
+ ac_cv_NETSNMP_CAN_USE_SYSCTL=yes \
+ $(NETSNMP_CONFIGURE_PERL_ENV) \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
./configure \
- --with-cc=$(TARGET_CROSS)gcc \
- --with-ar=$(TARGET_CROSS)ar \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
+ --with-cc=$(TARGET_CROSS)gcc \
+ --with-linkcc=$(TARGET_CROSS)gcc \
+ --with-ar=$(TARGET_CROSS)ar \
+ --with-cflags="$(TARGET_CFLAGS)" \
+ --with-ldflags="$(TARGET_LDFLAGS)" \
--with-endianness=$(NETSNMP_ENDIAN) \
--with-persistent-directory=/var/lib/snmp \
--enable-ucd-snmp-compatibility \
@@ -51,54 +78,61 @@ $(NETSNMP_DIR)/.configured: $(NETSNMP_DIR)/.unpacked
--disable-static \
--with-logfile=none \
--without-rpm \
- --with-openssl \
+ $(NETSNMP_CONFIGURE_OPENSSL) \
+ $(NETSNMP_DOCS) \
+ $(NETSNMP_CONFIGURE_PERL) \
--without-dmalloc \
--without-efence \
--without-rsaref \
--with-sys-contact="root" \
--with-sys-location="Unknown" \
--with-mib-modules="host smux ucd-snmp/dlmod" \
+ --with-out-transports="$(NETSNMP_WO_TRANSPORT)" \
--with-defaults \
+ --disable-debugging \
--prefix=/usr \
--sysconfdir=/etc \
- --mandir=/usr/man \
- --infodir=/usr/info \
+ --enable-mini-agent \
+ --without-kmem-usage \
+ $(DISABLE_IPV6) \
)
- touch $(NETSNMP_DIR)/.configured
+ touch $@
$(NETSNMP_DIR)/agent/snmpd: $(NETSNMP_DIR)/.configured
$(MAKE1) -C $(NETSNMP_DIR)
+ touch -c $@
$(TARGET_DIR)/usr/sbin/snmpd: $(NETSNMP_DIR)/agent/snmpd
$(MAKE) PREFIX=$(TARGET_DIR)/usr \
prefix=$(TARGET_DIR)/usr \
exec_prefix=$(TARGET_DIR)/usr \
persistentdir=$(TARGET_DIR)/var/lib/snmp \
- infodir=$(TARGET_DIR)/usr/info \
- mandir=$(TARGET_DIR)/usr/man \
includedir=$(STAGING_DIR)/usr/include/net-snmp \
ucdincludedir=$(STAGING_DIR)/usr/include/ucd-snmp \
-C $(NETSNMP_DIR) install
- rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
- $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
+ rm -rf $(TARGET_DIR)/usr/share/doc
+ifneq ($(BR2_HAVE_MANPAGES),y)
+ rm -rf $(TARGET_DIR)/usr/share/man
+endif
+ifneq ($(BR2_HAVE_INFOPAGES),y)
+ rm -rf $(TARGET_DIR)/usr/share/info
+endif
# Copy the .conf files.
- mkdir -p $(TARGET_DIR)/etc/snmp
- cp $(NETSNMP_DIR)/EXAMPLE.conf $(TARGET_DIR)/etc/snmp/snmpd.conf
- cp $(NETSNMP_DIR)/EXAMPLE-trap.conf $(TARGET_DIR)/etc/snmp/snmptrapd.conf
+ $(INSTALL) -D -m 0644 $(NETSNMP_DIR)/EXAMPLE.conf $(TARGET_DIR)/etc/snmp/snmpd.conf
-mv $(TARGET_DIR)/usr/share/snmp/mib2c*.conf $(TARGET_DIR)/etc/snmp
- mkdir -p $(TARGET_DIR)/etc/default
- cp $(NETSNMP_DIR)/debian/snmpd.default $(TARGET_DIR)/etc/default/snmpd
# Remove the unsupported snmpcheck program
- rm $(TARGET_DIR)/usr/bin/snmpcheck
+ rm -f $(TARGET_DIR)/usr/bin/snmpcheck
# Install the "broken" headers
- cp $(NETSNMP_DIR)/agent/mibgroup/struct.h $(STAGING_DIR)/usr/include/net-snmp/agent
- cp $(NETSNMP_DIR)/agent/mibgroup/util_funcs.h $(STAGING_DIR)/usr/include/net-snmp
- cp $(NETSNMP_DIR)/agent/mibgroup/mibincl.h $(STAGING_DIR)/usr/include/net-snmp/library
- cp $(NETSNMP_DIR)/agent/mibgroup/header_complex.h $(STAGING_DIR)/usr/include/net-snmp/agent
+ $(INSTALL) -D -m 0644 $(NETSNMP_DIR)/agent/mibgroup/struct.h $(STAGING_DIR)/usr/include/net-snmp/agent/struct.h
+ $(INSTALL) -D -m 0644 $(NETSNMP_DIR)/agent/mibgroup/util_funcs.h $(STAGING_DIR)/usr/include/net-snmp/util_funcs.h
+ $(INSTALL) -D -m 0644 $(NETSNMP_DIR)/agent/mibgroup/mibincl.h $(STAGING_DIR)/usr/include/net-snmp/library/mibincl.h
+ $(INSTALL) -D -m 0644 $(NETSNMP_DIR)/agent/mibgroup/header_complex.h $(STAGING_DIR)/usr/include/net-snmp/agent/header_complex.h
+ $(INSTALL) -D -m 0755 package/netsnmp/S59snmpd $(TARGET_DIR)/etc/init.d/S59snmpd
netsnmp: openssl $(TARGET_DIR)/usr/sbin/snmpd
netsnmp-headers: $(TARGET_DIR)/usr/include/net-snmp/net-snmp-config.h
+ $(INSTALL) -d $(TARGET_DIR)/usr/include/net-snmp
cp -a $(STAGING_DIR)/usr/include/net-snmp $(TARGET_DIR)/usr/include/net-snmp
cp -a $(STAGING_DIR)/usr/include/ucd-snmp $(TARGET_DIR)/usr/include/net-snmp
@@ -119,6 +153,6 @@ netsnmp-dirclean:
# Toplevel Makefile options
#
#############################################################
-ifeq ($(strip $(BR2_PACKAGE_NETSNMP)),y)
+ifeq ($(BR2_PACKAGE_NETSNMP),y)
TARGETS+=netsnmp
endif