File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66# Run the compiler and check if it succeeded
77
8- set -eu
9-
10- TMP=$( mktemp)
11- trap ' rm -f "$TMP"' EXIT
12-
13- (
14- set -x
15- $XCC $XCPPFLAGS $XCFLAGS $XLDFLAGS " $@ " $XLDLIBS -o " $TMP "
16- )
8+ set -eux
9+ $XCC $XCPPFLAGS $XCFLAGS $XLDFLAGS " $@ " $XLDLIBS
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ include build/exports.mk
1111gen/deps.mk ::
1212 ${MSG} " [ GEN] $@ "
1313 @printf ' # %s\n' " $@ " > $@
14- @if build/cc.sh -MD -MP -MF /dev/null build/empty.c; then \
14+ @if build/cc.sh -MD -MP build/empty.c -o gen/.deps.out ; then \
1515 printf ' _CPPFLAGS += -MD -MP\n' ; \
1616 fi >> $@ 2> $@ .log
1717 ${VCAT} $@
Original file line number Diff line number Diff line change @@ -76,16 +76,18 @@ gen/config.h: ${PKG_HEADERS} ${HEADERS}
7676
7777# The short name of the config test
7878SLUG = ${@:gen/%.h=%}
79+ # The hidden output file name
80+ OUT = ${SLUG:has/%=gen/has/.%.out}
7981
8082${HEADERS} : cc
8183 @${MKDIR} ${@ D}
82- @build/define-if.sh ${SLUG} build/cc.sh build/${SLUG} .c > $@ 2> $@ .log; \
84+ @build/define-if.sh ${SLUG} build/cc.sh build/${SLUG} .c -o ${OUT} > $@ 2> $@ .log; \
8385 build/msg-if.sh " [ CC ] ${SLUG} .c" test $$? -eq 0
8486.PHONY : ${HEADERS}
8587
8688# Check that the C compiler works at all
8789cc ::
88- @build/cc.sh build/empty.c 2> gen/cc.log; \
90+ @build/cc.sh build/empty.c -o gen/.cc.out 2> gen/cc.log; \
8991 ret=$$? ; \
9092 build/msg-if.sh " [ CC ] build/empty.c" test $$ ret -eq 0; \
9193 exit $$ ret
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ if [ -z "$MODE" ]; then
3737 CFLAGS=$( " $0 " --cflags " $LIB " ) || exit 1
3838 LDFLAGS=$( " $0 " --ldflags " $LIB " ) || exit 1
3939 LDLIBS=$( " $0 " --ldlibs " $LIB " ) || exit 1
40- build/cc.sh $CFLAGS $LDFLAGS build/with/$LIB .c $LDLIBS || exit 1
40+ build/cc.sh $CFLAGS $LDFLAGS " build/with/$LIB .c" $LDLIBS -o " gen/with/. $LIB .out " || exit 1
4141 done
4242fi
4343
You can’t perform that action at this time.
0 commit comments