Fix -lpthread vs -pthread detection.

-lpthread needs to be in LIBS, not LDFLAGS
This commit is contained in:
Bill Currie 2010-12-23 11:36:58 +09:00
parent 0173ba07b4
commit 8a96e91315

View file

@ -1,9 +1,9 @@
if test "x$ac_cv_header_pthread_h" = "xyes"; then if test "x$ac_cv_header_pthread_h" = "xyes"; then
save_ldflags="$LDFLAGS" save_LIBS="$LIBS"
case "$host_os" in case "$host_os" in
*qnx*) dnl qnx have all pthread* functions in the libc. *qnx*) dnl qnx have all pthread* functions in the libc.
;; ;;
*) LDFLAGS="$LDFLAGS -lpthread" *) LIBS="$LIBS -lpthread"
AC_TRY_LINK( AC_TRY_LINK(
[#include <pthread.h>], [#include <pthread.h>],
[pthread_attr_t type; [pthread_attr_t type;
@ -13,7 +13,7 @@ if test "x$ac_cv_header_pthread_h" = "xyes"; then
) )
;; ;;
esac esac
LDFLAGS="$save_ldflags" LIBS="$save_LIBS"
PTHREAD_CFLAGS=-D_REENTRANT PTHREAD_CFLAGS=-D_REENTRANT
fi fi
AC_SUBST(PTHREAD_LDFLAGS) AC_SUBST(PTHREAD_LDFLAGS)