From 500f73606c3cd560b60a2d0dd930f2fdadc2e0a5 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 9 Jun 2021 00:02:19 +0000 Subject: build system: cfgtest: cfgtest_common_init(): simplify case logic. --- sofort/cfgtest/cfgtest.sh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'sofort/cfgtest/cfgtest.sh') diff --git a/sofort/cfgtest/cfgtest.sh b/sofort/cfgtest/cfgtest.sh index b044136..8d62a08 100644 --- a/sofort/cfgtest/cfgtest.sh +++ b/sofort/cfgtest/cfgtest.sh @@ -257,25 +257,13 @@ cfgtest_common_init() fi - if [ -z "$mb_cfgtest_headers" ] || [ "$cfgtest_type" = 'lib' ]; then - cfgtest_inc= - cfgtest_src="$cfgtest_code_snippet" - - elif [ "$cfgtest_type" = 'macro' ]; then - 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= - else + if [ -n "$mb_cfgtest_headers" ]; then cfgtest_inc=$(printf '#include <%s>\n' $mb_cfgtest_headers) cfgtest_src=$(printf '%s\n_\n' "$cfgtest_inc" \ | m4 -D_="$cfgtest_code_snippet") + else + cfgtest_inc= + cfgtest_src="$cfgtest_code_snippet" fi -- cgit v1.2.3