]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/netsnmp/netsnmp.mk
Rename BR2_PREFER_STATIC_LIB to BR2_STATIC_LIBS
[coffee/buildroot.git] / package / netsnmp / netsnmp.mk
1 ################################################################################
2 #
3 # netsnmp
4 #
5 ################################################################################
6
7 NETSNMP_VERSION = 5.7.3
8 NETSNMP_SITE = http://downloads.sourceforge.net/project/net-snmp/net-snmp/$(NETSNMP_VERSION)
9 NETSNMP_SOURCE = net-snmp-$(NETSNMP_VERSION).tar.gz
10 NETSNMP_LICENSE = Various BSD-like
11 NETSNMP_LICENSE_FILES = COPYING
12 NETSNMP_INSTALL_STAGING = YES
13 NETSNMP_CONF_ENV = ac_cv_NETSNMP_CAN_USE_SYSCTL=yes
14 NETSNMP_CONF_OPTS = --with-persistent-directory=/var/lib/snmp \
15                 --with-defaults --enable-mini-agent --without-rpm \
16                 --with-logfile=none --without-kmem-usage $(DISABLE_IPV6) \
17                 --enable-as-needed --without-perl-modules \
18                 --disable-embedded-perl --disable-perl-cc-checks \
19                 --disable-scripts --with-default-snmp-version="1" \
20                 --enable-silent-libtool --enable-mfd-rewrites \
21                 --with-sys-contact="root@localhost" \
22                 --with-sys-location="Unknown" \
23                 --with-mib-modules="$(call qstrip,$(BR2_PACKAGE_NETSNMP_WITH_MIB_MODULES))" \
24                 --with-out-mib-modules="$(call qstrip,$(BR2_PACKAGE_NETSNMP_WITHOUT_MIB_MODULES))" \
25                 --with-out-transports="Unix" \
26                 --disable-manuals
27 NETSNMP_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) LIB_LDCONFIG_CMD=true install
28 NETSNMP_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) LIB_LDCONFIG_CMD=true install
29 NETSNMP_MAKE = $(MAKE1)
30 NETSNMP_CONFIG_SCRIPTS = net-snmp-config
31
32 NETSNMP_BLOAT_MIBS = BRIDGE DISMAN-EVENT DISMAN-SCHEDULE DISMAN-SCRIPT EtherLike RFC-1215 RFC1155-SMI RFC1213 SCTP SMUX
33
34 ifeq ($(BR2_ENDIAN),"BIG")
35         NETSNMP_CONF_OPTS += --with-endianness=big
36 else
37         NETSNMP_CONF_OPTS += --with-endianness=little
38 endif
39
40 # OpenSSL
41 ifeq ($(BR2_PACKAGE_OPENSSL),y)
42         NETSNMP_DEPENDENCIES += openssl
43         NETSNMP_CONF_OPTS += \
44                 --with-openssl=$(STAGING_DIR)/usr/include/openssl
45 ifeq ($(BR2_STATIC_LIBS),y)
46         # openssl uses zlib, so we need to explicitly link with it when static
47         NETSNMP_CONF_ENV += LIBS=-lz
48 endif
49 else
50         NETSNMP_CONF_OPTS += --without-openssl
51 endif
52
53 ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_MIBS),y)
54         NETSNMP_CONF_OPTS += --disable-mib-loading
55         NETSNMP_CONF_OPTS += --disable-mibs
56 endif
57
58 ifneq ($(BR2_PACKAGE_NETSNMP_ENABLE_DEBUGGING),y)
59         NETSNMP_CONF_OPTS += --disable-debugging
60 endif
61
62 # Remove IPv6 MIBs if there's no IPv6
63 ifneq ($(BR2_INET_IPV6),y)
64 define NETSNMP_REMOVE_MIBS_IPV6
65         rm -f $(TARGET_DIR)/usr/share/snmp/mibs/IPV6*
66 endef
67
68 NETSNMP_POST_INSTALL_TARGET_HOOKS += NETSNMP_REMOVE_MIBS_IPV6
69 endif
70
71 define NETSNMP_REMOVE_BLOAT_MIBS
72         for mib in $(NETSNMP_BLOAT_MIBS); do \
73                 rm -f $(TARGET_DIR)/usr/share/snmp/mibs/$$mib-MIB.txt; \
74         done
75 endef
76
77 NETSNMP_POST_INSTALL_TARGET_HOOKS += NETSNMP_REMOVE_BLOAT_MIBS
78
79 define NETSNMP_INSTALL_INIT_SYSV
80         $(INSTALL) -D -m 0755 package/netsnmp/S59snmpd \
81                 $(TARGET_DIR)/etc/init.d/S59snmpd
82 endef
83
84 define NETSNMP_STAGING_NETSNMP_CONFIG_FIXUP
85         $(SED)  "s,^includedir=.*,includedir=\'$(STAGING_DIR)/usr/include\',g" \
86                 -e "s,^libdir=.*,libdir=\'$(STAGING_DIR)/usr/lib\',g" \
87                 $(STAGING_DIR)/usr/bin/net-snmp-config
88 endef
89
90 NETSNMP_POST_INSTALL_STAGING_HOOKS += NETSNMP_STAGING_NETSNMP_CONFIG_FIXUP
91
92 $(eval $(autotools-package))