2003-06-04 22:45:47 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# netsnmp
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-11-04 12:26:52 +01:00
|
|
|
NETSNMP_VERSION:=5.4.1
|
|
|
|
NETSNMP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/net-snmp/
|
2007-07-11 16:06:06 +02:00
|
|
|
NETSNMP_DIR:=$(BUILD_DIR)/net-snmp-$(NETSNMP_VERSION)
|
|
|
|
NETSNMP_SOURCE:=net-snmp-$(NETSNMP_VERSION).tar.gz
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2008-11-04 12:26:52 +01:00
|
|
|
NETSNMP_WO_TRANSPORT:=
|
|
|
|
ifneq ($(BR2_INET_IPX),y)
|
|
|
|
NETSNMP_WO_TRANSPORT+= IPX
|
|
|
|
endif
|
|
|
|
ifneq ($(BR2_INET_IPV6),y)
|
|
|
|
NETSNMP_WO_TRANSPORT+= UDPIPv6 TCPIPv6
|
|
|
|
endif
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2008-11-04 12:26:52 +01:00
|
|
|
$(DL_DIR)/$(NETSNMP_SOURCE):
|
|
|
|
$(WGET) -P $(DL_DIR) $(NETSNMP_SITE)/$(NETSNMP_SOURCE)
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2008-11-04 12:26:52 +01:00
|
|
|
$(NETSNMP_DIR)/.unpacked: $(DL_DIR)/$(NETSNMP_SOURCE)
|
2006-10-01 17:17:52 +02:00
|
|
|
$(ZCAT) $(DL_DIR)/$(NETSNMP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
2008-11-04 12:26:52 +01:00
|
|
|
toolchain/patch-kernel.sh $(NETSNMP_DIR) package/netsnmp/ \*$(NETSNMP_VERSION)\*.patch
|
2008-11-04 12:31:58 +01:00
|
|
|
$(CONFIG_UPDATE) $(@D)
|
2008-11-04 12:26:52 +01:00
|
|
|
touch $@
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2007-04-20 13:12:50 +02:00
|
|
|
ifeq ($(BR2_ENDIAN),"BIG")
|
|
|
|
NETSNMP_ENDIAN=big
|
|
|
|
else
|
|
|
|
NETSNMP_ENDIAN=little
|
|
|
|
endif
|
|
|
|
|
2008-11-04 12:26:52 +01:00
|
|
|
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
|
|
|
|
|
2003-06-04 22:45:47 +02:00
|
|
|
$(NETSNMP_DIR)/.configured: $(NETSNMP_DIR)/.unpacked
|
2007-09-25 14:34:09 +02:00
|
|
|
(cd $(NETSNMP_DIR); rm -f config.cache; \
|
|
|
|
autoconf && \
|
2008-11-04 12:26:52 +01:00
|
|
|
ac_cv_NETSNMP_CAN_USE_SYSCTL=yes \
|
|
|
|
$(NETSNMP_CONFIGURE_PERL_ENV) \
|
2007-06-25 17:07:25 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-06-27 14:01:27 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2003-06-04 22:45:47 +02:00
|
|
|
./configure \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
2008-11-04 12:26:52 +01:00
|
|
|
--with-cc=$(TARGET_CROSS)gcc \
|
|
|
|
--with-linkcc=$(TARGET_CROSS)gcc \
|
|
|
|
--with-ar=$(TARGET_CROSS)ar \
|
|
|
|
--with-cflags="$(TARGET_CFLAGS)" \
|
|
|
|
--with-ldflags="$(TARGET_LDFLAGS)" \
|
2007-04-20 13:12:50 +02:00
|
|
|
--with-endianness=$(NETSNMP_ENDIAN) \
|
2003-06-04 22:45:47 +02:00
|
|
|
--with-persistent-directory=/var/lib/snmp \
|
|
|
|
--enable-ucd-snmp-compatibility \
|
|
|
|
--enable-shared \
|
|
|
|
--disable-static \
|
|
|
|
--with-logfile=none \
|
|
|
|
--without-rpm \
|
2008-11-04 12:26:52 +01:00
|
|
|
$(NETSNMP_CONFIGURE_OPENSSL) \
|
|
|
|
$(NETSNMP_DOCS) \
|
|
|
|
$(NETSNMP_CONFIGURE_PERL) \
|
2003-06-04 22:45:47 +02:00
|
|
|
--without-dmalloc \
|
|
|
|
--without-efence \
|
|
|
|
--without-rsaref \
|
|
|
|
--with-sys-contact="root" \
|
|
|
|
--with-sys-location="Unknown" \
|
|
|
|
--with-mib-modules="host smux ucd-snmp/dlmod" \
|
2008-11-04 12:26:52 +01:00
|
|
|
--with-out-transports="$(NETSNMP_WO_TRANSPORT)" \
|
2003-06-04 22:45:47 +02:00
|
|
|
--with-defaults \
|
2008-11-04 12:26:52 +01:00
|
|
|
--disable-debugging \
|
2003-06-04 22:45:47 +02:00
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
2008-11-04 12:26:52 +01:00
|
|
|
--enable-mini-agent \
|
|
|
|
--without-kmem-usage \
|
|
|
|
$(DISABLE_IPV6) \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2008-11-04 12:26:52 +01:00
|
|
|
touch $@
|
2003-06-04 22:45:47 +02:00
|
|
|
|
|
|
|
$(NETSNMP_DIR)/agent/snmpd: $(NETSNMP_DIR)/.configured
|
2006-12-20 18:46:00 +01:00
|
|
|
$(MAKE1) -C $(NETSNMP_DIR)
|
2008-11-04 12:26:52 +01:00
|
|
|
touch -c $@
|
2003-06-04 22:45:47 +02:00
|
|
|
|
|
|
|
$(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 \
|
2007-06-25 17:07:25 +02:00
|
|
|
includedir=$(STAGING_DIR)/usr/include/net-snmp \
|
|
|
|
ucdincludedir=$(STAGING_DIR)/usr/include/ucd-snmp \
|
2007-08-21 21:20:18 +02:00
|
|
|
-C $(NETSNMP_DIR) install
|
2008-11-04 12:26:52 +01:00
|
|
|
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
|
2003-06-04 22:45:47 +02:00
|
|
|
# Copy the .conf files.
|
2008-11-04 12:26:52 +01:00
|
|
|
$(INSTALL) -D -m 0644 $(NETSNMP_DIR)/EXAMPLE.conf $(TARGET_DIR)/etc/snmp/snmpd.conf
|
2003-06-04 22:45:47 +02:00
|
|
|
-mv $(TARGET_DIR)/usr/share/snmp/mib2c*.conf $(TARGET_DIR)/etc/snmp
|
|
|
|
# Remove the unsupported snmpcheck program
|
2008-11-04 12:26:52 +01:00
|
|
|
rm -f $(TARGET_DIR)/usr/bin/snmpcheck
|
2003-06-04 23:01:33 +02:00
|
|
|
# Install the "broken" headers
|
2008-11-04 12:26:52 +01:00
|
|
|
$(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
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2004-10-14 11:39:25 +02:00
|
|
|
netsnmp: openssl $(TARGET_DIR)/usr/sbin/snmpd
|
2003-06-04 22:45:47 +02:00
|
|
|
|
|
|
|
netsnmp-headers: $(TARGET_DIR)/usr/include/net-snmp/net-snmp-config.h
|
2008-11-04 12:26:52 +01:00
|
|
|
$(INSTALL) -d $(TARGET_DIR)/usr/include/net-snmp
|
2007-06-25 17:07:25 +02:00
|
|
|
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
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2003-11-12 10:31:12 +01:00
|
|
|
netsnmp-source: $(DL_DIR)/$(NETSNMP_SOURCE)
|
|
|
|
|
2007-08-22 14:35:41 +02:00
|
|
|
netsnmp-clean:
|
2008-03-27 16:42:42 +01:00
|
|
|
-$(MAKE) PREFIX=$(TARGET_DIR) INSTALL_PREFIX=$(TARGET_DIR) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(NETSNMP_DIR) uninstall
|
|
|
|
-$(MAKE) -C $(NETSNMP_DIR) clean
|
|
|
|
-rm -rf $(TARGET_DIR)/etc/snmp/{snmpd{,trapd},mib2c*}.conf \
|
2006-12-20 18:46:00 +01:00
|
|
|
$(TARGET_DIR)/etc/default/snmpd \
|
|
|
|
$(TARGET_DIR)/usr/include/net-snmp
|
2003-06-04 22:45:47 +02:00
|
|
|
|
2007-08-22 14:35:41 +02:00
|
|
|
netsnmp-dirclean:
|
2003-06-04 22:45:47 +02:00
|
|
|
rm -rf $(NETSNMP_DIR)
|
|
|
|
|
2005-02-10 04:06:39 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-11-04 12:26:52 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_NETSNMP),y)
|
2005-02-10 04:06:39 +01:00
|
|
|
TARGETS+=netsnmp
|
|
|
|
endif
|