configure: use correct CFLAGS for threaded resolver with xlC on AIX

Fixes #8276
Closes #8374
This commit is contained in:
Davide Cassioli 2022-01-24 14:24:45 +01:00 committed by Daniel Stenberg
parent 94d4a065a9
commit 9cc75eb7dd
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -3477,14 +3477,23 @@ 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
CFLAGS="$CFLAGS -pthread"
# assign PTHREAD for pkg-config use
PTHREAD=" -pthread"
AC_CHECK_LIB(pthread, pthread_create,