add a patch to use cppflags when compiling and ldflags when linking,
[openwrt.git] / package / net-snmp / Makefile
index ba88748..25a1cc6 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=net-snmp
 PKG_VERSION:=5.1.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2.1
 PKG_MD5SUM:=8080555ab3f90011f25d5122042d9a8d
 
 PKG_SOURCE_URL:=@SF/net-snmp
@@ -23,7 +23,6 @@ SNMP_MIB_MODULES_INCLUDED = \
        host/hr_proc \
        host/hr_storage \
        host/hr_system \
-       ieee802dot11 \
        mibII/at \
        mibII/icmp \
        mibII/interfaces \
@@ -42,6 +41,7 @@ SNMP_MIB_MODULES_INCLUDED = \
        snmpv3mibs \
        tunnel \
        ucd-snmp/disk \
+       ucd-snmp/dlmod \
        ucd-snmp/extensible \
        ucd-snmp/loadave \
        ucd-snmp/memory \
@@ -55,6 +55,7 @@ SNMP_MIB_MODULES_EXCLUDED = \
        agent_mibs \
        agentx \
        host \
+       ieee802dot11 \
        mibII \
        notification \
        snmpv3mibs \
@@ -62,9 +63,9 @@ SNMP_MIB_MODULES_EXCLUDED = \
        ucd_snmp \
        utilities \
 
-SNMP_TRANSPORTS_INCLUDED = UDP
+SNMP_TRANSPORTS_INCLUDED = Callback UDP
 
-SNMP_TRANSPORTS_EXCLUDED = Callback TCP TCPv6 UDPv6 Unix
+SNMP_TRANSPORTS_EXCLUDED = TCP TCPv6 UDPv6 Unix
 
 PKG_CONFIGURE_OPTIONS = \
        --enable-shared \
