summaryrefslogtreecommitdiffstats
path: root/package/busybox/1.20.2/busybox-1.20.2-pkg-config-selinux.patch
diff options
context:
space:
mode:
authorGustavo Zacarias <gustavo@zacarias.com.ar>2013-04-22 11:47:46 -0300
committerPeter Korsgaard <jacmet@sunsite.dk>2013-04-23 08:59:23 +0200
commit246d12b5b49c045b6c74ea18ebb53778692a7e3f (patch)
tree1280dd845a4db7ef5399162297e325139d996a79 /package/busybox/1.20.2/busybox-1.20.2-pkg-config-selinux.patch
parentbd528977f1dbe232bd1ca2a0bd9a37f9172d579a (diff)
downloadbuildroot-novena-246d12b5b49c045b6c74ea18ebb53778692a7e3f.tar.gz
buildroot-novena-246d12b5b49c045b6c74ea18ebb53778692a7e3f.zip
busybox: move patches to new model
On commit 5538e4766201aa0c1c23721cfc99cbbde595964b the versioned package patches changed the directory structure but the packages weren't fixed. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/busybox/1.20.2/busybox-1.20.2-pkg-config-selinux.patch')
-rw-r--r--package/busybox/1.20.2/busybox-1.20.2-pkg-config-selinux.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/package/busybox/1.20.2/busybox-1.20.2-pkg-config-selinux.patch b/package/busybox/1.20.2/busybox-1.20.2-pkg-config-selinux.patch
new file mode 100644
index 000000000..f39250c85
--- /dev/null
+++ b/package/busybox/1.20.2/busybox-1.20.2-pkg-config-selinux.patch
@@ -0,0 +1,67 @@
+From b1cec5003b73080a8aa7ea277621bf1c71c3e8d6 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 20 Oct 2012 15:01:26 -0400
+Subject: [PATCH] build system: use pkg-config to look up selinux libs
+
+Newer versions of libselinux has started linking against more libs.
+Rather than continuing hardcoding things, switch to using pkg-config
+to query for its dependencies.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 1 +
+ Makefile.flags | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index fccde4a..3a0a5e1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -297,6 +297,7 @@ NM = $(CROSS_COMPILE)nm
+ STRIP = $(CROSS_COMPILE)strip
+ OBJCOPY = $(CROSS_COMPILE)objcopy
+ OBJDUMP = $(CROSS_COMPILE)objdump
++PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
+ AWK = awk
+ GENKSYMS = scripts/genksyms/genksyms
+ DEPMOD = /sbin/depmod
+diff --git a/Makefile.flags b/Makefile.flags
+index c43c8dc..15dcc1f 100644
+--- a/Makefile.flags
++++ b/Makefile.flags
+@@ -74,6 +74,12 @@ ARCH_FPIC ?= -fpic
+ ARCH_FPIE ?= -fpie
+ ARCH_PIE ?= -pie
+
++# Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES))
++define pkg_check_modules
++$(1)_CFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags $(2))
++$(1)_LIBS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs $(2))
++endef
++
+ ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
+ # on i386: 14% smaller libbusybox.so
+ # (code itself is 9% bigger, we save on relocs/PLT/GOT)
+@@ -85,6 +91,7 @@ endif
+
+ ifeq ($(CONFIG_STATIC),y)
+ CFLAGS_busybox += -static
++PKG_CONFIG_FLAGS += --static
+ endif
+
+ ifeq ($(CONFIG_PIE),y)
+@@ -127,7 +134,10 @@ LDLIBS += pam pam_misc pthread
+ endif
+
+ ifeq ($(CONFIG_SELINUX),y)
+-LDLIBS += selinux sepol
++SELINUX_PC_MODULES = libselinux libsepol
++$(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES)))
++CPPFLAGS += $(SELINUX_CFLAGS)
++LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%))
+ endif
+
+ ifeq ($(CONFIG_EFENCE),y)
+--
+1.7.12
+