Munge pseudo-Configure stuff to add -thread to archname as
[p5sagit/p5-mst-13.2.git] / hints / linux.sh
index 8ddb765..af7d0a8 100644 (file)
@@ -202,3 +202,14 @@ fi
 # it should be:
 # ccdlflags='-Wl,-E'
 
+if [ "X$usethreads" != "X" ]; then
+    ccflags="-D_REENTRANT -DUSE_THREADS $ccflags"
+    cppflags="-D_REENTRANT -DUSE_THREADS $cppflags"
+    # -lpthread needs to come before -lc but after other libraries such
+    # as -lgdbm and such like. We assume here that -lc is present in
+    # libswanted. If that fails to be true in future, then this can be
+    # changed to add pthread to the very end of libswanted.
+    set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
+    shift
+    libswanted="$*"
+fi