On Tue, 2005-01-04 at 21:54 +0000, Krystian Samp wrote:

Hi Krystian,

> I've found also that during build process when compiling some sources
> there is cc parameter:
> 
>       -I/usr/X11R6/include/GL
> 
> should be:
> 
>       -I/usr/X11R6/include
>
> beceuse sources always include Gl/gl.h etc. I couldn't fix it in good
> manner so i just made another copy of OpenGL files in
> /usr/X11R6/include/GL/GL. it worked well...

Ah, that's a limitation of SDL::Build::find_header().  It should look
for GL/gl.h instead of only gl.h.  I will think on how to fix that.

> there are other problems with two tests: mixerpm.t and timerpm.t:
> 
>       t/mixerpm........../usr/libexec/ld-elf.so.1:
>       /usr/local/lib/libSDL-1.1.so.7: Undefined symbol
>       "pthread_mutexattr_init"
> 
>       t/timerpm........../usr/libexec/ld-elf.so.1:
>       /usr/local/lib/libSDL-1.1.so.7: Undefined symbol "sem_init"
> 
> i think it is beceuse of bad cc parameter (including posix threads like
> libraries?). in bsd systems -pthread parameter is required and i hope it will
> fix this problem:
> 
>       cc ... -pthread ...
> 
> i hope all this will help in some way. thanks and good luck with SDL.

Does the attached patch fix that?

-- c


Index: build_lib/SDL/Build/Freebsd.pm
===================================================================
--- build_lib/SDL/Build/Freebsd.pm	(revision 652)
+++ build_lib/SDL/Build/Freebsd.pm	(working copy)
@@ -1,29 +1,42 @@
-package SDL::Build::Linux;
+package SDL::Build::Freebsd;
 
 use base 'SDL::Build';
 
 sub fetch_includes
 {
 	return (
-	'/usr/local/include/SDL11' => '/usr/local/lib',
+		'/usr/local/include/SDL11' => '/usr/local/lib',
 
-	'/usr/local/include'       => '/usr/local/lib',
-	'/usr/local/include/gl'    => '/usr/local/lib',
-	'/usr/local/include/GL'    => '/usr/local/lib',
-	'/usr/local/include/SDL'   => '/usr/local/lib',
-	'/usr/local/include/smpeg' => '/usr/local/lib',
+		'/usr/local/include'       => '/usr/local/lib',
+		'/usr/local/include/gl'    => '/usr/local/lib',
+		'/usr/local/include/GL'    => '/usr/local/lib',
+		'/usr/local/include/SDL'   => '/usr/local/lib',
+		'/usr/local/include/smpeg' => '/usr/local/lib',
 
-	'/usr/include'              => '/usr/lib',
-	'/usr/include/gl'           => '/usr/lib',
-	'/usr/include/GL'           => '/usr/lib',
-	'/usr/include/SDL'          => '/usr/lib',
-	'/usr/include/smpeg'        => '/usr/lib',
+		'/usr/include'       => '/usr/lib',
+		'/usr/include/gl'    => '/usr/lib',
+		'/usr/include/GL'    => '/usr/lib',
+		'/usr/include/SDL'   => '/usr/lib',
+		'/usr/include/smpeg' => '/usr/lib',
 
-	'/usr/X11R6/include'        => '/usr/X11R6/lib',
-	'/usr/X11R6/include/gl'     => '/usr/X11R6/lib',
-	'/usr/X11R6/include/GL'     => '/usr/X11R6/lib',
+		'/usr/X11R6/include'    => '/usr/X11R6/lib',
+		'/usr/X11R6/include/gl' => '/usr/X11R6/lib',
+		'/usr/X11R6/include/GL' => '/usr/X11R6/lib',
 
 	);
 }
 
+sub build_links
+{
+	my $self  = shift;
+	my $links = $self->SUPER::build_links();
+
+	for my $subsystem ( values %$links )
+	{
+		push @{ $subsystem{libs} }, '-pthread';
+	}
+
+	return $links;
+}
+
 1;

Reply via email to