This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge maint-5.004 branch (5.004_04) with mainline.
[perl5.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