NIIBE Yutaka <[email protected]> wrote: > Let me have some time for configure.ac.
Attached is a patch for the change of configure.ac. If no objection, I'll push this change to master. It includes your changes (except the one for the EXTRA_LIBS_FOR_BUILD). Please note that the detection of -lpthread is a bit complicated. On z/OS, IIUC, no -lpthread is required *and* it should not be added to the compiler option. On GNU/Linux, it is not required any more (with newer glibc), but it is still OK to have -lpthread option. Here, libgcrypt only needs to know if pthread API is available or not. For actual linking, it uses GPG_ERROR_MT_LIBS (see tests/Makefile.am). GPG_ERROR_MT_LIBS is from libgpg-error and it is libgpg-error which checks pthread API more deeply and pthread linking at its build time. It uses libgpg-error/m4/threadlib.m4 from gnulib. --
>From 4a06d4967666dad844b91560a2394db5d0ea4b5d Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka <[email protected]> Date: Wed, 3 Dec 2025 11:35:37 +0900 Subject: [PATCH] build: Add support for IBM z/OS, fixing -lpthread check with glibc. * configure.ac: Care about PRINTABLE_OS_NAME for IBM z/OS. Handle have_pthread for IBM z/OS. No check with -lpthread when we know about have_pthread. -- The variable have_pthread in configure script is whether or not the pthread API is available on the host. Linking is handled with libgpg-error using GPG_ERROR_MT_LIBS. Signed-off-by: Sachin T <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]> --- configure.ac | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index f5e78077..39b20163 100644 --- a/configure.ac +++ b/configure.ac @@ -241,6 +241,11 @@ have_pthread=no # Setup some stuff depending on host. case "${host}" in + *-*-linux*) + # It makes no sense to check with -lpthread for libgcrypt. + have_pthread=yes + ;; + *-*-mingw32*) ac_cv_have_dev_random=no have_w32_system=yes @@ -290,8 +295,17 @@ case "${host}" in [defined if we use posix_spawn in test program]) AC_CHECK_HEADERS(spawn.h) ;; + + *-openedition*) + # The z/OS C runtime includes pthread support, and linking is + # handled automatically at build time. + have_pthread=yes + # mmap is not fully supported on z/OS. + ac_cv_func_mmap=no + ;; + *) - ;; + ;; esac if test "$have_w32_system" = yes; then @@ -318,6 +332,10 @@ case "${host}" in PRINTABLE_OS_NAME="GNU/Linux" ;; + *-openedition*) + PRINTABLE_OS_NAME="IBM z/OS" + ;; + *) PRINTABLE_OS_NAME=`uname -s || echo "Unknown"` ;; @@ -821,13 +839,12 @@ AM_CONDITIONAL(USE_GPGRT_CONFIG, [test -n "$GPGRT_CONFIG" \ # # Check whether pthreads is available # -if test "$have_w32_system" != yes; then +if test "$have_w32_system" != yes && test "$have_pthread" != yes; then AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes) - if test "$have_pthread" = yes; then - AC_DEFINE(HAVE_PTHREAD, 1 ,[Define if we have pthread.]) - fi fi - +if test "$have_pthread" = yes; then + AC_DEFINE(HAVE_PTHREAD, 1 ,[Define if we have pthread.]) +fi # Solaris needs -lsocket and -lnsl. Unisys system includes # gethostbyname in libsocket but needs libnsl for socket. -- 2.47.2
_______________________________________________ Gnupg-devel mailing list [email protected] https://lists.gnupg.org/mailman/listinfo/gnupg-devel
