diff options
author | Jeff King <peff@peff.net> | 2015-12-01 17:19:06 -0500 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2015-12-01 17:19:06 -0500 |
commit | cd76778049e33c45376c67230c200c7e62ab7a35 (patch) | |
tree | 4c3b03dba2cc7929412e322a3e3f0d2ad993e068 | |
parent | Documentation/git-update-index: add missing opts to synopsys (diff) | |
parent | configure.ac: use $LIBS not $CFLAGS when testing -lpthread (diff) | |
download | tgif-cd76778049e33c45376c67230c200c7e62ab7a35.tar.xz |
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
-rw-r--r-- | configure.ac | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index fd22d41b2f..1f55009bba 100644 --- a/configure.ac +++ b/configure.ac @@ -1149,7 +1149,12 @@ elif test -z "$PTHREAD_CFLAGS"; then # would then trigger compiler warnings on every single file we compile. for opt in "" -mt -pthread -lpthread; do 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_LINK_IFELSE([PTHREADTEST_SRC], [AC_MSG_RESULT([yes]) @@ -1161,6 +1166,7 @@ elif test -z "$PTHREAD_CFLAGS"; then ], [AC_MSG_RESULT([no])]) CFLAGS="$old_CFLAGS" + LIBS="$old_LIBS" done if test $threads_found != yes; then AC_CHECK_LIB([pthread], [pthread_create], |