shithub: scc

Download patch

ref: 506afb042bf4c22f832f0d38e2af69826c9fd022
parent: ec74c41fe03c286e42ed76b3fae747e0afd30598
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Aug 18 18:01:30 EDT 2019

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.

--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,6 @@
 	@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 && \
--- a/README
+++ b/README
@@ -2,11 +2,19 @@
 =========
 
 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
--- 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
--- a/config/host/darwin.mk
+++ /dev/null
@@ -1,1 +1,0 @@
-include $(PROJECTDIR)/config/host/bsd.mk
--- a/config/host/dragonfly.mk
+++ /dev/null
@@ -1,1 +1,0 @@
-include $(PROJECTDIR)/config/host/bsd.mk
--- a/config/host/linux.mk
+++ /dev/null
@@ -1,1 +1,0 @@
-DRIVER = posix
--- a/config/host/netbsd.mk
+++ /dev/null
@@ -1,1 +1,0 @@
-include $(PROJECTDIR)/config/host/bsd.mk
--- a/config/host/openbsd.mk
+++ /dev/null
@@ -1,1 +1,0 @@
-include $(PROJECTDIR)/config/host/bsd.mk
--- /dev/null
+++ b/config/host/plan9.mk
@@ -1,0 +1,3 @@
+include $(PROJECTDIR)/config/host/unix.mk
+
+HOSTCFLAGS = -D_SUSV2_SOURCE