1 package SDL::Build::MSWin32;
6 use File::Spec::Functions;
10 die "Environment variable INCLUDE is empty\n" unless $ENV{INCLUDE};
12 return map { $_ => 1 } grep { $_ } split( ';', $ENV{INCLUDE} );
17 for my $key (qw( LIBS PATH ))
19 die "Environment variable $key is empty\n" unless $ENV{$key};
22 my ( $self, $header, $includes ) = @_;
23 ( my $dll = $header ) =~ s/\.h/\.dll/;
27 for my $inc_dir ( keys %$includes )
29 next unless -e catfile( $inc_dir, $header );
30 $include_dir = $inc_dir;
33 return unless $include_dir;
35 for my $lib_path ( map { split(';', ( $ENV{$_} || '' )) }
38 return ( $include_dir, $header ) if -e catfile( $lib_path, $dll );
55 my $subsystems = $self->SUPER::subsystems();
56 my $gl_ss_method = $self->gl_vendor( $ENV{SDL_GL_VENDOR} ) . '_subsystems';
58 $subsystems->{OpenGL}{libraries} = $self->$gl_ss_method();
65 my $libraries = $self->SUPER::libraries();
66 my $gl_lib_method = $self->gl_vendor( $ENV{SDL_GL_VENDOR} ) . '_libraries';
68 $libraries->{OpenGL}{define} .= ' -D' . $self->$gl_lib_method();
74 my ( $self, $vendor ) = @_;
76 return 'ms_gl' unless defined $vendor;
78 return 'mesa_gl' if $vendor eq 'MESA';
79 return 'ms_gl' if $vendor eq 'MS';
81 die "Unrecognized GL vendor '$vendor'\n";
86 return [qw( OpenGL GLU )];
89 sub mesa_gl_subsystems
91 return [qw( mesagl mesaglu osmesa )];
96 define => 'OPENGL_VENDOR_MS';
101 define => 'OPENGL_VENDOR_MESA';
107 my ( $blib, $rib ) = @_;
109 # until ExtUtils::ParseXS is patched, avoid warnings from cl.exe
112 $rib =~ s{^src[\\/]}{};
113 $rib =~ s{[\\/]}{::}g;
115 local $self->{properties}{module_name} = $rib;
116 $self->SUPER::link_c( @_ );