summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-06-18 17:34:42 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-06-18 17:34:42 -0400
commit1454be927db5d366d3a03cafdb07f4c70d0cc64a (patch)
treeac11b97fd9f01fed108bd38bb55170fc6a453fa2 /build
parentf6775906d136bbeacf3cd45443c080be2dd1f2e9 (diff)
downloadbfs-1454be927db5d366d3a03cafdb07f4c70d0cc64a.tar.xz
configure: Bail out if CC doesn't work at all
Diffstat (limited to 'build')
-rw-r--r--build/header.mk12
1 files changed, 10 insertions, 2 deletions
diff --git a/build/header.mk b/build/header.mk
index 16a25ca..632afb6 100644
--- a/build/header.mk
+++ b/build/header.mk
@@ -61,7 +61,7 @@ gen/config.h: ${PKG_HEADERS} ${HEADERS}
@printf '#define BFS_CONFIG_H\n' >>$@
@cat ${.ALLSRC} >>$@
@printf '#endif // BFS_CONFIG_H\n' >>$@
- @cat ${.ALLSRC:%=%.log} >gen/config.log
+ @cat gen/cc.log ${.ALLSRC:%=%.log} >gen/config.log
${VCAT} $@
@printf '%s' "$$CONFFLAGS" | build/embed.sh >gen/confflags.i
@printf '%s' "$$XCC" | build/embed.sh >gen/cc.i
@@ -74,7 +74,15 @@ gen/config.h: ${PKG_HEADERS} ${HEADERS}
# The short name of the config test
SLUG = ${@:gen/%.h=%}
-${HEADERS}::
+${HEADERS}: cc
@${MKDIR} ${@D}
@build/define-if.sh ${SLUG} build/cc.sh build/${SLUG}.c >$@ 2>$@.log; \
build/msg-if.sh "[ CC ] ${SLUG}.c" test $$? -eq 0
+.PHONY: ${HEADERS}
+
+# Check that the C compiler works at all
+cc::
+ @build/cc.sh build/empty.c 2>gen/cc.log; \
+ ret=$$?; \
+ build/msg-if.sh "[ CC ] build/empty.c" test $$ret -eq 0; \
+ exit $$ret