Don't use c99 -MM -MT.
Some checks failed
Compile Cytoplasm / Compile Cytoplasm (x86, freebsd-v14.0) (push) Failing after 6s
Compile Cytoplasm / Compile Cytoplasm (x86_64, freebsd-v14.0) (push) Failing after 5s
Compile Cytoplasm / Compile Cytoplasm (x86, debian-v12.4) (push) Failing after 8s
Compile Cytoplasm / Compile Cytoplasm (x86_64, debian-v12.4) (push) Failing after 8s
Compile Cytoplasm / Compile Cytoplasm (x86, netbsd-v9.3) (push) Failing after 10s
Compile Cytoplasm / Compile Cytoplasm (x86_64, openbsd-v7.4) (push) Failing after 10s
Compile Cytoplasm / Compile Cytoplasm (x86_64, netbsd-v9.3) (push) Failing after 11s
Compile Cytoplasm / Compile Cytoplasm (x86_64, alpine-v3.19) (push) Successful in 10s
Compile Cytoplasm / Compile Cytoplasm (x86, alpine-v3.19) (push) Successful in 13s

These are non-POSIX flags that only work on some compilers. Notably,
the BSD c99 executables don't support them.
This commit is contained in:
Jordan Bancino 2024-01-13 14:41:15 -05:00
parent 846e50a76e
commit aa737a2b2e

17
configure vendored
View file

@ -128,11 +128,26 @@ print_obj() {
printf '%s ' "$2" printf '%s ' "$2"
} }
get_deps() {
src="$1"
${CC} -I${INCLUDE} -E "$src" \
| grep '^#' \
| awk '{print $3}' \
| cut -d '"' -f 2 \
| sort \
| uniq \
| grep -v '^[/<]' \
| while IFS= read -r dep; do
printf "%s " "$dep"
done
}
compile_obj() { compile_obj() {
src="$1" src="$1"
obj="$2" obj="$2"
${CC} -I${INCLUDE} -MM -MT "${obj}" "${src}" echo "${obj}: $(get_deps ${src})"
echo "${TAB}@mkdir -p $(dirname ${obj})" echo "${TAB}@mkdir -p $(dirname ${obj})"
echo "${TAB}\$(CC) \$(CFLAGS) -fPIC -c -o \"${obj}\" \"${src}\"" echo "${TAB}\$(CC) \$(CFLAGS) -fPIC -c -o \"${obj}\" \"${src}\""
} }