Skip to content

Commit cd76778

Browse files
committed
Merge branch 'rc/configure-use-libs-when-checking-a-lib' into maint
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 5cb2e16 + bac2c5b commit cd76778

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
@@ -1149,7 +1149,12 @@ elif test -z "$PTHREAD_CFLAGS"; then
11491149
# would then trigger compiler warnings on every single file we compile.
11501150
for opt in "" -mt -pthread -lpthread; do
11511151
old_CFLAGS="$CFLAGS"
1152-
CFLAGS="$opt $CFLAGS"
1152+
old_LIBS="$LIBS"
1153+
case "$opt" in
1154+
-l*) LIBS="$opt $LIBS" ;;
1155+
*) CFLAGS="$opt $CFLAGS" ;;
1156+
esac
1157+
11531158
AC_MSG_CHECKING([for POSIX Threads with '$opt'])
11541159
AC_LINK_IFELSE([PTHREADTEST_SRC],
11551160
[AC_MSG_RESULT([yes])
@@ -1161,6 +1166,7 @@ elif test -z "$PTHREAD_CFLAGS"; then
11611166
],
11621167
[AC_MSG_RESULT([no])])
11631168
CFLAGS="$old_CFLAGS"
1169+
LIBS="$old_LIBS"
11641170
done
11651171
if test $threads_found != yes; then
11661172
AC_CHECK_LIB([pthread], [pthread_create],

0 commit comments

Comments
 (0)