summaryrefslogtreecommitdiff
path: root/sofort
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-05-26 16:41:15 +0000
committermidipix <writeonce@midipix.org>2021-05-26 16:48:03 +0000
commitf3f5bb256d8867fba6eb5a3a4dcff9a4b57b16c4 (patch)
tree61c5f743cc2024102fdd96b8d19057408780244c /sofort
parentcea86b9cbb272adb4f5f1f43df58b6b3b4c4493a (diff)
downloadbautomake-f3f5bb256d8867fba6eb5a3a4dcff9a4b57b16c4.tar.bz2
bautomake-f3f5bb256d8867fba6eb5a3a4dcff9a4b57b16c4.tar.xz
build system: ccenv_set_cc_underscore(): rewrite against strict posix utils.
Diffstat (limited to 'sofort')
-rw-r--r--sofort/ccenv/ccenv.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 2ba9426..14e8b9a 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -741,16 +741,26 @@ ccenv_set_cc_underscore()
ccenv_fn_name='ZmYaXyWbVe_UuTnSdReQrPsOcNoNrLe'
ccenv_fn_code='int %s(void){return 0;}'
- if printf "$ccenv_fn_code" $ccenv_fn_name \
- | $ccenv_cc -xc - -S -o - \
- 2>&3 \
- | grep "^_$ccenv_fn_name:" \
- > /dev/null; then
+ ccenv_tmpname='ccenv/c3RyaWN0X21vZGUK.c'
+
+ printf "$ccenv_fn_code" $ccenv_fn_name \
+ > "$ccenv_tmpname"
+
+ $ccenv_cc -c "$ccenv_tmpname" -o a.out \
+ > /dev/null 2>&3
+
+ if "$ccenv_nm" a.out | grep \
+ -e "^_$ccenv_fn_name" \
+ -e " _$ccenv_fn_name" \
+ > /dev/null; then
ccenv_cc_underscore='_'
ccenv_attr_epilog 'yes'
+ else
+ ccenv_attr_epilog 'no'
fi
- ccenv_attr_epilog 'no'
+ rm "$ccenv_tmpname"
+ rm a.out
return 0
}