summaryrefslogtreecommitdiff
path: root/lib/ExtUtils/MakeMaker.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-05-30 20:24:10 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-30 20:24:10 +0000
commit69ff8adf802894e0957dae2b89f4e2c30fa38e90 (patch)
tree8bfea6671ef071d30729428acaf05e9e7f5a6429 /lib/ExtUtils/MakeMaker.pm
parent588cafc81b146d309df37bae231b533d51bccb74 (diff)
downloadperl-69ff8adf802894e0957dae2b89f4e2c30fa38e90.tar.gz
Upgrade to ExtUtils::MakeMaker 6.01.
p4raw-id: //depot/perl@16904
Diffstat (limited to 'lib/ExtUtils/MakeMaker.pm')
-rw-r--r--lib/ExtUtils/MakeMaker.pm81
1 files changed, 76 insertions, 5 deletions
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index c93365e7cc..69cf10607f 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -2,10 +2,10 @@ package ExtUtils::MakeMaker;
BEGIN {require 5.005_03;}
-$VERSION = "5.96_01";
+$VERSION = "6.01";
$Version_OK = "5.49"; # Makefiles older than $Version_OK will die
# (Will be checked from MakeMaker version 4.13 onwards)
-($Revision = substr(q$Revision: 1.55 $, 10)) =~ s/\s+$//;
+($Revision = substr(q$Revision: 1.59 $, 10)) =~ s/\s+$//;
require Exporter;
use Config;
@@ -44,12 +44,81 @@ sub WriteMakefile {
require ExtUtils::MY;
my %att = @_;
+
+ _verify_att(\%att);
+
my $mm = MM->new(\%att);
$mm->flush;
return $mm;
}
+
+# Basic signatures of the attributes WriteMakefile takes. Each is
+# the reference type. Any not noted simply take strings.
+my %Att_Sigs =
+(
+ C => 'array',
+ CONFIG => 'array',
+ CONFIGURE => 'code',
+ DIR => 'array',
+ DL_FUNCS => 'hash',
+ DL_VARS => 'array',
+ EXCLUDE_EXT=> 'array',
+ EXE_FILES => 'array',
+ FUNCLIST => 'array',
+ H => 'array',
+ IMPORTS => 'hash',
+ INCLUDE_EXT=> 'array',
+ LIBS => ['array','string'],
+ MAN1PODS => 'hash',
+ MAN3PODS => 'hash',
+ PL_FILES => 'hash',
+ PM => 'hash',
+ PMLIBDIRS => 'array',
+ PREREQ_PM => 'hash',
+ SKIP => 'array',
+ TYPEMAPS => 'array',
+ XS => 'hash',
+
+ clean => 'hash',
+ depend => 'hash',
+ dist => 'hash',
+ dynamic_lib=> 'hash',
+ linkext => 'hash',
+ macro => 'hash',
+ realclean => 'hash',
+ test => 'hash',
+ tool_autosplit => 'hash',
+);
+
+my %Default_Att = (
+ string => '',
+ hash => {},
+ array => [],
+ code => sub {}
+ );
+
+sub _verify_att {
+ my($att) = @_;
+
+ while( my($key, $val) = each %$att ) {
+ my $sig = $Att_Sigs{$key};
+ my @sigs = ref $sig ? @$sig : ($sig || 'string');
+ my $given = lc ref $val || 'string';
+ unless( grep $given eq $_, @sigs ) {
+ my $takes = join " or ", map { $_ ne 'string' ? "$_ reference"
+ : "string/number"
+ } @sigs;
+ my $has = $given ne 'string' ? "$given reference"
+ : "string/number";
+ warn "WARNING: $key takes a $takes not a $has.\n".
+ " Please inform the author.\n";
+ $att->{$key} = $Default_Att{$sigs[0]};
+ }
+ }
+}
+
sub prompt ($;$) {
my($mess,$def)=@_;
$ISA_TTY = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; # Pipe?
@@ -1289,7 +1358,9 @@ Ref to array of *.h file names. Similar to C.
=item IMPORTS
This attribute is used to specify names to be imported into the
-extension. It is only used on OS/2 and Win32.
+extension. Takes a hash ref.
+
+It is only used on OS/2 and Win32.
=item INC
@@ -1426,7 +1497,7 @@ INSTALLSCRIPT.
=item LDFROM
-defaults to "$(OBJECT)" and is used in the ld command to specify
+Defaults to "$(OBJECT)" and is used in the ld command to specify
what files to link/load from (also see dynamic_lib below for how to
specify ld flags)
@@ -1817,7 +1888,7 @@ MakeMaker object. The following lines will be parsed o.k.:
$VERSION = '1.00';
*VERSION = \'1.01';
- ( $VERSION ) = '$Revision: 1.55 $ ' =~ /\$Revision:\s+([^\s]+)/;
+ ( $VERSION ) = '$Revision: 1.59 $ ' =~ /\$Revision:\s+([^\s]+)/;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
our $VERSION = 1.2.3; # new for perl5.6.0