diff options
-rw-r--r-- | configure.ac | 10 | ||||
-rwxr-xr-x | src/gen-lock-obj.sh | 18 |
2 files changed, 25 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index b9a2a3e..7ec21b6 100644 --- a/configure.ac +++ b/configure.ac @@ -595,9 +595,15 @@ if test "$have_w32_system" = yes; then fi force_use_syscfg=yes fi -if test x$cross_compiling = xyes; then +if test x"$gl_use_threads" = xno; then + lock_obj_h_generated=yes + if test ! -d src; then mkdir src; fi + host=$host $srcdir/src/gen-lock-obj.sh --disable-threads \ + >src/lock-obj-pub.native.h + AC_MSG_NOTICE([generated src/lock-obj-pub.native.h for $host]) +elif test x$cross_compiling = xyes; then case $host in - *-*-linux*) + *-*-linux-gnu*) AC_CHECK_TOOL(OBJDUMP, [objdump]) if test -n "$OBJDUMP"; then lock_obj_h_generated=yes 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' }}} |