@@ -96,36 +97,37 @@ include $(TOPDIR)/package/rules.mk
 
 $(eval $(call PKG_template,LIBNETSNMP,libnetsnmp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 $(eval $(call PKG_template,SNMPD,snmpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,SNMPD_STATIC,snmpd-static,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 $(eval $(call PKG_template,SNMP_UTILS,snmp-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
 
 $(PKG_BUILD_DIR)/.configured:
-       (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
+       ( cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
-               LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
+               CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
                ac_cv_header_pcap_h=no \
                ./configure \
-                 --target=$(GNU_TARGET_NAME) \
-                 --host=$(GNU_TARGET_NAME) \
-                 --build=$(GNU_HOST_NAME) \
-                 --program-prefix="" \
-                 --program-suffix="" \
-                 --prefix=/usr \
-                 --exec-prefix=/usr \
-                 --bindir=/usr/bin \
-                 --datadir=/usr/share \
-                 --includedir=/usr/include \
-                 --infodir=/usr/share/info \
-                 --libdir=/usr/lib \
-                 --libexecdir=/usr/lib \
-                 --localstatedir=/var \
-                 --mandir=/usr/share/man \
-                 --sbindir=/usr/sbin \
-                 --sysconfdir=/etc \
-                 $(DISABLE_LARGEFILE) \
-                 $(DISABLE_NLS) \
-                 $(PKG_CONFIGURE_OPTIONS) \
+                       --target=$(GNU_TARGET_NAME) \
+                       --host=$(GNU_TARGET_NAME) \
+                       --build=$(GNU_HOST_NAME) \
+                       --program-prefix="" \
+                       --program-suffix="" \
+                       --prefix=/usr \
+                       --exec-prefix=/usr \
+                       --bindir=/usr/bin \
+                       --datadir=/usr/share \
+                       --includedir=/usr/include \
+                       --infodir=/usr/share/info \
+                       --libdir=/usr/lib \
+                       --libexecdir=/usr/lib \
+                       --localstatedir=/var \
+                       --mandir=/usr/share/man \
+                       --sbindir=/usr/sbin \
+                       --sysconfdir=/etc \
+                       $(DISABLE_LARGEFILE) \
+                       $(DISABLE_NLS) \
+                       $(PKG_CONFIGURE_OPTIONS) \
        );
        touch $@
 
@@ -135,11 +137,20 @@ $(PKG_BUILD_DIR)/.built:
        $(MAKE) -C $(PKG_BUILD_DIR) \
                INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
                all install
+       ( cd $(PKG_INSTALL_DIR); mv ./usr/sbin/snmpd ./usr/sbin/snmpd-shared; )
+ifneq ($(BR2_PACKAGE_SNMPD_STATIC),)
+       ( cd $(PKG_BUILD_DIR); rm -f agent/snmpd; )
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -static" \
+               INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
+               all install
+       ( cd $(PKG_INSTALL_DIR); mv ./usr/sbin/snmpd ./usr/sbin/snmpd-static; )
+endif
        touch $@
 
 $(IPKG_LIBNETSNMP):
        install -d -m0755 $(IDIR_LIBNETSNMP)/usr/lib
-       cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(IDIR_LIBNETSNMP)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(IDIR_LIBNETSNMP)/usr/lib/
        $(RSTRIP) $(IDIR_LIBNETSNMP)
        $(IPKG_BUILD) $(IDIR_LIBNETSNMP) $(PACKAGE_DIR)
 
@@ -151,23 +162,35 @@ $(IPKG_SNMPD):
        install -d -m0755 $(IDIR_SNMPD)/etc/init.d
        install -m0755 ./files/snmpd.init $(IDIR_SNMPD)/etc/init.d/snmpd
        install -d -m0755 $(IDIR_SNMPD)/usr/sbin
-       cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(IDIR_SNMPD)/usr/sbin/
+       install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/snmpd-shared $(IDIR_SNMPD)/usr/sbin/snmpd
        $(RSTRIP) $(IDIR_SNMPD)
        $(IPKG_BUILD) $(IDIR_SNMPD) $(PACKAGE_DIR)
 
+$(IPKG_SNMPD_STATIC):
+       install -d -m0755 $(IDIR_SNMPD_STATIC)/etc/snmp
+       install -m0644 ./files/snmpd.conf $(IDIR_SNMPD_STATIC)/etc/snmp/snmpd.conf
+       install -d -m0755 $(IDIR_SNMPD_STATIC)/etc/default
+       install -m0644 ./files/snmpd.default $(IDIR_SNMPD_STATIC)/etc/default/snmpd
+       install -d -m0755 $(IDIR_SNMPD_STATIC)/etc/init.d
+       install -m0755 ./files/snmpd.init $(IDIR_SNMPD_STATIC)/etc/init.d/snmpd
+       install -d -m0755 $(IDIR_SNMPD_STATIC)/usr/sbin
+       install -m0755 $(PKG_INSTALL_DIR)/usr/sbin/snmpd-static $(IDIR_SNMPD_STATIC)/usr/sbin/snmpd
+       $(RSTRIP) $(IDIR_SNMPD_STATIC)
+       $(IPKG_BUILD) $(IDIR_SNMPD_STATIC) $(PACKAGE_DIR)
+
 $(IPKG_SNMP_UTILS):
        install -d -m0755 $(IDIR_SNMP_UTILS)/usr/bin
-       cp -fpR $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(IDIR_SNMP_UTILS)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(IDIR_SNMP_UTILS)/usr/bin/
        $(RSTRIP) $(IDIR_SNMP_UTILS)
        $(IPKG_BUILD) $(IDIR_SNMP_UTILS) $(PACKAGE_DIR)
 
 $(STAGING_DIR)/usr/lib/libnetsnmp.so: $(PKG_BUILD_DIR)/.built
        mkdir -p $(STAGING_DIR)/usr/bin
-       cp -fp $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(STAGING_DIR)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(STAGING_DIR)/usr/bin/
        mkdir -p $(STAGING_DIR)/usr/include
-       cp -fpR $(PKG_INSTALL_DIR)/usr/include/net-snmp $(STAGING_DIR)/usr/include/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(STAGING_DIR)/usr/include/
        mkdir -p $(STAGING_DIR)/usr/lib
-       cp -fp $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(STAGING_DIR)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(STAGING_DIR)/usr/lib/
        touch $@
 
 install-dev: $(STAGING_DIR)/usr/lib/libnetsnmp.so
@@ -178,5 +201,5 @@ uninstall-dev:
                $(STAGING_DIR)/usr/include/net-snmp \
                $(STAGING_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} \
 
-compile: install-dev
-clean: uninstall-dev
+compile-targets: install-dev
+clean-targets: uninstall-dev
This page took 0.026067 seconds and 4 git commands to generate.