Fixed some merge errors in MSWin32.pm. Also seperated Darwin specific build flags...
Kartik Thakore [Tue, 4 Aug 2009 23:06:21 +0000 (19:06 -0400)]
Build.PL
lib/SDL/Config.pm
make/lib/SDL/Build/MSWin32.pm

index c841997..4a58923 100644 (file)
--- a/Build.PL
+++ b/Build.PL
@@ -43,7 +43,7 @@ my $sdl_link_flags    = `sdl-config --libs`;
 if ($? >> 8)
 {
        croak "SDL doesn't appear to be installed.\n" .
-               "Please check that sdl-config is in your path and try again.\n";
+       "Please check that sdl-config is in your path and try again.\n";
 }
 
 chomp( $sdl_compile_flags );
@@ -64,7 +64,7 @@ my %subsystems =
                        to    => 'src/SDL_perl.xs',
                },
                libraries => [qw( SDL SDL_image SDL_mixer SDL_sound SDL_net SDL_ttf 
-                               SDL_gfx SDL_svg png jpeg smpeg )],
+               SDL_gfx SDL_svg png jpeg smpeg )],
        },
        OpenGL => {
                file      => {
@@ -153,13 +153,10 @@ $arch->write_sdl_config( $build_systems );
 my $defines    = $arch->build_defines( \%libraries, $build_systems );
 my $includes   = $arch->build_includes( \%libraries, $build_systems );
 my $links      = $arch->build_links( \%libraries, $build_systems );
-my $c_sources  = $arch->build_c_sources( \%libraries, $build_systems );
-my $c_source   = $arch->build_c_source( \%libraries, $build_systems );
-my $install_base = $arch->build_install_base( \%libraries, $build_systems );
 
 # mangle the compilable files into a format Module::Build can understand
 my %xs = map { $subsystems{$_}{file}{from} => $subsystems{$_}{file}{to} }
-            keys %subsystems;
+keys %subsystems;
 
 my $build   = SDL::Build->new(
        dist_name            => 'SDL_Perl', 
@@ -174,14 +171,18 @@ my $build   = SDL::Build->new(
        {
                'Pod::ToDemo'  => '0.20',
        },
-       c_source => $c_source,
-       c_sources => $c_sources,
+       c_source => 'src',
        xs_files             => \%xs,
        dist_author          => 'David J. Goehrig <DGOEHRIG@cpan.org>',
-       install_base => $install_base
 );
 
-# and here's where the real (and ugly) magic works... see SDL::Build
+if($arch eq 'Darwin')
+{
+       $build->{c_source} = $arch->build_c_source( \%libraries, $build_systems );
+       $build->{c_sources} = $arch->build_c_sources( \%libraries, $build_systems );
+       $build->{install_base} = $arch->build_install_base( \%libraries, $build_systems );
+
+}
 $build->set_flags(
        \%subsystems,
        $build_systems,
index 3d9b731..c75c9f7 100644 (file)
@@ -4,31 +4,70 @@ my $sdl_config;
 $sdl_config = {
                 'OpenGL' => {
                               'GL' => [
-                                        '/System/Library/Frameworks/OpenGL.framework/Headers',
-                                        '/System/Library/Frameworks/OpenGL.framework/Libraries'
+                                        '/usr/include/GL',
+                                        '/usr/lib'
                                       ],
-                              'SDL' => 0,
+                              'SDL' => [
+                                         '/usr/include/SDL',
+                                         '/usr/lib'
+                                       ],
                               'GLU' => [
-                                         '/System/Library/Frameworks/OpenGL.framework/Headers',
-                                         '/System/Library/Frameworks/OpenGL.framework/Libraries'
+                                         '/usr/include/GL',
+                                         '/usr/lib'
                                        ]
                             },
                 'SDL' => {
-                           'png' => 0,
-                           'SDL' => 0,
-                           'SDL_ttf' => 0,
+                           'png' => [
+                                      '/usr/include',
+                                      '/usr/lib'
+                                    ],
+                           'SDL' => [
+                                      '/usr/include/SDL',
+                                      '/usr/lib'
+                                    ],
+                           'SDL_ttf' => [
+                                          '/usr/include/SDL',
+                                          '/usr/lib'
+                                        ],
                            'SDL_svg' => 0,
-                           'SDL_net' => 0,
-                           'SDL_image' => 0,
-                           'jpeg' => 0,
-                           'SDL_gfx' => 0,
-                           'smpeg' => 0,
-                           'SDL_sound' => 0,
-                           'SDL_mixer' => 0
+                           'SDL_net' => [
+                                          '/usr/include/SDL',
+                                          '/usr/lib'
+                                        ],
+                           'SDL_image' => [
+                                            '/usr/include/SDL',
+                                            '/usr/lib'
+                                          ],
+                           'jpeg' => [
+                                       '/usr/include',
+                                       '/usr/lib'
+                                     ],
+                           'SDL_gfx' => [
+                                          '/usr/include/SDL',
+                                          '/usr/lib'
+                                        ],
+                           'smpeg' => [
+                                        '/usr/include/smpeg',
+                                        '/usr/lib'
+                                      ],
+                           'SDL_sound' => [
+                                            '/usr/include/SDL',
+                                            '/usr/lib'
+                                          ],
+                           'SDL_mixer' => [
+                                            '/usr/include/SDL',
+                                            '/usr/lib'
+                                          ]
                          },
                 'SFont' => {
-                             'SDL_image' => 0,
-                             'SDL' => 0
+                             'SDL_image' => [
+                                              '/usr/include/SDL',
+                                              '/usr/lib'
+                                            ],
+                             'SDL' => [
+                                        '/usr/include/SDL',
+                                        '/usr/lib'
+                                      ]
                            }
               };
 
index 0760a76..402b358 100644 (file)
@@ -107,15 +107,10 @@ sub gl_vendor
        my ( $self, $vendor ) = @_;
 
        return 'ms_gl' unless defined $vendor;
-
        return 'mesa_gl' if $vendor eq 'MESA';
        return 'ms_gl'   if $vendor eq 'MS';
-
-<<<<<<< HEAD
-       die "Unrecognized GL vendor '$vendor'\n";
-=======
        croak "Unrecognized GL vendor '$vendor'\n";
->>>>>>> sdlperl-2.1.3
+
 }
 
 sub ms_gl_subsystems