On Linux, don't compile with -DTHREADS_HAVE_PIDS if the
Rafael Garcia-Suarez [Mon, 26 Mar 2007 10:09:21 +0000 (10:09 +0000)]
kernel uses the NPTL threading model

p4raw-id: //depot/perl@30758

hints/linux.sh

index bd6afd2..fea63e0 100644 (file)
@@ -308,9 +308,15 @@ fi
 # This script UU/usethreads.cbu will get 'called-back' by Configure
 # after it has prompted the user for whether to use threads.
 cat > UU/usethreads.cbu <<'EOCBU'
+if getconf GNU_LIBPTHREAD_VERSION | grep NPTL >/dev/null 2>/dev/null
+then
+    threadshavepids=""
+else
+    threadshavepids="-DTHREADS_HAVE_PIDS"
+fi
 case "$usethreads" in
 $define|true|[yY]*)
-        ccflags="-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS $ccflags"
+        ccflags="-D_REENTRANT -D_GNU_SOURCE $threadshavepids $ccflags"
         if echo $libswanted | grep -v pthread >/dev/null
         then
             set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`