mx-test.sh: drop permanent jobreaper, just start a new one, always
[s-mailx.git] / mk / pcb-cc.sh
blob2697c5cf40c1460919aed5229943b3bace637d74
1 #!/bin/sh -
2 #@ A "pseudo cross-build $CC" to "test" at least CROSS_BUILD "config".
4 # Public Domain
6 # Do we have to go via a real C compiler in preprocessor mode?
7 dowemayhave() {
8 while [ $# -gt 0 ]; do
9 [ "$1" = -E ] && return 0
10 shift
11 done
12 return 1
15 if dowemayhave "$@"; then
16 SU_FIND_COMMAND_INCLUSION=1 . "${TOPDIR}"mk/su-find-command.sh
18 if acmd_set CC clang || acmd_set CC gcc ||
19 acmd_set CC tcc || acmd_set CC pcc ||
20 acmd_set CC c89 || acmd_set CC c99; then
21 exec "$CC" "$@"
22 else
23 echo >&2 'boing booom tschak'
24 echo >&2 'ERROR: I cannot find a compiler!'
25 echo >&2 'No clang(1), gcc(1), tcc(1), pcc(1), c89(1) or c99(1).'
27 else
28 [ $# -eq 0 ] && exit 1
29 while [ $# -gt 0 ]; do
30 if [ "$1" = -o ]; then
31 printf '\n' > "$2"
32 exit 0
34 shift
35 done
36 exit 0
39 exit 1
40 # s-sh-mode