scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 438fb6e08b28ac019fb017c5caf1967ef51d0e1f
parent 7541da3df27d27b30d7639c25dfbd0c192ddbd91
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon,  7 Oct 2024 12:00:59 +0200

build: Fix OpenBSD build

OpenBSD lacks c99 compiler, and while it was handled correctly
in the target build, it was not handled correctly from the point
of view the host compiler and in the qbe build.

Diffstat:
Ascripts/build/host/obsd.mk | 4++++
Mscripts/config | 2+-
Msrc/cmd/Makefile | 4++--
3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/build/host/obsd.mk b/scripts/build/host/obsd.mk @@ -0,0 +1,4 @@ +DRIVER = posix + +HOST_CPPFLAGS = -D_ISOC99_SOURCE -D_ANSI_SOURCE +HOSTCC = clang diff --git a/scripts/config b/scripts/config @@ -2,7 +2,7 @@ case `uname` in OpenBSD) - echo TOOL=${TOOL:-clang} HOST=bsd ARFLAGS="${ARFLAGS:--rv}" NOPIE_LDFLAGS=-no-pie + echo TOOL=${TOOL:-clang} HOST=obsd ARFLAGS="${ARFLAGS:--rv}" NOPIE_LDFLAGS=-no-pie ;; NetBSD) #TODO: send a patch to NetBSD to solve this problem diff --git a/src/cmd/Makefile b/src/cmd/Makefile @@ -1,7 +1,6 @@ .POSIX: DIRS =\ - qbe\ ld\ as\ cc\ @@ -27,7 +26,8 @@ qbe/.git: git submodule init qbe git submodule update qbe -qbe: qbe/.git +qbe: qbe/.git FORCE + +cd qbe && $(MAKE) CC=$(CC) CFLAGS='$(PROJ_CFLAGS)' qbe/qbe: qbe