3 # Copyright (C) 2003 chromatic
4 # Copyright (C) 2004 David J. Goehrig
5 # Copyright (C) 2009 Kartik Thakore
18 my $sdl_compile_flags = SDL::Utility->sdl_c_flags();
19 my $sdl_link_flags = SDL::Utility->sdl_libs();
22 # location of source file => location of build file to get name right
24 # name of shared library (soname)
25 # preprocessor definition
32 to => './SDL_perl.xs',
34 libraries => [qw( SDL SDL_image SDL_mixer SDL_net SDL_ttf SDL_gfx
39 from => 'src/OpenGL.xs',
40 to => 'SDL/OpenGL.xs',
42 libraries => [qw( SDL GL GLU )],
46 from => 'src/SFont.xs',
49 libraries => [qw( SDL SDL_image )],
59 define => 'HAVE_SDL_IMAGE',
60 header => 'SDL_image.h'
63 define => 'HAVE_SDL_MIXER',
64 header => 'SDL_mixer.h'
67 define => 'HAVE_SDL_NET',
71 define => 'HAVE_SDL_TTF',
75 define => 'HAVE_SDL_GFX',
76 header => 'SDL_gfxPrimitives.h'
83 define => 'HAVE_JPEG',
84 header => 'jpeglib.h',
87 define => 'HAVE_SMPEG',
100 # need the platform-specific module to find include paths correctly
101 # see build/lib/SDL/Build/*pm
102 my $arch = SDL::Build->get_arch( $^O );
104 # see which subsystems can be built -- do we have headers for them?
105 my $build_systems = $arch->find_subsystems( \%subsystems, \%libraries );
107 # now write SDL::Config
108 $arch->write_sdl_config( $build_systems );
110 # and fetch all of the information needed to compile
111 my $defines = $arch->build_defines( \%libraries, $build_systems );
112 my $includes = $arch->build_includes( \%libraries, $build_systems );
113 my $links = $arch->build_links( \%libraries, $build_systems );
115 # mangle the compilable files into a format Module::Build can understand
116 my %xs = map { $subsystems{$_}{file}{from} => $subsystems{$_}{file}{to} }
118 my $build = SDL::Build->new(
119 module_name => 'SDL',
120 dist_name => 'SDL_Perl',
122 dist_version_from => 'lib/SDL.pm',
125 'Test::Simple' => '0.47',
126 'Module::Build' => '0.22',
131 'Pod::ToDemo' => '0.20',
135 dist_author => 'David J. Goehrig <DGOEHRIG@cpan.org>',
138 # and here's where the real (and ugly) magic works... see SDL::Build
148 # now we're ready to go!
149 $build->create_build_script();