summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-01-29 13:35:59 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-01-29 13:35:59 +0000
commitc028a4bdc353dfa6700524e8d161e3a334369af1 (patch)
tree665d0bb8c4b60c2cc654aa716d5634357b78bf1d
parentf0fef89ba83ee80a2ec34132985de3a0d16ae2f8 (diff)
downloadlh-bootstrap-c028a4bdc353dfa6700524e8d161e3a334369af1.tar.xz
Add fake-pkg-config, because !@#$%^ kernel hardcoding
-rwxr-xr-xbin/fake-pkg-config19
-rw-r--r--sub/kernel/Makefile8
2 files changed, 23 insertions, 4 deletions
diff --git a/bin/fake-pkg-config b/bin/fake-pkg-config
new file mode 100755
index 0000000..780407b
--- /dev/null
+++ b/bin/fake-pkg-config
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+exists () {
+ test -d "${OUTPUT}/build-build/opt/ncurses/include/$1"
+}
+
+cflags () {
+ echo "-I${OUTPUT}/build-build/opt/ncurses/include -DKBUILD_NO_NLS -DCURSES_LOC=\"<${1}/ncurses.h>\""
+}
+
+libs () {
+ echo "-static -L${OUTPUT}/build-build/opt/ncurses/lib -l$1"
+}
+
+case "$1" in
+ --exists) exists "$2" ;;
+ --cflags) cflags "$2" ;;
+ --libs) libs "$2" ;;
+esac
diff --git a/sub/kernel/Makefile b/sub/kernel/Makefile
index 4c4915d..6c92ffb 100644
--- a/sub/kernel/Makefile
+++ b/sub/kernel/Makefile
@@ -32,10 +32,10 @@ $(OUTPUT)/build-host/kernel/.lh_configured: $(OUTPUT)/build-host/kernel/.lh_unpa
exec setuidgid $(NORMALUSER) cd $(OUTPUT)/build-host/kernel/linux-$(KERNEL_VERSION) $(MAKE) olddefconfig $(KERNEL_ENV)
exec setuidgid $(NORMALUSER) s6-touch $@
-kernel-menuconfig: $(OUTPUT)/build-host/kernel/.lh_configured $(OUTPUT)/build-build/.lh_$(NCURSES_NAME)_installed | $(OUTPUT)/build-build/.lh_skarnet_installed
- exec setuidgid $(NORMALUSER) cd $(OUTPUT)/build-host/kernel/linux-$(KERNEL_VERSION) $(MAKE) menuconfig $(KERNEL_ENV) \
- HOSTCXXFLAGS="-I$(OUTPUT)/build-build/opt/$(NCURSES_NAME)/include -DKBUILD_NO_NLS -DCURSES_LOC=\"<ncurses/ncurses.h>\"" \
- HOSTLDFLAGS="-L$(OUTPUT)/build-build/opt/$(NCURSES_NAME)/ncurses/lib -static"
+kernel-menuconfig: $(OUTPUT)/build-host/kernel/.lh_configured $(OUTPUT)/build-build/.lh_$(NCURSES_NAME)_installed | $(OUTPUT)/build-build/.lh_skarnet_installed $(WD)/bin/fake-pkg-config
+ exec setuidgid $(NORMALUSER) s6-ln -nsf $(WD)/bin/fake-pkg-config $(OUTPUT)/build-build/bin/pkg-config
+ exec setuidgid $(NORMALUSER) cd $(OUTPUT)/build-host/kernel/linux-$(KERNEL_VERSION) $(MAKE) menuconfig $(KERNEL_ENV)
+ exec setuidgid $(NORMALUSER) rm -f $(OUTPUT)/build-build/bin/pkg-config
$(OUTPUT)/build-host/kernel/.lh_prepared: | $(OUTPUT)/tmp/.lh_prepared $(OUTPUT)/build-build/.lh_skarnet_installed
exec s6-mkdir -p $(OUTPUT)/rootfs/opt/linux-kernel-headers-$(KERNEL_VERSION)