aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2021-11-25 03:08:58 +0000
committerNIIBE Yutaka <[email protected]>2021-11-25 03:08:58 +0000
commit50e0f32b19356fd7c64c799192379ff2204cd8a3 (patch)
tree6728c3ec497c86355392f7f819a10f365f11d1f7
parentbuild: Fix dependency to gpg-error-config-test.sh. (diff)
downloadlibgpg-error-50e0f32b19356fd7c64c799192379ff2204cd8a3.tar.gz
libgpg-error-50e0f32b19356fd7c64c799192379ff2204cd8a3.zip
build,tests: Run t-lock-single-posix only on platforms supported.
* configure.ac (HAVE_LOCK_OPTIMIZATION): New. * tests/Makefile.am: Use HAVE_LOCK_OPTIMIZATION for t-lock-single-posix. -- GnuPG-bug-id: 5699 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--configure.ac9
-rw-r--r--tests/Makefile.am3
2 files changed, 10 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index f13b14c..c75d994 100644
--- a/configure.ac
+++ b/configure.ac
@@ -633,6 +633,15 @@ AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
AM_CONDITIONAL(FORCE_USE_SYSCFG, test x$force_use_syscfg = xyes)
AM_CONDITIONAL(HAVE_GENERATED_LOCK_OBJ_H, test x$lock_obj_h_generated = xyes)
+have_lock_optimization=no
+if test "$gl_threads_api" = posix; then
+ if test x$ac_cv_header_sys_single_threaded_h = xyes \
+ -o x$gl_cv_have_weak = xyes; then
+ have_lock_optimization=yes
+ fi
+fi
+AM_CONDITIONAL(HAVE_LOCK_OPTIMIZATION, test "$have_lock_optimization" = yes)
+
AC_DEFINE_UNQUOTED(HOST_TRIPLET_STRING, "$host", [The host triplet])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a8327d6..9652982 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -32,8 +32,7 @@ gpg_error_lib = ../src/libgpg-error.la
TESTS = t-version t-strerror t-syserror t-lock t-printf t-poll t-b64 \
t-argparse t-logging t-stringutils t-malloc
-if HAVE_W32_SYSTEM
-else
+if HAVE_LOCK_OPTIMIZATION
TESTS += t-lock-single-posix
endif