[Module-build-general] PATCH: More EU::MM compatibility, plus "pollute" and "inc"
Status: Beta
Brought to you by:
kwilliams
|
From: Dave R. <au...@ur...> - 2003-05-03 16:35:34
|
This patch adds support for "pollute" and "inc" parameters. The first is only allowed from the command line, because I just assume that module authors aren't going to specify this in a distro (which may not be a good assumption), and the latter is allowed either from the command line or when creating the M::B object. This patch also adds translations for more EU::MM command line parameters. Finally, it changes M::B::Compat to just warn if it gets a parameter it can't translate, as opposed to dying. Patch after sig. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ Index: lib/Module/Build/Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.101 diff -u -r1.101 Base.pm --- lib/Module/Build/Base.pm 2 May 2003 22:18:53 -0000 1.101 +++ lib/Module/Build/Base.pm 3 May 2003 16:33:50 -0000 @@ -192,6 +192,7 @@ c_source autosplit create_makefile_pl + pollute ); sub valid_property { exists $valid_properties{$_[1]} } @@ -1271,7 +1272,9 @@ my $coredir = File::Spec->catdir($cf->{archlib}, 'CORE'); my @include_dirs = $self->{include_dirs} ? map {"-I$_"} @{$self->{include_dirs}} : (); + push @include_dirs, $self->split_like_shell($self->{args}{inc}) if $self->{args}{inc}; my @ccflags = $self->split_like_shell($cf->{ccflags}); + push @ccflags, '-DPERL_POLLUTE' if $self->{properties}{pollute} || $self->{args}{pollute}; my @optimize = $self->split_like_shell($cf->{optimize}); $self->do_system($cf->{cc}, @include_dirs, '-c', @ccflags, @optimize, "-I$coredir", '-o', $obj_file, $file) or die "error building $cf->{dlext} file from '$file'"; Index: lib/Module/Build/Compat.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Compat.pm,v retrieving revision 1.17 diff -u -r1.17 Compat.pm --- lib/Module/Build/Compat.pm 2 May 2003 22:17:51 -0000 1.17 +++ lib/Module/Build/Compat.pm 3 May 2003 16:33:50 -0000 @@ -11,6 +11,12 @@ ( PREFIX => 'prefix', LIB => 'lib', + UNINST => 'uninst', + TEST_VERBOSE => 'verbose', + VERBINST => 'verbose', + TEST_FILE => 'test_files', + POLLUTE => 'pollute', + INC => 'inc', ); sub create_makefile_pl { @@ -90,7 +96,7 @@ } elsif (exists $makefile_to_build{$key}) { push @out, "$makefile_to_build{$key}=$val"; } else { - die "Unknown parameter '$key'"; + warn "Unknown parameter '$key'"; } } return @out; |