3 # Copyright (C) 2003 chromatic
4 # Copyright (C) 2004 David J. Goehrig
5 # Copyright (C) 2009 Kartik Thakore
18 croak 'Windows support is currently broken. If you are interested in helping please contact us at sdl-devel\@perl.org.' if ($^O =~ /MSWin*|cygwin/ );
20 my $sdl_compile_flags = SDL::Utility->sdl_c_flags();
21 my $sdl_link_flags = SDL::Utility->sdl_libs();
24 # location of source file => location of build file to get name right
26 # name of shared library (soname)
27 # preprocessor definition
34 to => './SDL_perl.xs',
36 libraries => [qw( SDL SDL_image SDL_mixer SDL_net SDL_ttf SDL_gfx
41 from => 'src/OpenGL.xs',
42 to => 'SDL/OpenGL.xs',
44 libraries => [qw( SDL GL GLU )],
48 from => 'src/SFont.xs',
51 libraries => [qw( SDL SDL_image )],
61 define => 'HAVE_SDL_IMAGE',
62 header => 'SDL_image.h'
65 define => 'HAVE_SDL_MIXER',
66 header => 'SDL_mixer.h'
69 define => 'HAVE_SDL_NET',
73 define => 'HAVE_SDL_TTF',
77 define => 'HAVE_SDL_GFX',
78 header => 'SDL_gfxPrimitives.h'
85 define => 'HAVE_JPEG',
86 header => 'jpeglib.h',
89 define => 'HAVE_SMPEG',
102 # need the platform-specific module to find include paths correctly
103 # see build/lib/SDL/Build/*pm
104 my $arch = SDL::Build->get_arch( $^O );
106 # see which subsystems can be built -- do we have headers for them?
107 my $build_systems = $arch->find_subsystems( \%subsystems, \%libraries );
109 # now write SDL::Config
110 $arch->write_sdl_config( $build_systems );
112 # and fetch all of the information needed to compile
113 my $defines = $arch->build_defines( \%libraries, $build_systems );
114 my $includes = $arch->build_includes( \%libraries, $build_systems );
115 my $links = $arch->build_links( \%libraries, $build_systems );
117 # mangle the compilable files into a format Module::Build can understand
118 my %xs = map { $subsystems{$_}{file}{from} => $subsystems{$_}{file}{to} }
120 my $build = SDL::Build->new(
121 module_name => 'SDL',
122 dist_name => 'SDL_Perl',
124 dist_version_from => 'lib/SDL.pm',
127 'Test::Simple' => '0.47',
128 'Module::Build' => '0.22',
133 'Pod::ToDemo' => '0.20',
139 no_index => { file => [ <make/lib/SDL/*.pm>, <make/lib/SDL/Build/*.pm> ] },
141 dist_author => 'David J. Goehrig <DGOEHRIG@cpan.org>',
144 # and here's where the real (and ugly) magic works... see SDL::Build
154 # now we're ready to go!
155 $build->create_build_script();