summaryrefslogtreecommitdiffstats
path: root/build/header.mk
diff options
context:
space:
mode:
Diffstat (limited to 'build/header.mk')
-rw-r--r--build/header.mk15
1 files changed, 11 insertions, 4 deletions
diff --git a/build/header.mk b/build/header.mk
index 8b28346..abec00f 100644
--- a/build/header.mk
+++ b/build/header.mk
@@ -4,12 +4,15 @@
# Makefile that generates gen/config.h
include build/prelude.mk
-include gen/config.mk
+include gen/vars.mk
+include gen/flags.mk
+include gen/pkgs.mk
include build/exports.mk
# All header fragments we generate
HEADERS := \
gen/has/--st-birthtim.h \
+ gen/has/_Fork.h \
gen/has/acl-get-entry.h \
gen/has/acl-get-file.h \
gen/has/acl-get-tag-type.h \
@@ -47,6 +50,7 @@ HEADERS := \
gen/has/strerror-r-posix.h \
gen/has/string-to-flags.h \
gen/has/strtofflags.h \
+ gen/has/tcgetwinsize.h \
gen/has/timegm.h \
gen/has/tm-gmtoff.h \
gen/has/uselocale.h
@@ -61,9 +65,10 @@ 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/flags.log ${.ALLSRC:%=%.log} >gen/config.log
${VCAT} $@
- @printf '%s' "$$CONFIG" | build/embed.sh >gen/config.i
+ @printf '%s' "$$CONFFLAGS" | build/embed.sh >gen/confflags.i
+ @printf '%s' "$$XCC" | build/embed.sh >gen/cc.i
@printf '%s' "$$XCPPFLAGS" | build/embed.sh >gen/cppflags.i
@printf '%s' "$$XCFLAGS" | build/embed.sh >gen/cflags.i
@printf '%s' "$$XLDFLAGS" | build/embed.sh >gen/ldflags.i
@@ -72,8 +77,10 @@ gen/config.h: ${PKG_HEADERS} ${HEADERS}
# The short name of the config test
SLUG = ${@:gen/%.h=%}
+# The hidden output file name
+OUT = ${SLUG:has/%=gen/has/.%.out}
${HEADERS}::
@${MKDIR} ${@D}
- @build/define-if.sh ${SLUG} build/cc.sh build/${SLUG}.c >$@ 2>$@.log; \
+ @build/define-if.sh ${SLUG} build/cc.sh build/${SLUG}.c -o ${OUT} >$@ 2>$@.log; \
build/msg-if.sh "[ CC ] ${SLUG}.c" test $$? -eq 0