summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-12-08 03:37:04 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-12-08 03:37:04 (EST)
commita876b3c60cbe611cb9d8742d5f842923e435f9ae (patch)
tree3bd36781ef57a99224b7615872e3f57d3833fe18
parenta5c62f5fed9ea180b2bea9cee7660e93a8d94144 (diff)
build: Work around our own broken GCC
-rwxr-xr-xbuild11
1 files changed, 11 insertions, 0 deletions
diff --git a/build b/build
index f14ee96..640b96d 100755
--- a/build
+++ b/build
@@ -4,6 +4,13 @@ include ../source.mk
KBUILD_ARCH = $$(oh-architecture "$${OPK_HOST_ARCH}")
+# ProteanOS's GCC is currently broken: "-print-file-name=include" simply prints
+# "include".
+nsif_shell = $$(shell $$(CC) -print-file-name=include)
+nsif_gcc_v = $$($(CC) -v 2>&1 | sed -n '$$s/^gcc version \([0-9]\)\..*$$/\1/p;')
+nsif_inc = /usr/include/$(OPK_HOST_ARCH)/gcc/$(nsif_gcc_v)
+nsif_sed = 's|^\(NOSTDINC_FLAGS += .*\) $(nsif_shell)$$|\1 '"$(nsif_inc)|;"
+
nop:
@:
@@ -18,6 +25,10 @@ build:
install: build
set -e; \
if [ 'x$(OPK_HOST_PLAT)' != 'xdev' ]; then \
+ if ! [ -e src/Makefile.orig ]; then \
+ mv src/Makefile src/Makefile.orig; \
+ sed $(nsif_sed) src/Makefile.orig 1>src/Makefile; \
+ fi; \
read img_src img_dest <image; \
install -D "src/arch/$(KBUILD_ARCH)/boot/$${img_src}" \
linux-image.data/boot/$${img_dest}; \