mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
detect whether to use -pthread or -lpthread
This commit is contained in:
parent
eb4aa7ccec
commit
3ca9a8042a
1 changed files with 13 additions and 1 deletions
14
configure.ac
14
configure.ac
|
@ -161,7 +161,19 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$ac_cv_header_pthread_h" = "xyes"; then
|
if test "x$ac_cv_header_pthread_h" = "xyes"; then
|
||||||
PTHREAD_FLAGS=-pthread
|
echo $LDFLAGS
|
||||||
|
save_ldflags="$LDFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS -pthread"
|
||||||
|
AC_TRY_LINK(
|
||||||
|
[#include <pthread.h>],
|
||||||
|
[pthread_attr_t type;
|
||||||
|
pthread_attr_init(&type);],
|
||||||
|
[PTHREAD_FLAGS=-pthread],
|
||||||
|
[PTHREAD_FLAGS=-lpthread]
|
||||||
|
)
|
||||||
|
LDFLAGS="$save_ldflags"
|
||||||
|
echo $LDFLAGS
|
||||||
|
echo $PTHREAD_FLAGS
|
||||||
fi
|
fi
|
||||||
AC_SUBST(PTHREAD_FLAGS)
|
AC_SUBST(PTHREAD_FLAGS)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue