summaryrefslogtreecommitdiffhomepage
path: root/sofort/cfgtest
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-01-06 22:18:59 +0000
committermidipix <writeonce@midipix.org>2020-01-07 06:05:29 +0000
commitbb699e73c43d1627cd6f11eaee14f71e22ff912c (patch)
tree64e8c67e4276da85603c28fa9cfdd5f533f23f0e /sofort/cfgtest
parent01f634d448b2bff64faf096c8b9f6050ae045f73 (diff)
downloadsofort-bb699e73c43d1627cd6f11eaee14f71e22ff912c.tar.bz2
sofort-bb699e73c43d1627cd6f11eaee14f71e22ff912c.tar.xz
build system: cfgtest_library_presence(): config.log integration.
Diffstat (limited to 'sofort/cfgtest')
-rw-r--r--sofort/cfgtest/cfgtest.sh49
1 files changed, 44 insertions, 5 deletions
diff --git a/sofort/cfgtest/cfgtest.sh b/sofort/cfgtest/cfgtest.sh
index 4cd9e08..9cf5ec0 100644
--- a/sofort/cfgtest/cfgtest.sh
+++ b/sofort/cfgtest/cfgtest.sh
@@ -459,15 +459,54 @@ cfgtest_code_snippet_asm()
cfgtest_library_presence()
{
- printf 'int main(void){return 0;}' \
- | $mb_cfgtest_cc -o a.out -xc - \
- $mb_cfgtest_cflags \
- $@ \
- > /dev/null 2>/dev/null \
+ cfgtest_libs=
+ cfgtest_spc=
+
+ for cfgtest_lib in ${@}; do
+ cfgtest_libs="$cfgtest_libs$cfgtest_spc$cfgtest_lib"
+ cfgtest_spc=' '
+ done
+
+ if [ "${1}" = "$cfgtest_libs" ]; then
+ cfgtest_prolog 'library' "${1#*-l}"
+ else
+ cfgtest_prolog 'lib module' '(see config.log)'
+ fi
+
+ cfgtest_code_snippet='int main(void){return 0;}'
+
+ printf 'printf %s "%s" \\\n' "'%s'" "$cfgtest_code_snippet" >&3
+ printf '| %s -o a.out -xc -' "$mb_cfgtest_cc" >&3
+
+ for cfgtest_cflag in $mb_cfgtest_cflags; do
+ printf ' \\\n\t%s' "$cfgtest_cflag" >&3
+ done
+
+ for cfgtest_lib in ${@}; do
+ printf ' \\\n\t%s' "$cfgtest_lib" >&3
+ done
+
+ printf '\n\n' >&3
+
+ cfgtest_cmd=$(printf '%s -o a.out -xc - %s' \
+ "$mb_cfgtest_cc" "$mb_cfgtest_cflags")
+
+ cfgtest_cmd="$cfgtest_cmd $cfgtest_libs"
+
+ printf '%s' "$cfgtest_code_snippet" \
+ | $(printf '%s' "$cfgtest_cmd") \
+ > /dev/null 2>&3 \
+ || cfgtest_epilog 'library' '-----' \
|| return 1
rm -f a.out
+ printf 'cfgtest: `%s'"'"' was accepted by the linker driver.\n' \
+ "$cfgtest_libs" >&3
+ printf '%s\n' '------------------------' >&3
+
+ cfgtest_epilog 'library' '(present)'
+
return 0
}