mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-07 18:57:14 +00:00
Add detection of pthread library name
Try to detect the name of the pthread library. Currently it looks for "-pthread" and "-pthreadGC2". Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
1c6ed9f337
commit
de65fe0f9b
14
configure
vendored
14
configure
vendored
@ -1155,18 +1155,22 @@ fi
|
|||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# pthread probe
|
# pthread probe
|
||||||
|
PTHREADLIBS_LIST="-lpthread -lpthreadGC2"
|
||||||
PTHREADLIBS=""
|
PTHREADLIBS=""
|
||||||
|
|
||||||
if test "$pthread" = yes; then
|
if test "$pthread" = yes; then
|
||||||
pthread=no
|
pthread=no
|
||||||
cat > $TMPC << EOF
|
cat > $TMPC << EOF
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
int main(void) { pthread_mutex_t lock; return 0; }
|
int main(void) { pthread_create(0,0,0,0); return 0; }
|
||||||
EOF
|
EOF
|
||||||
if $cc $ARCH_CFLAGS -o $TMPE $PTHREADLIBS $TMPC 2> /dev/null > /dev/null ; then
|
for pthread_lib in $PTHREADLIBS_LIST; do
|
||||||
pthread=yes
|
if $cc $ARCH_CFLAGS -o $TMPE $TMPC $pthread_lib 2> /dev/null > /dev/null ; then
|
||||||
PTHREADLIBS="-lpthread"
|
pthread=yes
|
||||||
fi
|
PTHREADLIBS="$pthread_lib"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$pthread" = no; then
|
if test "$pthread" = no; then
|
||||||
|
Loading…
Reference in New Issue
Block a user