commit 506afb042bf4c22f832f0d38e2af69826c9fd022
parent ec74c41fe03c286e42ed76b3fae747e0afd30598
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sun, 18 Aug 2019 22:01:30 +0100
Simplify the HOST configuration
The trick done with env.sh was too clever and
obscure and it needed some additional flags from
the user. This new option is simpler and works
fine for the majority of the systems.
Diffstat:
9 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
@@ -23,7 +23,6 @@ $(ENVIRON):
@rm -f $@; \
trap 'r=$?;rm -f $$$$.tmp;exit $r' EXIT HUP INT QUIT TERM; \
echo PATH=$$PATH:$$PWD/$(SCRIPTDIR):. > $$$$.tmp && \
- echo HOST=`uname | tr 'A-Z' 'a-z'` >> $$$$.tmp && \
echo NM=\"$(NM)\" >> $$$$.tmp && \
echo AR=\"$(AR)\" >> $$$$.tmp && \
echo RL=\"$(RL)\" >> $$$$.tmp && \
diff --git a/README b/README
@@ -2,12 +2,20 @@ Compiling
=========
SCC is a portable toolchain that can be compiled on any UNIX system
-out of the box. It supports three main configuration options that
+out of the box. It supports four main configuration options that
can be passed to the command line:
- CROSS_COMPILE:
Specify a prefix name for the tools called by the Makefile.
+ - HOST:
+ Specify the host system to be used. Possible supported
+ values are:
+
+ - unix (by default)
+ - bsd
+ - plan9
+
- CONF: Specify which version of libc to build.
Once the build process completes only the target specified in
CONF will be built. Supported values are:
diff --git a/config/host/bsd.mk b/config/host/bsd.mk
@@ -1,2 +1,3 @@
-DRIVER = posix
+include $(PROJECTDIR)/config/host/unix.mk
+
HOSTCFLAGS = -D_ISOC99_SOURCE -D_ANSI_SOURCE
diff --git a/config/host/darwin.mk b/config/host/darwin.mk
@@ -1 +0,0 @@
-include $(PROJECTDIR)/config/host/bsd.mk
diff --git a/config/host/dragonfly.mk b/config/host/dragonfly.mk
@@ -1 +0,0 @@
-include $(PROJECTDIR)/config/host/bsd.mk
diff --git a/config/host/linux.mk b/config/host/linux.mk
@@ -1 +0,0 @@
-DRIVER = posix
diff --git a/config/host/netbsd.mk b/config/host/netbsd.mk
@@ -1 +0,0 @@
-include $(PROJECTDIR)/config/host/bsd.mk
diff --git a/config/host/openbsd.mk b/config/host/openbsd.mk
@@ -1 +0,0 @@
-include $(PROJECTDIR)/config/host/bsd.mk
diff --git a/config/host/plan9.mk b/config/host/plan9.mk
@@ -0,0 +1,3 @@
+include $(PROJECTDIR)/config/host/unix.mk
+
+HOSTCFLAGS = -D_SUSV2_SOURCE