You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

254 lines
6.0 KiB

net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
  1. #
  2. # Copyright (C) 2006-2017 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=net-snmp
  9. PKG_VERSION:=5.7.3
  10. PKG_RELEASE:=6
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@SF/net-snmp
  13. PKG_MD5SUM:=d4a3459e1577d0efa8d96ca70a885e53
  14. PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
  15. PKG_LICENSE:=MIT BSD-3-Clause-Clear
  16. PKG_FIXUP:=autoreconf
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/net-snmp/Default
  19. SECTION:=net
  20. CATEGORY:=Network
  21. URL:=http://www.net-snmp.org/
  22. endef
  23. define Package/net-snmp/Default/description
  24. Simple Network Management Protocol (SNMP) is a widely used protocol for
  25. monitoring the health and welfare of network equipment (eg. routers),
  26. computer equipment and even devices like UPSs. Net-SNMP is a suite of
  27. applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both
  28. IPv4 and IPv6.
  29. endef
  30. define Package/libnetsnmp
  31. $(call Package/net-snmp/Default)
  32. SECTION:=libs
  33. CATEGORY:=Libraries
  34. DEPENDS:=+libnl-tiny
  35. TITLE:=Open source SNMP implementation (libraries)
  36. endef
  37. define Package/libnetsnmp/description
  38. $(call Package/net-snmp/Default/description)
  39. .
  40. This package contains shared libraries, needed by other programs.
  41. endef
  42. define Package/snmp-mibs
  43. $(call Package/net-snmp/Default)
  44. TITLE:=Open source SNMP implementation (MIB-files)
  45. endef
  46. define Package/snmp-mibs/description
  47. $(call Package/net-snmp/Default/description)
  48. .
  49. This package contains SNMP MIB-Files.
  50. endef
  51. define Package/snmp-utils
  52. $(call Package/net-snmp/Default)
  53. DEPENDS:=+libnetsnmp
  54. TITLE:=Open source SNMP implementation (utilities)
  55. endef
  56. define Package/snmp-utils/description
  57. $(call Package/net-snmp/Default/description)
  58. .
  59. This package contains SNMP client utilities.
  60. endef
  61. define Package/snmpd
  62. $(call Package/net-snmp/Default)
  63. DEPENDS:=+libnetsnmp
  64. TITLE:=Open source SNMP implementation (daemon)
  65. endef
  66. define Package/snmpd/description
  67. $(call Package/net-snmp/Default/description)
  68. .
  69. This package contains the SNMP agent, dynamically linked.
  70. endef
  71. define Package/snmpd-static
  72. $(call Package/net-snmp/Default)
  73. DEPENDS:=+snmpd
  74. TITLE:=Open source SNMP implementation (daemon)
  75. endef
  76. SNMP_MIB_MODULES_INCLUDED = \
  77. agent/extend \
  78. agentx \
  79. host/hr_device \
  80. host/hr_disk \
  81. host/hr_filesys \
  82. host/hr_network \
  83. host/hr_partition \
  84. host/hr_proc \
  85. host/hr_storage \
  86. host/hr_system \
  87. ieee802dot11 \
  88. if-mib/ifXTable \
  89. mibII/at \
  90. mibII/icmp \
  91. mibII/ifTable \
  92. mibII/ip \
  93. mibII/snmp_mib \
  94. mibII/sysORTable \
  95. mibII/system_mib \
  96. mibII/tcp \
  97. mibII/udp \
  98. mibII/vacm_context \
  99. mibII/vacm_vars \
  100. snmpv3/snmpEngine \
  101. snmpv3/snmpMPDStats \
  102. snmpv3/usmConf \
  103. snmpv3/usmStats \
  104. snmpv3/usmUser \
  105. tunnel \
  106. ucd-snmp/disk \
  107. ucd-snmp/dlmod \
  108. ucd-snmp/extensible \
  109. ucd-snmp/loadave \
  110. ucd-snmp/memory \
  111. ucd-snmp/pass \
  112. ucd-snmp/pass_persist \
  113. ucd-snmp/proc \
  114. ucd-snmp/vmstat \
  115. util_funcs \
  116. utilities/execute \
  117. SNMP_MIB_MODULES_EXCLUDED = \
  118. agent_mibs \
  119. disman/event \
  120. disman/schedule \
  121. hardware \
  122. host \
  123. if-mib \
  124. mibII \
  125. notification \
  126. notification-log-mib \
  127. snmpv3mibs \
  128. target \
  129. tcp-mib \
  130. ucd_snmp \
  131. udp-mib \
  132. utilities \
  133. SNMP_TRANSPORTS_INCLUDED = Callback UDP Unix
  134. SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6
  135. TARGET_CFLAGS += $(FPIC)
  136. TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
  137. CONFIGURE_ARGS += \
  138. --enable-mfd-rewrites \
  139. --enable-shared \
  140. --enable-static \
  141. --with-endianness=$(if $(CONFIG_BIG_ENDIAN),big,little) \
  142. --with-logfile=/var/log/snmpd.log \
  143. --with-persistent-directory=/usr/lib/snmp/ \
  144. --with-default-snmp-version=1 \
  145. --with-sys-contact=root@localhost \
  146. --with-sys-location=Unknown \
  147. --enable-applications \
  148. --disable-debugging \
  149. --disable-manuals \
  150. --disable-scripts \
  151. --with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \
  152. --with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \
  153. --with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \
  154. --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
  155. --without-openssl \
  156. --without-libwrap \
  157. --without-rpm \
  158. --without-zlib \
  159. --with-nl \
  160. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  161. CONFIGURE_VARS += \
  162. ac_cv_header_netlink_netlink_h=yes \
  163. netsnmp_cv_func_nl_connect_LIBS=-lnl-tiny \
  164. ifeq ($(CONFIG_IPV6),y)
  165. SNMP_TRANSPORTS_INCLUDED+= UDPIPv6
  166. endif
  167. TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib
  168. define Build/Compile
  169. $(MAKE) -C $(PKG_BUILD_DIR) \
  170. INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
  171. LDFLAGS="$(TARGET_LDFLAGS) -lm -lc" \
  172. all install
  173. endef
  174. define Build/InstallDev
  175. $(INSTALL_DIR) $(2)/bin
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/
  177. $(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config
  178. $(LN) $(STAGING_DIR)/host/bin/net-snmp-config $(STAGING_DIR)/usr/bin/
  179. $(INSTALL_DIR) $(1)/usr/include
  180. $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/
  181. $(INSTALL_DIR) $(1)/usr/lib
  182. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(1)/usr/lib/
  183. endef
  184. define Package/libnetsnmp/install
  185. $(INSTALL_DIR) $(1)/usr/lib
  186. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/
  187. endef
  188. define Package/snmp-mibs/install
  189. $(INSTALL_DIR) $(1)/usr/share/snmp/mibs
  190. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/* $(1)/usr/share/snmp/mibs/
  191. endef
  192. define Package/snmp-utils/install
  193. $(INSTALL_DIR) $(1)/usr/bin
  194. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
  195. endef
  196. define Package/snmpd/conffiles
  197. /etc/config/snmpd
  198. endef
  199. define Package/snmpd/install
  200. $(INSTALL_DIR) $(1)/etc/config
  201. $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
  202. $(INSTALL_DIR) $(1)/etc/snmp
  203. ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
  204. $(INSTALL_DIR) $(1)/etc/init.d
  205. $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
  206. $(INSTALL_DIR) $(1)/usr/sbin
  207. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
  208. endef
  209. $(eval $(call BuildPackage,libnetsnmp))
  210. $(eval $(call BuildPackage,snmp-mibs))
  211. $(eval $(call BuildPackage,snmp-utils))
  212. $(eval $(call BuildPackage,snmpd))
  213. $(eval $(call BuildPackage,snmpd-static))