aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorSebastian Herbszt <herbszt@gmx.de>2009-05-24 22:07:53 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-28 02:14:56 -0500
commitde65fe0f9b25bb2257b0188e06f472991c87ce47 (patch)
treec6d896672e80ff2523eada8dc08ab8df9237d656 /configure
parent1c6ed9f3379faac83da0ed3e95cbd49003ac0dd1 (diff)
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>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure14
1 files changed, 9 insertions, 5 deletions
diff --git a/configure b/configure
index b6d18d1453..21c0633b20 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