qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT de65fe0] Add detection of pthread library name


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT de65fe0] Add detection of pthread library name
Date: Mon, 08 Jun 2009 13:03:12 -0000

From: Sebastian Herbszt <address@hidden>

Try to detect the name of the pthread library.
Currently it looks for "-pthread" and "-pthreadGC2".

Signed-off-by: Sebastian Herbszt <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/configure b/configure
index b6d18d1..21c0633 100755
--- a/configure
+++ b/configure
@@ -1155,18 +1155,22 @@ fi
 
 ##########################################
 # pthread probe
+PTHREADLIBS_LIST="-lpthread -lpthreadGC2"
 PTHREADLIBS=""
 
 if test "$pthread" = yes; then
   pthread=no
 cat > $TMPC << EOF
 #include <pthread.h>
-int main(void) { pthread_mutex_t lock;  return 0; }
+int main(void) { pthread_create(0,0,0,0); return 0; }
 EOF
-  if $cc $ARCH_CFLAGS -o $TMPE $PTHREADLIBS $TMPC 2> /dev/null > /dev/null ; 
then
-    pthread=yes
-    PTHREADLIBS="-lpthread"
-  fi
+  for pthread_lib in $PTHREADLIBS_LIST; do
+    if $cc $ARCH_CFLAGS -o $TMPE $TMPC $pthread_lib 2> /dev/null > /dev/null ; 
then
+      pthread=yes
+      PTHREADLIBS="$pthread_lib"
+      break
+    fi
+  done
 fi
 
 if test "$pthread" = no; then




reply via email to

[Prev in Thread] Current Thread [Next in Thread]