Importing SDLPerl 2.2
[sdlgit/SDL_perl.git] / Build
1 #! /usr/env/bin perl
2
3 use strict;
4 use Cwd;
5 use File::Spec;
6
7 BEGIN {
8   $^W = 1;  # Use warnings
9   my $curdir = File::Spec->canonpath( Cwd::cwd() );
10   my $is_same_dir = $^O eq 'MSWin32' ? (Win32::GetShortPathName($curdir) eq '/Users/dave/sdlperl')
11                                        : ($curdir eq '/Users/dave/sdlperl');
12   unless ($is_same_dir) {
13     die ('This script must be run from /Users/dave/sdlperl, not '.$curdir."\n".
14          "Please re-run the Build.PL script here.\n");
15   }
16   unshift @INC,
17     (
18      '/Users/dave/sdlperl/make/lib'
19     );
20 }
21
22 use SDL::Build;
23
24 # Some platforms have problems setting $^X in shebang contexts, fix it up here
25 $^X = Module::Build->find_perl_interpreter
26   unless File::Spec->file_name_is_absolute($^X);
27
28 if (-e 'Build.PL' and not SDL::Build->up_to_date("Build.PL", $0)) {
29    warn "Warning: Build.PL has been altered.  You may need to run 'perl Build.PL' again.\n";
30 }
31
32 # This should have just enough arguments to be able to bootstrap the rest.
33 my $build = SDL::Build->resume (
34   properties => {
35     config_dir => '/Users/dave/sdlperl/_build',
36   },
37 );
38
39 $build->dispatch;