summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm438
1 files changed, 284 insertions, 154 deletions
diff --git a/Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm b/Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm
index 42b174fe347..d579256e86e 100644
--- a/Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm
+++ b/Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm
@@ -12,7 +12,7 @@ use Carp;
use File::Path;
my $CAN_DECODE = eval { require ExtUtils::MakeMaker::Locale; }; # 2 birds, 1 stone
eval { ExtUtils::MakeMaker::Locale::reinit('UTF-8') }
- if $CAN_DECODE and $ExtUtils::MakeMaker::Locale::ENCODING_LOCALE eq 'US-ASCII';
+ if $CAN_DECODE and Encode::find_encoding('locale')->name eq 'ascii';
our $Verbose = 0; # exported
our @Parent; # needs to be localized
@@ -24,7 +24,7 @@ my %Recognized_Att_Keys;
our %macro_fsentity; # whether a macro is a filesystem name
our %macro_dep; # whether a macro is a dependency
-our $VERSION = '7.10_02';
+our $VERSION = '7.24';
$VERSION = eval $VERSION; ## no critic [BuiltinFunctions::ProhibitStringyEval]
# Emulate something resembling CVS $Revision$
@@ -36,7 +36,8 @@ our $Filename = __FILE__; # referenced outside MakeMaker
our @ISA = qw(Exporter);
our @EXPORT = qw(&WriteMakefile $Verbose &prompt);
our @EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists
- &WriteEmptyMakefile);
+ &WriteEmptyMakefile &open_for_writing &write_file_via_tmp
+ &_sprintf562);
# These will go away once the last of the Win32 & VMS specific code is
# purged.
@@ -54,6 +55,15 @@ require ExtUtils::MY; # XXX pre-5.8 versions of ExtUtils::Embed expect
# This will go when Embed is its own CPAN module.
+# 5.6.2 can't do sprintf "%1$s" - this can only do %s
+sub _sprintf562 {
+ my ($format, @args) = @_;
+ for (my $i = 1; $i <= @args; $i++) {
+ $format =~ s#%$i\$s#$args[$i-1]#g;
+ }
+ $format;
+}
+
sub WriteMakefile {
croak "WriteMakefile: Need even number of args" if @_ % 2;
@@ -106,6 +116,7 @@ my %Special_Sigs = (
SKIP => 'ARRAY',
TYPEMAPS => 'ARRAY',
XS => 'HASH',
+ XSBUILD => 'HASH',
VERSION => ['version',''],
_KEEP_AFTER_FLUSH => '',
@@ -141,7 +152,8 @@ sub _convert_compat_attrs { #result of running several times should be same
sub _verify_att {
my($att) = @_;
- while( my($key, $val) = each %$att ) {
+ foreach my $key (sort keys %$att) {
+ my $val = $att->{$key};
my $sig = $Att_Sigs{$key};
unless( defined $sig ) {
warn "WARNING: $key is not a known parameter.\n";
@@ -301,9 +313,9 @@ sub full_setup {
PERM_DIR PERM_RW PERM_RWX MAGICXS
PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE
PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
- SIGN SKIP TEST_REQUIRES TYPEMAPS UNINST VERSION VERSION_FROM XS XSOPT XSPROTOARG
- XS_VERSION clean depend dist dynamic_lib linkext macro realclean
- tool_autosplit
+ SIGN SKIP TEST_REQUIRES TYPEMAPS UNINST VERSION VERSION_FROM XS
+ XSBUILD XSMULTI XSOPT XSPROTOARG XS_VERSION
+ clean depend dist dynamic_lib linkext macro realclean tool_autosplit
MAN1EXT MAN3EXT
@@ -405,6 +417,14 @@ sub full_setup {
);
}
+sub _has_cpan_meta_requirements {
+ return eval {
+ require CPAN::Meta::Requirements;
+ CPAN::Meta::Requirements->VERSION(2.130);
+ require B; # CMR requires this, for core we have to too.
+ };
+}
+
sub new {
my($class,$self) = @_;
my($key);
@@ -423,12 +443,53 @@ sub new {
bless $self, "MM";
# Cleanup all the module requirement bits
+ my %key2cmr;
for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) {
$self->{$key} ||= {};
- $self->clean_versions( $key );
+ if (_has_cpan_meta_requirements) {
+ my $cmr = CPAN::Meta::Requirements->from_string_hash(
+ $self->{$key},
+ {
+ bad_version_hook => sub {
+ #no warnings 'numeric'; # module doesn't use warnings
+ my $fallback;
+ if ( $_[0] =~ m!^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$! ) {
+ $fallback = sprintf "%f", $_[0];
+ } else {
+ ($fallback) = $_[0] ? ($_[0] =~ /^([0-9.]+)/) : 0;
+ $fallback += 0;
+ carp "Unparsable version '$_[0]' for prerequisite $_[1] treated as $fallback";
+ }
+ version->new($fallback);
+ },
+ },
+ );
+ $self->{$key} = $cmr->as_string_hash;
+ $key2cmr{$key} = $cmr;
+ } else {
+ for my $module (sort keys %{ $self->{$key} }) {
+ my $version = $self->{$key}->{$module};
+ my $fallback = 0;
+ if (!defined($version) or !length($version)) {
+ carp "Undefined requirement for $module treated as '0' (CPAN::Meta::Requirements not available)";
+ }
+ elsif ($version =~ /^\d+(?:\.\d+(?:_\d+)*)?$/) {
+ next;
+ }
+ else {
+ if ( $version =~ m!^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$! ) {
+ $fallback = sprintf "%f", $version;
+ } else {
+ ($fallback) = $version ? ($version =~ /^([0-9.]+)/) : 0;
+ $fallback += 0;
+ carp "Unparsable version '$version' for prerequisite $module treated as $fallback (CPAN::Meta::Requirements not available)";
+ }
+ }
+ $self->{$key}->{$module} = $fallback;
+ }
+ }
}
-
if ("@ARGV" =~ /\bPREREQ_PRINT\b/) {
$self->_PREREQ_PRINT;
}
@@ -495,9 +556,24 @@ END
my(%initial_att) = %$self; # record initial attributes
my(%unsatisfied) = ();
- my $prereqs = $self->_all_prereqs;
- foreach my $prereq (sort keys %$prereqs) {
- my $required_version = $prereqs->{$prereq};
+ my %prereq2version;
+ my $cmr;
+ if (_has_cpan_meta_requirements) {
+ $cmr = CPAN::Meta::Requirements->new;
+ for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) {
+ $cmr->add_requirements($key2cmr{$key}) if $key2cmr{$key};
+ }
+ foreach my $prereq ($cmr->required_modules) {
+ $prereq2version{$prereq} = $cmr->requirements_for_module($prereq);
+ }
+ } else {
+ for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) {
+ next unless my $module2version = $self->{$key};
+ $prereq2version{$_} = $module2version->{$_} for keys %$module2version;
+ }
+ }
+ foreach my $prereq (sort keys %prereq2version) {
+ my $required_version = $prereq2version{$prereq};
my $pr_version = 0;
my $installed_file;
@@ -516,6 +592,18 @@ END
$installed_file = MM->_installed_file_for_module($prereq);
$pr_version = MM->parse_version($installed_file) if $installed_file;
$pr_version = 0 if $pr_version eq 'undef';
+ if ( !eval { version->new( $pr_version ); 1 } ) {
+ #no warnings 'numeric'; # module doesn't use warnings
+ my $fallback;
+ if ( $pr_version =~ m!^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$! ) {
+ $fallback = sprintf '%f', $pr_version;
+ } else {
+ ($fallback) = $pr_version ? ($pr_version =~ /^([0-9.]+)/) : 0;
+ $fallback += 0;
+ carp "Unparsable version '$pr_version' for installed prerequisite $prereq treated as $fallback";
+ }
+ $pr_version = $fallback;
+ }
}
# convert X.Y_Z alpha version #s to X.YZ for easier comparisons
@@ -529,13 +617,17 @@ END
$unsatisfied{$prereq} = 'not installed';
}
- elsif ($pr_version < $required_version ){
+ elsif (
+ $cmr
+ ? !$cmr->accepts_module($prereq, $pr_version)
+ : $required_version > $pr_version
+ ) {
warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n",
$prereq, $required_version, ($pr_version || 'unknown version')
unless $self->{PREREQ_FATAL}
or $UNDER_CORE;
- $unsatisfied{$prereq} = $required_version ? $required_version : 'unknown version' ;
+ $unsatisfied{$prereq} = $required_version || 'unknown version' ;
}
}
@@ -671,7 +763,9 @@ END
$self->init_others();
$self->init_platform();
$self->init_PERM();
- my($argv) = neatvalue(\@ARGV);
+ my @args = @ARGV;
+ @args = map { Encode::decode(locale => $_) } @args if $CAN_DECODE;
+ my($argv) = neatvalue(\@args);
$argv =~ s/^\[/(/;
$argv =~ s/\]$/)/;
@@ -757,6 +851,7 @@ sub WriteEmptyMakefile {
croak "WriteEmptyMakefile: Need an even number of args" if @_ % 2;
my %att = @_;
+ $att{DIR} = [] unless $att{DIR}; # don't recurse by default
my $self = MM->new(\%att);
my $new = $self->{MAKEFILE};
@@ -771,6 +866,14 @@ sub WriteEmptyMakefile {
print $mfh <<'EOP';
all :
+manifypods :
+
+subdirs :
+
+dynamic :
+
+static :
+
clean :
install :
@@ -779,6 +882,10 @@ makemakerdflt :
test :
+test_dynamic :
+
+test_static :
+
EOP
close $mfh or die "close $new for write: $!";
}
@@ -1051,7 +1158,7 @@ sub _run_hintfile {
my($hint_file) = shift;
local($@, $!);
- warn "Processing hints file $hint_file\n";
+ print "Processing hints file $hint_file\n" if $Verbose;
# Just in case the ./ isn't on the hint file, which File::Spec can
# often strip off, we bung the curdir into @INC
@@ -1065,69 +1172,34 @@ sub _run_hintfile {
sub mv_all_methods {
my($from,$to) = @_;
-
- # Here you see the *current* list of methods that are overridable
- # from Makefile.PL via MY:: subroutines. As of VERSION 5.07 I'm
- # still trying to reduce the list to some reasonable minimum --
- # because I want to make it easier for the user. A.K.
-
local $SIG{__WARN__} = sub {
# can't use 'no warnings redefined', 5.6 only
warn @_ unless $_[0] =~ /^Subroutine .* redefined/
};
foreach my $method (@Overridable) {
-
- # We cannot say "next" here. Nick might call MY->makeaperl
- # which isn't defined right now
-
- # Above statement was written at 4.23 time when Tk-b8 was
- # around. As Tk-b9 only builds with 5.002something and MM 5 is
- # standard, we try to enable the next line again. It was
- # commented out until MM 5.23
-
next unless defined &{"${from}::$method"};
+ no strict 'refs'; ## no critic
+ *{"${to}::$method"} = \&{"${from}::$method"};
+
+ # If we delete a method, then it will be undefined and cannot
+ # be called. But as long as we have Makefile.PLs that rely on
+ # %MY:: being intact, we have to fill the hole with an
+ # inheriting method:
{
- no strict 'refs'; ## no critic
- *{"${to}::$method"} = \&{"${from}::$method"};
-
- # If we delete a method, then it will be undefined and cannot
- # be called. But as long as we have Makefile.PLs that rely on
- # %MY:: being intact, we have to fill the hole with an
- # inheriting method:
-
- {
- package MY;
- my $super = "SUPER::".$method;
- *{$method} = sub {
- shift->$super(@_);
- };
- }
+ package MY;
+ my $super = "SUPER::".$method;
+ *{$method} = sub {
+ shift->$super(@_);
+ };
}
}
-
- # We have to clean out %INC also, because the current directory is
- # changed frequently and Graham Barr prefers to get his version
- # out of a History.pl file which is "required" so wouldn't get
- # loaded again in another extension requiring a History.pl
-
- # With perl5.002_01 the deletion of entries in %INC caused Tk-b11
- # to core dump in the middle of a require statement. The required
- # file was Tk/MMutil.pm. The consequence is, we have to be
- # extremely careful when we try to give perl a reason to reload a
- # library with same name. The workaround prefers to drop nothing
- # from %INC and teach the writers not to use such libraries.
-
-# my $inc;
-# foreach $inc (keys %INC) {
-# #warn "***$inc*** deleted";
-# delete $INC{$inc};
-# }
}
sub skipcheck {
my($self) = shift;
my($section) = @_;
+ return 'skipped' if $section eq 'metafile' && $UNDER_CORE;
if ($section eq 'dynamic') {
print "Warning (non-fatal): Target 'dynamic' depends on targets ",
"in skipped section 'dynamic_bs'\n"
@@ -1150,64 +1222,63 @@ sub skipcheck {
return '';
}
+# returns filehandle, dies on fail. :raw so no :crlf
+sub open_for_writing {
+ my ($file) = @_;
+ open my $fh ,">", $file or die "Unable to open $file: $!";
+ my @layers = ':raw';
+ push @layers, join ' ', ':encoding(locale)' if $CAN_DECODE;
+ binmode $fh, join ' ', @layers;
+ $fh;
+}
+
sub flush {
my $self = shift;
- # This needs a bit more work for more wacky OSen
- my $type = 'Unix-style';
- if ( $self->os_flavor_is('Win32') ) {
- my $make = $self->make;
- $make = +( File::Spec->splitpath( $make ) )[-1];
- $make =~ s!\.exe$!!i;
- $type = $make . '-style';
- }
- elsif ( $Is_VMS ) {
- $type = $Config{make} . '-style';
- }
-
my $finalname = $self->{MAKEFILE};
- print "Generating a $type $finalname\n";
- print "Writing $finalname for $self->{NAME}\n";
+ printf "Generating a %s %s\n", $self->make_type, $finalname if $Verbose || !$self->{PARENT};
+ print "Writing $finalname for $self->{NAME}\n" if $Verbose || !$self->{PARENT};
unlink($finalname, "MakeMaker.tmp", $Is_VMS ? 'Descrip.MMS' : ());
- open(my $fh,">", "MakeMaker.tmp")
- or die "Unable to open MakeMaker.tmp: $!";
- binmode $fh, ':encoding(locale)' if $CAN_DECODE;
- for my $chunk (@{$self->{RESULT}}) {
+ write_file_via_tmp($finalname, $self->{RESULT});
+
+ # Write MYMETA.yml to communicate metadata up to the CPAN clients
+ print "Writing MYMETA.yml and MYMETA.json\n"
+ if !$self->{NO_MYMETA} and $self->write_mymeta( $self->mymeta );
+
+ # save memory
+ if ($self->{PARENT} && !$self->{_KEEP_AFTER_FLUSH}) {
+ my %keep = map { ($_ => 1) } qw(NEEDS_LINKING HAS_LINK_CODE);
+ delete $self->{$_} for grep !$keep{$_}, keys %$self;
+ }
+
+ system("$Config::Config{eunicefix} $finalname")
+ if $Config::Config{eunicefix} ne ":";
+
+ return;
+}
+
+sub write_file_via_tmp {
+ my ($finalname, $contents) = @_;
+ my $fh = open_for_writing("MakeMaker.tmp");
+ die "write_file_via_tmp: 2nd arg must be ref" unless ref $contents;
+ for my $chunk (@$contents) {
my $to_write = $chunk;
utf8::encode $to_write if !$CAN_DECODE && $] > 5.008;
print $fh "$to_write\n" or die "Can't write to MakeMaker.tmp: $!";
}
-
- close $fh
- or die "Can't write to MakeMaker.tmp: $!";
+ close $fh or die "Can't write to MakeMaker.tmp: $!";
_rename("MakeMaker.tmp", $finalname) or
warn "rename MakeMaker.tmp => $finalname: $!";
- chmod 0644, $finalname unless $Is_VMS;
-
- unless ($self->{NO_MYMETA}) {
- # Write MYMETA.yml to communicate metadata up to the CPAN clients
- if ( $self->write_mymeta( $self->mymeta ) ) {
- print "Writing MYMETA.yml and MYMETA.json\n";
- }
-
- }
- my %keep = map { ($_ => 1) } qw(NEEDS_LINKING HAS_LINK_CODE);
- if ($self->{PARENT} && !$self->{_KEEP_AFTER_FLUSH}) {
- foreach (keys %$self) { # safe memory
- delete $self->{$_} unless $keep{$_};
- }
- }
-
- system("$Config::Config{eunicefix} $finalname") unless $Config::Config{eunicefix} eq ":";
+ chmod 0644, $finalname if !$Is_VMS;
+ return;
}
# This is a rename for OS's where the target must be unlinked first.
sub _rename {
my($src, $dest) = @_;
- chmod 0666, $dest;
- unlink $dest;
+ _unlink($dest);
return rename $src, $dest;
}
@@ -1283,36 +1354,6 @@ sub _find_magic_vstring {
return $tvalue;
}
-
-# Look for weird version numbers, warn about them and set them to 0
-# before CPAN::Meta chokes.
-sub clean_versions {
- my($self, $key) = @_;
- my $reqs = $self->{$key};
- for my $module (keys %$reqs) {
- my $v = $reqs->{$module};
- my $printable = _find_magic_vstring($v);
- $v = $printable if length $printable;
- my $version = eval {
- local $SIG{__WARN__} = sub {
- # simulate "use warnings FATAL => 'all'" for vintage perls
- die @_;
- };
- version->new($v)->stringify;
- };
- if( $@ || $reqs->{$module} eq '' ) {
- if ( $] < 5.008 && $v !~ /^v?[\d_\.]+$/ ) {
- $v = sprintf "v%vd", $v unless $v eq '';
- }
- carp "Unparsable version '$v' for prerequisite $module";
- $reqs->{$module} = 0;
- }
- else {
- $reqs->{$module} = $version;
- }
- }
-}
-
sub selfdocument {
my($self) = @_;
my(@m);
@@ -1326,6 +1367,16 @@ sub selfdocument {
push @m, "# $key => $v";
}
}
+ # added here as selfdocument is not overridable
+ push @m, <<'EOF';
+
+# here so even if top_targets is overridden, these will still be defined
+# gmake will silently still work if any are .PHONY-ed but nmake won't
+EOF
+ push @m, join "\n", map "$_ ::\n\t\$(NOECHO) \$(NOOP)\n",
+ # config is so manifypods won't puke if no subdirs
+ grep !$self->{SKIPHASH}{$_},
+ qw(static dynamic config);
join "\n", @m;
}
@@ -1415,6 +1466,23 @@ MakeMaker also checks for any files matching glob("t/*.t"). It will
execute all matching files in alphabetical order via the
L<Test::Harness> module with the C<-I> switches set correctly.
+You can also organize your tests within subdirectories in the F<t/> directory.
+To do so, use the F<test> directive in your I<Makefile.PL>. For example, if you
+had tests in:
+
+ t/foo
+ t/foo/bar
+
+You could tell make to run tests in both of those directories with the
+following directives:
+
+ test => {TESTS => 't/*/*.t t/*/*/*.t'}
+ test => {TESTS => 't/foo/*.t t/foo/bar/*.t'}
+
+The first will run all test files in all first-level subdirectories and all
+subdirectories they contain. The second will run tests in only the F<t/foo>
+and F<t/foo/bar>.
+
If you'd like to see the raw output of your tests, set the
C<TEST_VERBOSE> variable to true.
@@ -2381,7 +2449,14 @@ passed to subdirectory makes.
=item PERL
-Perl binary for tasks that can be done by miniperl.
+Perl binary for tasks that can be done by miniperl. If it contains
+spaces or other shell metacharacters, it needs to be quoted in a way
+that protects them, since this value is intended to be inserted in a
+shell command line in the Makefile. E.g.:
+
+ # Perl executable lives in "C:/Program Files/Perl/bin"
+ # Normally you don't need to set this yourself!
+ $ perl Makefile.PL PERL='"C:/Program Files/Perl/bin/perl.exe" -w'
=item PERL_CORE
@@ -2480,7 +2555,9 @@ Desired permission for executable files. Defaults to C<755>.
MakeMaker can run programs to generate files for you at build time.
By default any file named *.PL (except Makefile.PL and Build.PL) in
the top level directory will be assumed to be a Perl program and run
-passing its own basename in as an argument. For example...
+passing its own basename in as an argument. This basename is actually a build
+target, and there is an intention, but not a requirement, that the *.PL file
+make the file passed to to as an argument. For example...
perl foo.PL foo
@@ -2490,6 +2567,8 @@ and the value is passed in as the first argument when the PL file is run.
PL_FILES => {'bin/foobar.PL' => 'bin/foobar'}
+ PL_FILES => {'foo.PL' => 'foo.c'}
+
Would run bin/foobar.PL like this:
perl bin/foobar.PL bin/foobar
@@ -2508,8 +2587,14 @@ INST_ARCH in their C<@INC>, so the just built modules can be
accessed... unless the PL file is making a module (or anything else in
PM) in which case it is run B<before> pm_to_blib and does not include
INST_LIB and INST_ARCH in its C<@INC>. This apparently odd behavior
-is there for backwards compatibility (and it's somewhat DWIM).
-
+is there for backwards compatibility (and it's somewhat DWIM). The argument
+passed to the .PL is set up as a target to build in the Makefile. In other
+sections such as C<postamble> you can specify a dependency on the
+filename/argument that the .PL is supposed (or will have, now that that is
+is a dependency) to generate. Note the file to be generated will still be
+generated and the .PL will still run even without an explicit dependency created
+by you, since the C<all> target still depends on running all eligible to run.PL
+files.
=item PM
@@ -2536,24 +2621,23 @@ Defining PM in the Makefile.PL will override PMLIBDIRS.
A filter program, in the traditional Unix sense (input from stdin, output
to stdout) that is passed on each .pm file during the build (in the
pm_to_blib() phase). It is empty by default, meaning no filtering is done.
+You could use:
-Great care is necessary when defining the command if quoting needs to be
-done. For instance, you would need to say:
+ PM_FILTER => 'perl -ne "print unless /^\\#/"',
- {'PM_FILTER' => 'grep -v \\"^\\#\\"'}
+to remove all the leading comments on the fly during the build. In order
+to be as portable as possible, please consider using a Perl one-liner
+rather than Unix (or other) utilities, as above. The # is escaped for
+the Makefile, since what is going to be generated will then be:
-to remove all the leading comments on the fly during the build. The
-extra \\ are necessary, unfortunately, because this variable is interpolated
-within the context of a Perl program built on the command line, and double
-quotes are what is used with the -e switch to build that command line. The
-# is escaped for the Makefile, since what is going to be generated will then
-be:
+ PM_FILTER = perl -ne "print unless /^\#/"
- PM_FILTER = grep -v \"^\#\"
-
-Without the \\ before the #, we'd have the start of a Makefile comment,
+Without the \ before the #, we'd have the start of a Makefile comment,
and the macro would be incorrectly defined.
+You will almost certainly be better off using the C<PL_FILES> system,
+instead. See above, or the L<ExtUtils::MakeMaker::FAQ> entry.
+
=item POLLUTE
Release 5.005 grandfathered old global symbol names by providing preprocessor
@@ -2623,8 +2707,11 @@ doesn't. See L<Test::More/BAIL_OUT> for more details.
A hash of modules that are needed to run your module. The keys are
the module names ie. Test::More, and the minimum version is the
value. If the required version number is 0 any version will do.
+The versions given may be a Perl v-string (see L<version>) or a range
+(see L<CPAN::Meta::Requirements>).
-This will go into the C<requires> field of your F<META.yml> and the C<runtime> of the C<prereqs> field of your F<META.json>.
+This will go into the C<requires> field of your F<META.yml> and the
+C<runtime> of the C<prereqs> field of your F<META.json>.
PREREQ_PM => {
# Require Test::More at least 0.47
@@ -2793,6 +2880,49 @@ Hashref of .xs files. MakeMaker will default this. e.g.
The .c files will automatically be included in the list of files
deleted by a make clean.
+=item XSBUILD
+
+Hashref with options controlling the operation of C<XSMULTI>:
+
+ {
+ xs => {
+ all => {
+ # options applying to all .xs files for this distribution
+ },
+ 'lib/Class/Name/File' => { # specifically for this file
+ DEFINE => '-Dfunktastic', # defines for only this file
+ INC => "-I$funkyliblocation", # include flags for only this file
+ # OBJECT => 'lib/Class/Name/File$(OBJ_EXT)', # default
+ LDFROM => "lib/Class/Name/File\$(OBJ_EXT) $otherfile\$(OBJ_EXT)", # what's linked
+ },
+ },
+ }
+
+Note C<xs> is the file-extension. More possibilities may arise in the
+future. Note that object names are specified without their XS extension.
+
+C<LDFROM> defaults to the same as C<OBJECT>. C<OBJECT> defaults to,
+for C<XSMULTI>, just the XS filename with the extension replaced with
+the compiler-specific object-file extension.
+
+The distinction between C<OBJECT> and C<LDFROM>: C<OBJECT> is the make
+target, so make will try to build it. However, C<LDFROM> is what will
+actually be linked together to make the shared object or static library
+(SO/SL), so if you override it, make sure it includes what you want to
+make the final SO/SL, almost certainly including the XS basename with
+C<$(OBJ_EXT)> appended.
+
+=item XSMULTI
+
+When this is set to C<1>, multiple XS files may be placed under F<lib/>
+next to their corresponding C<*.pm> files (this is essential for compiling
+with the correct C<VERSION> values). This feature should be considered
+experimental, and details of it may change.
+
+This feature was inspired by, and small portions of code copied from,
+L<ExtUtils::MakeMaker::BigHelper>. Hopefully this feature will render
+that module mainly obsolete.
+
=item XSOPT
String of options to pass to xsubpp. This might include C<-C++> or
@@ -3112,13 +3242,13 @@ part of the 'distdir' target (and thus the 'dist' target). This is intended to
seamlessly and rapidly populate CPAN with module meta-data. If you wish to
shut this feature off, set the C<NO_META> C<WriteMakefile()> flag to true.
-At the 2008 QA Hackathon in Oslo, Perl module toolchain maintainers agrees
+At the 2008 QA Hackathon in Oslo, Perl module toolchain maintainers agreed
to use the CPAN Meta format to communicate post-configuration requirements
between toolchain components. These files, F<MYMETA.json> and F<MYMETA.yml>,
are generated when F<Makefile.PL> generates a F<Makefile> (if L<CPAN::Meta>
-is installed). Clients like L<CPAN> or L<CPANPLUS> will read this
+is installed). Clients like L<CPAN> or L<CPANPLUS> will read these
files to see what prerequisites must be fulfilled before building or testing
-the distribution. If you with to shut this feature off, set the C<NO_MYMETA>
+the distribution. If you wish to shut this feature off, set the C<NO_MYMETA>
C<WriteMakeFile()> flag to true.
=head2 Disabling an extension