All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Add detection of pthread library name
@ 2009-05-17 19:05 Sebastian Herbszt
  0 siblings, 0 replies; only message in thread
From: Sebastian Herbszt @ 2009-05-17 19:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: herbszt

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

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>

--- qemu-20090517/configure.orig	2009-05-15 19:18:42.000000000 +0200
+++ qemu-20090517/configure	2009-05-17 20:56:18.000000000 +0200
@@ -1133,18 +1133,22 @@
 
 ##########################################
 # 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-17 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-17 19:05 [Qemu-devel] [PATCH] Add detection of pthread library name Sebastian Herbszt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.