Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
made -M SDL and -M Alien::SDL more critical
gave more features to SDLpp:
-n tag to include folders
-m tag to add more modules
  • Loading branch information
Kartik Thakore committed May 14, 2010
1 parent 281c6c8 commit eabffdc
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions scripts/SDLpp.pl
Expand Up @@ -20,7 +20,7 @@ =head1 SETUP
=head1 USAGE
perl SDLpp.pl --output=a.exe --input=script.pl
perl SDLpp.pl --output=a.exe --input=script.pl --nclude=./lib --more=Foo::Bar,Bar::Foo
=head1 AUTHOR
Expand Down Expand Up @@ -51,16 +51,25 @@ =head1 AUTHOR

my $input;

my $Include = '';

my $extra = '';

my $result = GetOptions(
"ouput=s" => \$output,
"libs=s" => \$libs,
"input=s" => \$input,
"nclude=s" => \$Include,
"more=s" => \$extra,
"help" => sub { usage() },
);

$extra ='-M '.$extra;
$extra =~ s/,/ \-M /g;

sub usage
{
print " perl SDLpp.pl --output=a.exe --libs=SDL,SDL_main,SDL_gfx --input=script.pl \n".
print " perl SDLpp.pl --output=a.exe --libs=SDL,SDL_main,SDL_gfx --input=script.pl --nclude=./lib --more=Foo::Bar,Bar::Foo \n".
" if --libs is not define all SDL libs are packaged \n";

exit;
Expand All @@ -77,9 +86,15 @@ sub usage

print "BUILDING PAR \n";
my $exclude_modules = '-X Alien::SDL::ConfigData -X SDL::ConfigData';
my $include_modules = '-M ExtUtils::CBuilder::Base -M Data::Dumper';
my $include_modules = '-M ExtUtils::CBuilder::Base -M Data::Dumper -M SDL -M Alien::SDL';
$include_modules .= " $extra" if $extra;

my $out_par = $output.'.par';
my $par_cmd = "pp -B $exclude_modules $include_modules -p -o $out_par $input";
my $par_cmd = "pp -B $exclude_modules $include_modules";
$par_cmd .= " -I $Include" if $Include;
$par_cmd .= " -p -o $out_par $input";

print "\t $par_cmd \n";

`$par_cmd` if ! -e $out_par;

Expand Down

0 comments on commit eabffdc

Please sign in to comment.