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.

252 lines
5.9 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:=3
  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. agentx \
  78. host/hr_device \
  79. host/hr_disk \
  80. host/hr_filesys \
  81. host/hr_network \
  82. host/hr_partition \
  83. host/hr_proc \
  84. host/hr_storage \
  85. host/hr_system \
  86. ieee802dot11 \
  87. if-mib/ifXTable \
  88. mibII/at \
  89. mibII/icmp \
  90. mibII/ifTable \
  91. mibII/ip \
  92. mibII/snmp_mib \
  93. mibII/sysORTable \
  94. mibII/system_mib \
  95. mibII/tcp \
  96. mibII/udp \
  97. mibII/vacm_context \
  98. mibII/vacm_vars \
  99. snmpv3/snmpEngine \
  100. snmpv3/snmpMPDStats \
  101. snmpv3/usmConf \
  102. snmpv3/usmStats \
  103. snmpv3/usmUser \
  104. tunnel \
  105. ucd-snmp/disk \
  106. ucd-snmp/dlmod \
  107. ucd-snmp/extensible \
  108. ucd-snmp/loadave \
  109. ucd-snmp/memory \
  110. ucd-snmp/pass \
  111. ucd-snmp/pass_persist \
  112. ucd-snmp/proc \
  113. ucd-snmp/vmstat \
  114. util_funcs \
  115. utilities/execute \
  116. SNMP_MIB_MODULES_EXCLUDED = \
  117. agent_mibs \
  118. disman/event \
  119. disman/schedule \
  120. hardware \
  121. host \
  122. if-mib \
  123. mibII \
  124. notification \
  125. notification-log-mib \
  126. snmpv3mibs \
  127. target \
  128. tcp-mib \
  129. ucd_snmp \
  130. udp-mib \
  131. utilities \
  132. SNMP_TRANSPORTS_INCLUDED = Callback UDP Unix
  133. SNMP_TRANSPORTS_EXCLUDED = TCP TCPIPv6
  134. TARGET_CFLAGS += $(FPIC)
  135. TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
  136. CONFIGURE_ARGS += \
  137. --enable-mfd-rewrites \
  138. --enable-shared \
  139. --enable-static \
  140. --with-endianness=$(if $(CONFIG_BIG_ENDIAN),big,little) \
  141. --with-logfile=/var/log/snmpd.log \
  142. --with-persistent-directory=/usr/lib/snmp/ \
  143. --with-default-snmp-version=1 \
  144. --with-sys-contact=root@localhost \
  145. --with-sys-location=Unknown \
  146. --enable-applications \
  147. --disable-debugging \
  148. --disable-manuals \
  149. --disable-scripts \
  150. --with-out-mib-modules="$(SNMP_MIB_MODULES_EXCLUDED)" \
  151. --with-mib-modules="$(SNMP_MIB_MODULES_INCLUDED)" \
  152. --with-out-transports="$(SNMP_TRANSPORTS_EXCLUDED)" \
  153. --with-transports="$(SNMP_TRANSPORTS_INCLUDED)" \
  154. --without-openssl \
  155. --without-libwrap \
  156. --without-rpm \
  157. --without-zlib \
  158. --with-nl \
  159. $(call autoconf_bool,CONFIG_IPV6,ipv6) \
  160. CONFIGURE_VARS += \
  161. ac_cv_header_netlink_netlink_h=yes \
  162. netsnmp_cv_func_nl_connect_LIBS=-lnl-tiny \
  163. ifeq ($(CONFIG_IPV6),y)
  164. SNMP_TRANSPORTS_INCLUDED+= UDPIPv6
  165. endif
  166. TARGET_LDFLAGS += -L$(TOOLCHAIN_DIR)/usr/lib
  167. define Build/Compile
  168. $(MAKE) -C $(PKG_BUILD_DIR) \
  169. INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
  170. LDFLAGS="$(TARGET_LDFLAGS) -lm -lc" \
  171. all install
  172. endef
  173. define Build/InstallDev
  174. $(INSTALL_DIR) $(2)/bin
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/net-snmp-config $(2)/bin/
  176. $(SED) 's,=/usr,=$(STAGING_DIR)/usr,g' $(2)/bin/net-snmp-config
  177. $(INSTALL_DIR) $(1)/usr/include
  178. $(CP) $(PKG_INSTALL_DIR)/usr/include/net-snmp $(1)/usr/include/
  179. $(INSTALL_DIR) $(1)/usr/lib
  180. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.{a,so*} $(1)/usr/lib/
  181. endef
  182. define Package/libnetsnmp/install
  183. $(INSTALL_DIR) $(1)/usr/lib
  184. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetsnmp{,agent,helpers,mibs}.so.* $(1)/usr/lib/
  185. endef
  186. define Package/snmp-mibs/install
  187. $(INSTALL_DIR) $(1)/usr/share/snmp/mibs
  188. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/* $(1)/usr/share/snmp/mibs/
  189. endef
  190. define Package/snmp-utils/install
  191. $(INSTALL_DIR) $(1)/usr/bin
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/snmp{get,set,status,test,trap,walk} $(1)/usr/bin/
  193. endef
  194. define Package/snmpd/conffiles
  195. /etc/config/snmpd
  196. endef
  197. define Package/snmpd/install
  198. $(INSTALL_DIR) $(1)/etc/config
  199. $(INSTALL_DATA) ./files/snmpd.conf $(1)/etc/config/snmpd
  200. $(INSTALL_DIR) $(1)/etc/snmp
  201. ln -sf /var/run/snmpd.conf $(1)/etc/snmp/
  202. $(INSTALL_DIR) $(1)/etc/init.d
  203. $(INSTALL_BIN) ./files/snmpd.init $(1)/etc/init.d/snmpd
  204. $(INSTALL_DIR) $(1)/usr/sbin
  205. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/snmpd $(1)/usr/sbin/snmpd
  206. endef
  207. $(eval $(call BuildPackage,libnetsnmp))
  208. $(eval $(call BuildPackage,snmp-mibs))
  209. $(eval $(call BuildPackage,snmp-utils))
  210. $(eval $(call BuildPackage,snmpd))
  211. $(eval $(call BuildPackage,snmpd-static))