From 2f5006da2f42f8133f532df9653c03a1572bbd69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20R=2E=20Sede=C3=B1o?= Date: Sat, 5 Mar 2022 09:46:38 -0500 Subject: [PATCH] configure.ac: move -pthread CFLAGS setting back where it used to be The fix for #8276 proposed in #8374 set `CFLAGS="$CFLAGS -pthead"` earlier than it used to be set, applying it in cases where it should not have been applied. This moves the AIX XLC check to a new `case $host in` block inside of the `if test "$USE_THREADS_POSIX" != "1"` block, where `CFLAGS="$CFLAGS -pthead"` used to happen. Fixes #8541 Closes #8542 --- configure.ac | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index d431870725..e76f223e6c 100644 --- a/configure.ac +++ b/configure.ac @@ -3522,23 +3522,27 @@ if test "$want_pthreads" != "no"; then dnl it doesn't actually work without -lpthread USE_THREADS_POSIX="" ;; - *-ibm-aix*) - dnl Check if compiler is xlC - COMPILER_VERSION=`"$CC" -qversion 2>/dev/null` - if test x"$COMPILER_VERSION" = "x"; then - CFLAGS="$CFLAGS -pthread" - else - CFLAGS="$CFLAGS -qthreaded" - fi - ;; *) - CFLAGS="$CFLAGS -pthread" ;; esac dnl if it wasn't found without lib, search for it in pthread lib if test "$USE_THREADS_POSIX" != "1" then + case $host in + *-ibm-aix*) + dnl Check if compiler is xlC + COMPILER_VERSION=`"$CC" -qversion 2>/dev/null` + if test x"$COMPILER_VERSION" = "x"; then + CFLAGS="$CFLAGS -pthread" + else + CFLAGS="$CFLAGS -qthreaded" + fi + ;; + *) + CFLAGS="$CFLAGS -pthread" + ;; + esac # assign PTHREAD for pkg-config use PTHREAD=" -pthread" AC_CHECK_LIB(pthread, pthread_create, -- 2.47.3