3 # Copyright (C) 2003 chromatic
4 # Copyright (C) 2004 David J. Goehrig
5 # Copyright (C) 2009 Kartik Thakore
18 print STDERR <<BROKENWIN if ($^O =~ /MSWin.*|cygwin/ );
19 ******************************** !!!WARNING!!! ********************************
20 Windows support is currently experimental - you can continue, but you've been warned!
21 If you are interested in helping please contact us at sdl-devel\@perl.org.
22 *******************************************************************************
25 my $sdl_compile_flags = SDL::Utility->sdl_c_flags();
26 my $sdl_link_flags = SDL::Utility->sdl_libs();
29 # location of source file => location of build file to get name right
31 # name of shared library (soname)
32 # preprocessor definition
39 to => 'lib/SDL_perl.xs',
41 libraries => [qw( SDL SDL_image SDL_mixer SDL_net SDL_ttf SDL_gfx
46 from => 'src/OpenGL.xs',
47 to => 'lib/SDL/OpenGL.xs',
49 libraries => [qw( SDL GL GLU )],
53 from => 'src/SFont.xs',
54 to => 'lib/SDL/SFont.xs',
56 libraries => [qw( SDL SDL_image )],
66 define => 'HAVE_SDL_IMAGE',
67 header => 'SDL_image.h'
70 define => 'HAVE_SDL_MIXER',
71 header => 'SDL_mixer.h'
74 define => 'HAVE_SDL_NET',
78 define => 'HAVE_SDL_TTF',
82 define => 'HAVE_SDL_GFX',
83 header => 'SDL_gfxPrimitives.h'
90 define => 'HAVE_JPEG',
91 header => 'jpeglib.h',
94 define => 'HAVE_SMPEG',
102 define => 'HAVE_GLU',
107 # need the platform-specific module to find include paths correctly
108 # see build/lib/SDL/Build/*pm
109 my $arch = SDL::Build->get_arch( $^O );
111 # see which subsystems can be built -- do we have headers for them?
112 my $build_systems = $arch->find_subsystems( \%subsystems, \%libraries );
114 # now write SDL::Config
115 $arch->write_sdl_config( $build_systems );
117 # and fetch all of the information needed to compile
118 my $defines = $arch->build_defines( \%libraries, $build_systems );
119 my $includes = $arch->build_includes( \%libraries, $build_systems );
120 my $links = $arch->build_links( \%libraries, $build_systems );
122 # mangle the compilable files into a format Module::Build can understand
123 my %xs = map { $subsystems{$_}{file}{from} => $subsystems{$_}{file}{to} }
125 my $build = SDL::Build->new(
126 module_name => 'SDL',
127 dist_name => 'SDL_Perl',
129 dist_version_from => 'lib/SDL.pm',
132 'Test::Simple' => '0.47',
133 'Module::Build' => '0.22',
135 'Alien::SDL' => '0.02',
136 'ExtUtils::CBuilder' => '0.260301'
140 'Pod::ToDemo' => '0.20'
146 no_index => { file => [ <make/lib/SDL/*.pm>, <make/lib/SDL/Build/*.pm> ] },
148 dist_author => 'David J. Goehrig <DGOEHRIG@cpan.org>',
152 # and here's where the real (and ugly) magic works... see SDL::Build
162 # now we're ready to go!
163 $build->create_build_script();