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
This commit is contained in:
Alejandro R. Sedeño 2022-03-05 09:46:38 -05:00 committed by Daniel Stenberg
parent c82b281e17
commit 2f5006da2f
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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,