# New Ticket Created by  Lars Balker Rasmussen 
# Please include the string:  [perl #24333]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24333 >


The pthreads library seems to be missing on the FreeBSD 4.8 and 5.0
machines I have access to.  I don't know what, if any, FreeBSD'en
should happen to have that library...

There are two ways to link in the pthreads-stuff on FreeBSD - I have
taken the method from the ports systems makefile to decide between them.

Cheers,
-- 
Lars Balker Rasmussen                                      Consult::Perl



-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/66601/49754/a42ce2/freebsd.patch

Index: config/init/hints/freebsd.pl
===================================================================
RCS file: /cvs/public/parrot/config/init/hints/freebsd.pl,v
retrieving revision 1.1
diff -u -a -r1.1 freebsd.pl
--- config/init/hints/freebsd.pl	10 Oct 2003 07:43:05 -0000	1.1
+++ config/init/hints/freebsd.pl	28 Oct 2003 13:16:39 -0000
@@ -1,7 +1,28 @@
 my $libs = Configure::Data->get('libs');
-if ( $libs !~ /-lpthreads/ ) {
-    $libs .= ' -lpthreads';
+
+# get rid of old pthread-stuff, if any
+$libs =~ s/(-lpthreads|-lc_r)\b\s*//g;
+
+# The following test is from FreeBSD's /usr/ports/Mk/bsd.port.mk,
+# which must be assumed to do the right thing.
+
+my $osversion;
+if (-e "/sbin/sysctl") {
+    $osversion = `/sbin/sysctl -n kern.osreldate`;
 }
+else {
+    $osversion = `/usr/sbin/sysctl -n kern.osreldate`;
+}
+chomp $osversion;
+
+if ($osversion < 500036) { 
+    $libs .= ' -pthread';
+}
+else {
+    $libs =~ s/-lc\b\s*//;
+    $libs .= ' -lc_r';
+}
+
 Configure::Data->set(
     libs => $libs,
 );

Reply via email to