net-snmp: fix musl compatibility
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 26 Jun 2015 15:46:10 +0000 (17:46 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 26 Jun 2015 15:47:33 +0000 (17:47 +0200)
Fixup `iwlib.h` to not consider an musl environment to be an unsupported
platform.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
net/net-snmp/Makefile
net/net-snmp/patches/900-musl-compat.patch [new file with mode: 0644]

index 5736e0d7d4cc7b87954234b56c47378902ec2c7f..38d038035fd58567c6ee3eae2c5cbe85e7856e13 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=net-snmp
 PKG_VERSION:=5.4.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/net-snmp
diff --git a/net/net-snmp/patches/900-musl-compat.patch b/net/net-snmp/patches/900-musl-compat.patch
new file mode 100644 (file)
index 0000000..fa9a01e
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/agent/mibgroup/iwlib.h
++++ b/agent/mibgroup/iwlib.h
+@@ -85,6 +85,11 @@
+       && LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
+ #define LIBC5_HEADERS
++/* Musl */
++#elif !defined(__GLIBC__) && !defined(__UCLIBC__) \
++      && LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
++#define GENERIC_HEADERS
++
+ /* Unsupported combination */
+ #else
+ #error "Your kernel/libc combination is not supported"