summaryrefslogtreecommitdiffhomepage
path: root/sofort
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-06-05 14:49:41 +0000
committermidipix <writeonce@midipix.org>2021-06-05 15:11:59 +0000
commit2614f9cd20c229e51ddc48c5de38b2aa5951e97b (patch)
tree27061556b1b67c71897ee412a5619daea0fa234c /sofort
parent24e2654285d38f892884144288c0616e4b28c03d (diff)
downloadsltdl-2614f9cd20c229e51ddc48c5de38b2aa5951e97b.tar.bz2
sltdl-2614f9cd20c229e51ddc48c5de38b2aa5951e97b.tar.xz
build system: cfgtest_compiler_switch(): distinguish 'switch' from 'ldflag'.
Diffstat (limited to 'sofort')
-rw-r--r--sofort/ccenv/ccswitch.strs3
-rw-r--r--sofort/cfgtest/cfgtest.sh31
2 files changed, 29 insertions, 5 deletions
diff --git a/sofort/ccenv/ccswitch.strs b/sofort/ccenv/ccswitch.strs
index 9c4f508..0a76f03 100644
--- a/sofort/ccenv/ccswitch.strs
+++ b/sofort/ccenv/ccswitch.strs
@@ -25,8 +25,9 @@
-std=c11
# linker switches
--Wl,
+-Wl,--print-map
-Wl,--no-undefined
+-Wl,--verbose
# errors and warnings
-Wall
diff --git a/sofort/cfgtest/cfgtest.sh b/sofort/cfgtest/cfgtest.sh
index 692bfec..f66dde5 100644
--- a/sofort/cfgtest/cfgtest.sh
+++ b/sofort/cfgtest/cfgtest.sh
@@ -213,6 +213,8 @@ cfgtest_common_init()
if [ "$mb_cfgtest_stdin_input" = 'no' ]; then
if [ "$cfgtest_type" = 'lib' ]; then
cfgtest_fmt='%s cfgtest_c3RyaWN0X21vZGUK.c -o a.out'
+ elif [ "$cfgtest_type" = 'ldflag' ]; then
+ cfgtest_fmt='%s cfgtest_c3RyaWN0X21vZGUK.c -o a.out'
else
cfgtest_fmt='%s -c cfgtest_c3RyaWN0X21vZGUK.c -o a.out'
fi
@@ -220,6 +222,8 @@ cfgtest_common_init()
cfgtest_fmt='%s -c -xc - -o a.out'
elif [ "$cfgtest_type" = 'lib' ]; then
cfgtest_fmt='%s -xc - -o a.out'
+ elif [ "$cfgtest_type" = 'ldflag' ]; then
+ cfgtest_fmt='%s -xc - -o a.out'
else
cfgtest_fmt='%s -S -xc - -o -'
fi
@@ -232,6 +236,13 @@ cfgtest_common_init()
"$mb_cfgtest_ldflags" \
"$cfgtest_libs")
+ elif [ "$cfgtest_type" = 'ldflag' ]; then
+ cfgtest_cmd=$(printf "$cfgtest_fmt %s %s %s" \
+ "$mb_cfgtest_cc" \
+ "$mb_cfgtest_cflags" \
+ "$mb_cfgtest_ldflags" \
+ "$cfgtest_switches")
+
elif [ "$cfgtest_type" = 'switch' ]; then
cfgtest_cmd=$(printf "$cfgtest_fmt %s %s" \
"$mb_cfgtest_cc" \
@@ -248,6 +259,10 @@ cfgtest_common_init()
cfgtest_inc=
cfgtest_src="$cfgtest_code_snippet"
+ elif [ "$cfgtest_type" = 'ldflag' ]; then
+ cfgtest_inc=
+ cfgtest_src=
+
elif [ "$cfgtest_type" = 'switch' ]; then
cfgtest_inc=
cfgtest_src=
@@ -270,7 +285,7 @@ cfgtest_common_init()
printf ' \\\n\t%s' "$cfgtest_lib" >&3
done
- elif [ "$cfgtest_type" = 'switch' ]; then
+ elif [ "$cfgtest_type" = 'switch' ] || [ "$cfgtest_type" = 'ldflag' ]; then
for cfgtest_switch in $(printf '%s' "$cfgtest_switches"); do
printf ' \\\n\t%s' "$cfgtest_switch" >&3
done
@@ -583,9 +598,17 @@ cfgtest_compiler_switch()
cfgtest_prolog 'compiler switch combination' "$cfgtest_switches"
fi
- cfgtest_code_snippet=
-
- cfgtest_common_init 'switch'
+ case "${1}" in
+ -Wl,*)
+ cfgtest_code_snippet='int main(void){return 0;}'
+ cfgtest_common_init 'ldflag'
+ ;;
+
+ *)
+ cfgtest_code_snippet=
+ cfgtest_common_init 'switch'
+ ;;
+ esac
# execute
printf '%s' "$cfgtest_src" \