summaryrefslogtreecommitdiff
path: root/sofort
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-01-06 12:25:02 +0000
committermidipix <writeonce@midipix.org>2020-01-06 22:22:18 +0000
commit46a9dd5d330cd317d3c077cff2baffcecc1a2338 (patch)
tree7f291f7dd8e457e41274d3752091b00444dc8547 /sofort
parent1c0167b11412742bb206803e3a6a4f24f250ca2a (diff)
downloadsbpython3-46a9dd5d330cd317d3c077cff2baffcecc1a2338.tar.bz2
sbpython3-46a9dd5d330cd317d3c077cff2baffcecc1a2338.tar.xz
build system: cfgtest_interface_presence(): config.log integration.
Diffstat (limited to 'sofort')
-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 074800a..ac5b2d3 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
}