Skip to content

Commit a3824e7

Browse files
committed
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
2 parents 718a9e6 + bac2c5b commit a3824e7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

configure.ac

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,12 @@ elif test -z "$PTHREAD_CFLAGS"; then
11421142
# would then trigger compiler warnings on every single file we compile.
11431143
for opt in "" -mt -pthread -lpthread; do
11441144
old_CFLAGS="$CFLAGS"
1145-
CFLAGS="$opt $CFLAGS"
1145+
old_LIBS="$LIBS"
1146+
case "$opt" in
1147+
-l*) LIBS="$opt $LIBS" ;;
1148+
*) CFLAGS="$opt $CFLAGS" ;;
1149+
esac
1150+
11461151
AC_MSG_CHECKING([for POSIX Threads with '$opt'])
11471152
AC_LINK_IFELSE([PTHREADTEST_SRC],
11481153
[AC_MSG_RESULT([yes])
@@ -1154,6 +1159,7 @@ elif test -z "$PTHREAD_CFLAGS"; then
11541159
],
11551160
[AC_MSG_RESULT([no])])
11561161
CFLAGS="$old_CFLAGS"
1162+
LIBS="$old_LIBS"
11571163
done
11581164
if test $threads_found != yes; then
11591165
AC_CHECK_LIB([pthread], [pthread_create],

0 commit comments

Comments
 (0)