#! /usr/bin/perl

use strict;
use Cwd;
use File::Spec;

BEGIN {
  $^W = 1;  # Use warnings
  my $curdir = File::Spec->canonpath( Cwd::cwd() );
  my $is_same_dir = $^O eq 'MSWin32' ? (Win32::GetShortPathName($curdir) eq '/home/mhosken/Work/Shoebox/trunk')
                                       : ($curdir eq '/home/mhosken/Work/Shoebox/trunk');
  unless ($is_same_dir) {
    die ('This script must be run from /home/mhosken/Work/Shoebox/trunk, not '.$curdir."\n".
	 "Please re-run the Build.PL script here.\n");
  }
  unshift @INC,
    (
     '/home/mhosken/Work/Shoebox/trunk/CODE(0x85dd7e8)',
     '/home/mhosken/Work/Shoebox/trunk/inc',
     '/usr/local/share/perl/5.8.7',
     '/usr/local/share/perl/5.8.7/CPANPLUS/inc',
     '/usr/local/share/perl/5.8.7/CPANPLUS/inc/installers'
    );
}

use Module::Build;

# Some platforms have problems setting $^X in shebang contexts, fix it up here
$^X = Module::Build->find_perl_interpreter
  unless File::Spec->file_name_is_absolute($^X);

if (-e 'Build.PL' and not Module::Build->up_to_date("Build.PL", $0)) {
   warn "Warning: Build.PL has been altered.  You may need to run 'perl Build.PL' again.\n";
}

# This should have just enough arguments to be able to bootstrap the rest.
my $build = Module::Build->resume (
  properties => {
    config_dir => '/home/mhosken/Work/Shoebox/trunk/_build',
  },
);

$build->dispatch;
