aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2021-02-18 01:15:43 +0000
committerNIIBE Yutaka <[email protected]>2021-02-18 01:15:43 +0000
commit1fb90a7da186ee2ee098a666f6f3a35bb1720e59 (patch)
treece49e46e1b952135d679e9c721ac32a9358357ea /src
parentbuild: Fix gpgrt-config. (diff)
downloadlibgpg-error-1fb90a7da186ee2ee098a666f6f3a35bb1720e59.tar.gz
libgpg-error-1fb90a7da186ee2ee098a666f6f3a35bb1720e59.zip
build: Support --disable-threads by gen-lock-obj.sh.
* configure.ac: Supply --disable-threads to gen-lock-obj.sh. Tighten the condition of using gen-lock-obj.sh for GNU/Linux. * src/gen-lock-obj.sh: Support --disable-threads. -- GnuPG-bug-id: 5296 Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/gen-lock-obj.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh
index 8536aed..a710f0c 100755
--- a/src/gen-lock-obj.sh
+++ b/src/gen-lock-obj.sh
@@ -2,7 +2,7 @@
#
# gen-lock-obj.sh - Build tool to construct the lock object.
#
-# Copyright (C) 2020 g10 Code GmbH
+# Copyright (C) 2020, 2021 g10 Code GmbH
#
# This file is part of libgpg-error.
#
@@ -46,6 +46,21 @@ else
ECHO_N='-n'
fi
+if test "$1" = --disable-threads; then
+ cat <<EOF
+## lock-obj-pub.$host.h - NO LOCK SUPPORT
+## File created by gen-lock-obj.sh - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+/* Dummy object - no locking available. */
+typedef struct
+{
+ long _vers;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {-1}
+EOF
+else
AWK_VERSION_OUTPUT=$($AWK 'BEGIN { print PROCINFO["version"] }')
if test -n "$AWK_VERSION_OUTPUT"; then
# It's GNU awk, which supports PROCINFO.
@@ -106,6 +121,7 @@ while test "$i" -lt $ac_mtx_size; do
fi
i=$(( i + 1 ))
done
+fi
cat <<'EOF'
}}}