libgpg-error: fix build error on macOS

src/gen-lock-obj.sh runs in /bin/sh which does not support echo -n on macOS,
and generates garbage. Resolved by using printf which is posix compliant.

Signed-off-by: Georgi Valkov <gvalkov@abv.bg>
This commit is contained in:
Georgi Valkov
2021-01-30 13:27:55 +02:00
parent 9133e79ccb
commit 13f9a7bd63
3 changed files with 25 additions and 8 deletions
@@ -0,0 +1,24 @@
--- a/src/gen-lock-obj.sh
+++ b/src/gen-lock-obj.sh
@@ -84,17 +84,16 @@ EOF
# USE_LONG_DOUBLE_FOR_ALIGNMENT
#
-echo -n "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{"
+printf "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{"
i=0
while test "$i" -lt $ac_mtx_size; do
if test "$i" -ne 0 -a "$(( $i % 8 ))" -eq 0; then
- echo ' \'
- echo -n " "
+ printf " %s\n " "\\"
fi
- echo -n '0'
+ printf '0'
if test "$i" -lt $(($ac_mtx_size - 1)); then
- echo -n ','
+ printf ','
fi
i=$(( i + 1 ))
done