From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M5lg8-00019y-LU for qemu-devel@nongnu.org; Sun, 17 May 2009 15:05:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M5lg5-00013e-Pj for qemu-devel@nongnu.org; Sun, 17 May 2009 15:05:44 -0400 Received: from [199.232.76.173] (port=46241 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M5lg3-00013L-9u for qemu-devel@nongnu.org; Sun, 17 May 2009 15:05:39 -0400 Received: from mail.gmx.net ([213.165.64.20]:46517) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1M5lg2-0004rh-DN for qemu-devel@nongnu.org; Sun, 17 May 2009 15:05:38 -0400 Date: Sun, 17 May 2009 21:05:20 +0200 Message-Id: <1242587120$3432@local> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit From: Sebastian Herbszt Subject: [Qemu-devel] [PATCH] Add detection of pthread library name List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: herbszt@gmx.de Try to detect the name of the pthread library. Currently it looks for "-pthread" and "-pthreadGC2". Signed-off-by: Sebastian Herbszt --- 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 -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