summaryrefslogtreecommitdiff
path: root/sofort/cfgtest
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-06-05 13:47:01 +0000
committermidipix <writeonce@midipix.org>2021-06-05 13:47:01 +0000
commita8e128b6f627523e66ae4d5a727f3741a158da86 (patch)
tree84c2d3cbcac1dc36c0e5702a2fa404bae4a4a0cb /sofort/cfgtest
parent993a9447ce6ca858ed932f6c31603c35f13c73d3 (diff)
downloadslibtool-a8e128b6f627523e66ae4d5a727f3741a158da86.tar.bz2
slibtool-a8e128b6f627523e66ae4d5a727f3741a158da86.tar.xz
build system: cfgtest: properly support strict compiler drivers.
Diffstat (limited to 'sofort/cfgtest')
-rw-r--r--sofort/cfgtest/cfgtest.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/sofort/cfgtest/cfgtest.sh b/sofort/cfgtest/cfgtest.sh
index 7e58a7e..692bfec 100644
--- a/sofort/cfgtest/cfgtest.sh
+++ b/sofort/cfgtest/cfgtest.sh
@@ -38,6 +38,7 @@ cfgtest_host_section()
{
mb_cfgtest_cc="$ccenv_host_cc"
mb_cfgtest_cfgtype='host'
+ mb_cfgtest_stdin_input=${ccenv_host_stdin_input:-}
mb_cfgtest_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \
OS_DSO_EXRULES=default \
@@ -62,6 +63,7 @@ cfgtest_native_section()
{
mb_cfgtest_cc="$ccenv_native_cc"
mb_cfgtest_cfgtype='native'
+ mb_cfgtest_stdin_input=${ccenv_native_stdin_input:-}
mb_cfgtest_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \
OS_DSO_EXRULES=default \
@@ -105,6 +107,10 @@ cfgtest_epilog()
rm -f 'a.out'
fi
+ if [ "$mb_cfgtest_stdin_input" = 'no' ]; then
+ rm 'cfgtest_c3RyaWN0X21vZGUK.c'
+ fi
+
if [ "${1}" = 'snippet' ] && [ "${2}" = '(error)' ]; then
printf '\n\ncfgtest: the %s compiler %s %s.\n' \
"$mb_cfgtest_cfgtype" \
@@ -204,7 +210,13 @@ cfgtest_common_init()
# cfgtest variables
cfgtest_type="${1:-}"
- if [ "$cfgtest_type" = 'asm' ]; then
+ if [ "$mb_cfgtest_stdin_input" = 'no' ]; then
+ if [ "$cfgtest_type" = 'lib' ]; then
+ cfgtest_fmt='%s cfgtest_c3RyaWN0X21vZGUK.c -o a.out'
+ else
+ cfgtest_fmt='%s -c cfgtest_c3RyaWN0X21vZGUK.c -o a.out'
+ fi
+ elif [ "$cfgtest_type" = 'asm' ]; then
cfgtest_fmt='%s -c -xc - -o a.out'
elif [ "$cfgtest_type" = 'lib' ]; then
cfgtest_fmt='%s -xc - -o a.out'
@@ -267,6 +279,11 @@ cfgtest_common_init()
printf ' \\\n' >&3
printf '<< _SRCEOF\n%s\n' "$cfgtest_src" >&3
printf '_SRCEOF \n\n\n' >&3
+
+ if [ "$mb_cfgtest_stdin_input" = 'no' ]; then
+ printf '%s' "$cfgtest_src" > 'cfgtest_c3RyaWN0X21vZGUK.c'
+ cfgtest_src=
+ fi
}