packages/libs/libgpg-error/patches/011-macos-compile-fix.patch
Georgi Valkov 13f9a7bd63 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>
2021-01-31 18:41:10 +02:00

24 lines
651 B
Diff

--- 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