summaryrefslogtreecommitdiff
path: root/sofort
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-05-26 01:18:13 +0000
committermidipix <writeonce@midipix.org>2021-05-26 14:37:21 +0000
commit53eaf3f602d625aa16a6fcc805a7085c97fc9f85 (patch)
treea493e8b8e30219f2b6feb2a710c57fbcba71d5ad /sofort
parent61f223a61f2c792fef1a5112698c278c33a7fcbd (diff)
downloadapimagic-53eaf3f602d625aa16a6fcc805a7085c97fc9f85.tar.bz2
apimagic-53eaf3f602d625aa16a6fcc805a7085c97fc9f85.tar.xz
build system: cfgtest: cfgtest_common_init(): refactor.
Diffstat (limited to 'sofort')
-rw-r--r--sofort/cfgtest/cfgtest.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/sofort/cfgtest/cfgtest.sh b/sofort/cfgtest/cfgtest.sh
index ab5d2ab..87fb4f3 100644
--- a/sofort/cfgtest/cfgtest.sh
+++ b/sofort/cfgtest/cfgtest.sh
@@ -184,15 +184,17 @@ cfgtest_ldflags_append()
cfgtest_common_init()
{
# cfgtest variables
- if [ "${1:-}" = 'asm' ]; then
+ cfgtest_type="${1:-}"
+
+ if [ "$cfgtest_type" = 'asm' ]; then
cfgtest_fmt='%s -c -xc - -o a.out'
- elif [ "${1:-}" = 'lib' ]; then
+ elif [ "$cfgtest_type" = 'lib' ]; then
cfgtest_fmt='%s -xc - -o a.out'
else
cfgtest_fmt='%s -S -xc - -o -'
fi
- if [ "${1:-}" = 'lib' ]; then
+ if [ "$cfgtest_type" = 'lib' ]; then
cfgtest_cmd=$(printf "$cfgtest_fmt %s %s %s" \
"$mb_cfgtest_cc" \
"$mb_cfgtest_cflags" \
@@ -204,7 +206,7 @@ cfgtest_common_init()
"$mb_cfgtest_cflags")
fi
- if [ -z "$mb_cfgtest_headers" ] || [ "${1:-}" = 'lib' ]; then
+ if [ -z "$mb_cfgtest_headers" ] || [ "$cfgtest_type" = 'lib' ]; then
cfgtest_inc=
cfgtest_src="$cfgtest_code_snippet"
else
@@ -220,7 +222,7 @@ cfgtest_common_init()
printf ' \\\n\t%s' "$cfgtest_cflag" >&3
done
- if [ "${1:-}" = 'lib' ]; then
+ if [ "$cfgtest_type" = 'lib' ]; then
for cfgtest_lib in $cfgtest_libs; do
printf ' \\\n\t%s' "$cfgtest_lib" >&3
done