Small cleanup (sync sponge and avoid some shopt_restores)
Sync with upstream util.sh
Remove unused stuff from it, fix embed example, use realpath and mktemp -d,
improve README
Mention mkcdb to create a compilation database
Use -pedantic only when the C standard isn't GNU
Fixes for MacOS specific problems
Due to antediluvian bash for /bin/sh):
case in $() subshell not parsed correctly, use `` instead (src2obj)
if the heredoc starts in a block, can't have line breaks further in the pipeline (pb_make)
paste needs an explicit '-' argument to process stdin
Also fix wrong end-of-options double dash placement in chmod usage
embed_as_string better comment
Improvements here and there
Add set_cstd to synchronize -std between CFLAGS and CPPFLAGS
Add a way to ignore the environment in setup_from_env
Fix interaction between command grouping and set -e in handle_various
Remove -M* flags in preprocess_embed_as_string
Make embed_as_string interact correctly with the preprocessor
Use curl -z in pb_fetch when possible
Don't make embed_as_string look like a C preprocessor directive
Some fixes here and there and use embed_as_string in example
Use different extension for all incompatible object formats/SANITIZERS
Use .lto extension for LTO objects
SRC must be newline separated
Don't modify global sh opts inside functions
Readd append_intermediate_src
Sync build_util.sh with scripts repo
cf https://git.sr.ht/~q3cpma/scripts/commit/5b899d39462e2db37356396f42bfc3cb6dbd8a00 for more
test_cflag: test flags independently again
test_ldflag: test flags independently anew, add a TEST_LDFLAG_CFLAGS env var to
solve LDFLAGS dependencies on specific CFLAGS
xtest_*flag: show CC/LD output
detect_intermediate_src: convenience function for intermediate files like gperf
or lex
setup_from_env, handle_config, handle_sanitizers, handle_lto, handle_pgo:
factorize stuff into build_util.sh
Fixes
Fix test_cflag failing on gcc -MM -o /dev/null main.c and simplify pmktemp