summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-07-11 01:30:13 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-07-11 01:30:13 (EDT)
commit75d9846e256941b05b6d1330610fe9862a4ee9e0 (patch)
tree166bf5ecdd995d07e34398e78c2592e1a0836ff1
parentcd6340af70d74ac8c5d0af6ad6f8ca25666272d1 (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 81b956f..5f604a0 100755
--- a/build
+++ b/build
@@ -5,6 +5,13 @@ include ../source.mk
V = 1
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:
@:
@@ -16,6 +23,10 @@ build:
if [ 'x$(OPK_HOST_PLAT)' != 'xdev' ]; then \
printf '%s\n' '$(OPK_SOURCE_VERSION)' | sed 's/^.*-/-/;' \
1>src/localversion; \
+ 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; \
oh-autobuild -T "$${img_src}" -- -j "$${JOBS:-1}" V=$(V); \
fi