#!/Perl/bin/perl # copyright (c) 2003 chromatic # copyright (c) 2004 David J. Goehrig use strict; use warnings; use lib 'build_lib'; use SDL::Build; # need the platform-specific module to find include paths correctly # see build/lib/SDL/Build/*pm my $arch = SDL::Build->get_arch( $^O ); my $subsystems = $arch->subsystems(); my $libraries = $arch->libraries(); # see which subsystems to build -- do we have headers for them? my $build_systems = $arch->find_subsystems( $subsystems, $libraries ); # now write SDL::Config $arch->write_sdl_config( $build_systems ); # and fetch all of the information needed to compile my $defines = $arch->build_defines( $libraries, $build_systems ); my $includes = $arch->build_includes( $libraries, $build_systems ); my $links = $arch->build_links( $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; my $build = $arch->new( dist_name => 'SDL_Perl', dist_author => 'David J. Goehrig ', dist_version_from => 'lib/SDL.pm', license => 'lgpl', build_requires => { 'Test::Simple' => '0.47', }, build_recommends => { 'Pod::ToDemo' => '0.20', }, xs_files => \%xs, ); # and here's where the real (and ugly) magic works... see SDL::Build $build->set_flags( $subsystems, $build_systems, $defines, $includes, $links, ); # now we're ready to go! $build->create_build_script();