Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ t/prereq.t
t/prereq_print.t
t/problems.t
t/prompt.t
t/rec_att_keys.t
t/recurs.t
t/revision.t
t/several_authors.t
Expand Down
7 changes: 6 additions & 1 deletion lib/ExtUtils/MakeMaker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ our @Get_from_Config; # referenced by MM_Unix
our @MM_Sections;
our @Overridable;
my @Prepend_parent;
my %Recognized_Att_Keys;
our %Recognized_Att_Keys;
our %macro_fsentity; # whether a macro is a filesystem name
our %macro_dep; # whether a macro is a dependency

Expand Down Expand Up @@ -1768,6 +1768,11 @@ The following attributes may be specified as arguments to WriteMakefile()
or as NAME=VALUE pairs on the command line. Attributes that became
available with later versions of MakeMaker are indicated.

A computer-readable list of recognized attributes is available as
C<%ExtUtils::MakeMakers::Recognized_Att_Keys>, supported since 7.72. You
can check whether a particular parameter is supported by the current
version of ExtUtils::MakeMaker by checking whether it exists in the hash.

In order to maintain portability of attributes with older versions of
MakeMaker you may want to use L<App::EUMM::Upgrade> with your C<Makefile.PL>.

Expand Down
46 changes: 46 additions & 0 deletions t/rec_att_keys.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/perl -w

# This script tests %ExtUtils::MakeMaker::Recognized_Att_Keys;

use strict;
use Test::More;

# We don’t need to test all parameters; just enough to verify that the
# mechanism is working. This list is somewhat random, but it works.

my @supported = qw(
ABSTRACT_FROM
AUTHOR
BUILD_REQUIRES
clean
dist
DISTNAME
DISTVNAME
LIBS
MAN3PODS
META_MERGE
MIN_PERL_VERSION
NAME
PL_FILES
PREREQ_PM
VERSION
VERSION_FROM
);

my @unsupported = qw(
WIBBLE
wump
);

plan tests => @supported+@unsupported;

use ExtUtils::MakeMaker ();

for (@supported) {
ok exists $ExtUtils::MakeMaker::Recognized_Att_Keys{$_},
"EUMM says it supports param '$_'";
}
for (@unsupported) {
ok !exists $ExtUtils::MakeMaker::Recognized_Att_Keys{$_},
"EUMM claims not to support param '$_'";
}