Merge branch 'rc/configure-use-libs-when-checking-a-lib'

The "configure" script did not test for -lpthread correctly, which
upset some linkers.

* rc/configure-use-libs-when-checking-a-lib:
  configure.ac: use $LIBS not $CFLAGS when testing -lpthread
This commit is contained in:
Jeff King 2015-11-24 19:06:33 -05:00
Родитель 718a9e67b6 bac2c5bf1a
Коммит a3824e7145
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -1142,7 +1142,12 @@ elif test -z "$PTHREAD_CFLAGS"; then
# would then trigger compiler warnings on every single file we compile. # would then trigger compiler warnings on every single file we compile.
for opt in "" -mt -pthread -lpthread; do for opt in "" -mt -pthread -lpthread; do
old_CFLAGS="$CFLAGS" old_CFLAGS="$CFLAGS"
CFLAGS="$opt $CFLAGS" old_LIBS="$LIBS"
case "$opt" in
-l*) LIBS="$opt $LIBS" ;;
*) CFLAGS="$opt $CFLAGS" ;;
esac
AC_MSG_CHECKING([for POSIX Threads with '$opt']) AC_MSG_CHECKING([for POSIX Threads with '$opt'])
AC_LINK_IFELSE([PTHREADTEST_SRC], AC_LINK_IFELSE([PTHREADTEST_SRC],
[AC_MSG_RESULT([yes]) [AC_MSG_RESULT([yes])
@ -1154,6 +1159,7 @@ elif test -z "$PTHREAD_CFLAGS"; then
], ],
[AC_MSG_RESULT([no])]) [AC_MSG_RESULT([no])])
CFLAGS="$old_CFLAGS" CFLAGS="$old_CFLAGS"
LIBS="$old_LIBS"
done done
if test $threads_found != yes; then if test $threads_found != yes; then
AC_CHECK_LIB([pthread], [pthread_create], AC_CHECK_LIB([pthread], [pthread_create],