aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kunze <richard.kunze@web.de>2014-11-16 01:56:12 +0100
committerRichard Kunze <richard.kunze@web.de>2014-11-16 01:56:12 +0100
commitfeb67e6b07274f3efe1b17d724fd9a12a323c818 (patch)
tree3979d9182f868a8db4450b97d256b879940afba0
parent18d534ba40497390650cb89c4721c2be0dd74ba1 (diff)
hdparm: fix compilation with musl
Signed-off-by: Richard Kunze <richard.kunze@web.de>
-rw-r--r--utils/hdparm/Makefile2
-rw-r--r--utils/hdparm/patches/001-fix-includes.patch20
2 files changed, 22 insertions, 0 deletions
diff --git a/utils/hdparm/Makefile b/utils/hdparm/Makefile
index 8fb7fae3c..a2988f42e 100644
--- a/utils/hdparm/Makefile
+++ b/utils/hdparm/Makefile
@@ -19,6 +19,8 @@ PKG_LICENSE:=BSD-Style Open Source License
include $(INCLUDE_DIR)/package.mk
+TARGET_CFLAGS+=-D_GNU_SOURCE
+
define Package/hdparm
SECTION:=utils
CATEGORY:=Utilities
diff --git a/utils/hdparm/patches/001-fix-includes.patch b/utils/hdparm/patches/001-fix-includes.patch
new file mode 100644
index 000000000..44343fb39
--- /dev/null
+++ b/utils/hdparm/patches/001-fix-includes.patch
@@ -0,0 +1,20 @@
+--- a/hdparm.h
++++ b/hdparm.h
+@@ -2,6 +2,7 @@
+
+ //#undef __KERNEL_STRICT_NAMES
+ #include <linux/types.h>
++#include <sys/types.h>
+
+ #if !defined(__GNUC__) && !defined(__attribute__)
+ #define __attribute__(x)
+--- a/sysfs.c
++++ b/sysfs.c
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <limits.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <linux/types.h>