summaryrefslogtreecommitdiffhomepage
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:55 +0000
commita0b8ed7dabfbfb86dae3247cc5ef0f72bd8174d3 (patch)
tree3c257dc6a9a996a97a7150cd639257c811615363
parent1202b166a55a72e01d486c135a5b9c584f125a7d (diff)
downloadsofort-a0b8ed7dabfbfb86dae3247cc5ef0f72bd8174d3.tar.bz2
sofort-a0b8ed7dabfbfb86dae3247cc5ef0f72bd8174d3.tar.xz
build system: cfgtest_interface_presence(): config.log integration.
-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
}