summaryrefslogtreecommitdiffhomepage
path: root/sofort/cfgtest/cfgtest.sh
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-01-06 12:25:02 +0000
committermidipix <writeonce@midipix.org>2020-01-06 22:21:32 +0000
commitfe2dddc7f4aa24c6592666a1a88c8c30f46cca6d (patch)
tree33516e056d5cf4ad4244528238798c3a708d909e /sofort/cfgtest/cfgtest.sh
parentd90a2dd8bc9f83e237f3cb950e6d5afaab3ae6be (diff)
downloadmmglue-fe2dddc7f4aa24c6592666a1a88c8c30f46cca6d.tar.bz2
mmglue-fe2dddc7f4aa24c6592666a1a88c8c30f46cca6d.tar.xz
build system: cfgtest_interface_presence(): config.log integration.
Diffstat (limited to 'sofort/cfgtest/cfgtest.sh')
-rw-r--r--sofort/cfgtest/cfgtest.sh44
1 files changed, 37 insertions, 7 deletions
diff --git a/sofort/cfgtest/cfgtest.sh b/sofort/cfgtest/cfgtest.sh
index 1ec6ba0..f728f51 100644
--- a/sofort/cfgtest/cfgtest.sh
+++ b/sofort/cfgtest/cfgtest.sh
@@ -75,6 +75,10 @@ cfgtest_epilog()
"${cfgtest_line_dots}" "${1}"
if [ "${1}" = '-----' ]; then
+ printf '\n\ncfgtest: header is missing or cannot be found.\n' >&3
+ printf '%s\n' '------------------------' >&3
+ return 1
+ elif [ "${1}" = '(error)' ]; then
printf '\n\ncfgtest: interface is missing or cannot be used.\n' >&3
printf '%s\n' '------------------------' >&3
return 1
@@ -213,18 +217,38 @@ cfgtest_header_absence()
cfgtest_interface_presence()
{
- mb_internal_cflags=''
+ cfgtest_prolog 'interface' "${1}"
+
+ mb_internal_cflags=
for mb_header in $mb_cfgtest_headers; do
mb_internal_cflags="$mb_internal_cflags --include=$mb_header"
done
- printf 'void * addr = &%s;' "$@" \
- | $mb_cfgtest_cc -S -xc - -o - \
- $mb_cfgtest_cflags \
- $mb_internal_cflags \
- > /dev/null 2>/dev/null \
- || return 1
+ cfgtest_code_snippet=$(printf 'void * addr = &%s;' "${1}")
+
+ printf 'printf %s "%s" \\\n' "'%s'" "$cfgtest_code_snippet" >&3
+ printf '| %s -S -xc - -o -' "$mb_cfgtest_cc" >&3
+
+ for cfgtest_cflag in $mb_cfgtest_cflags; do
+ printf ' \\\n\t%s' "$cfgtest_cflag" >&3
+ done
+
+ for cfgtest_cflag in $mb_internal_cflags; do
+ printf ' \\\n\t%s' "$cfgtest_cflag" >&3
+ done
+
+ printf '\n\n' >&3
+
+ cfgtest_cmd=$(printf '%s -S -xc - -o - %s %s' \
+ "$mb_cfgtest_cc" "$mb_cfgtest_cflags" \
+ "$mb_internal_cflags")
+
+ printf '%s' "$cfgtest_code_snippet" \
+ | $(printf '%s' "$cfgtest_cmd") \
+ > /dev/null 2>&3 \
+ || cfgtest_epilog '(error)' \
+ || return
mb_internal_str=$(printf '%s%s' '-DHAVE_' "$@" \
| sed -e 's/\./_/g' \
@@ -236,6 +260,12 @@ cfgtest_interface_presence()
cfgtest_makevar_append "$mb_internal_str"
fi
+ printf 'cfgtest: %s interface `%s'"'"' is available.\n' \
+ "$mb_cfgtest_cfgtype" "${1}" >&3
+ printf '%s\n' '------------------------' >&3
+
+ cfgtest_epilog "${1}"
+
return 0
}