lib/ExtUtils/t/problems.t How MakeMaker reacts to build problems
lib/ExtUtils/t/testlib.t See if ExtUtils::testlib works
lib/ExtUtils/t/VERSION_FROM.t See if MakeMaker's VERSION_FROM works
+lib/ExtUtils/t/writemakefile_args.t See if WriteMakefile works
lib/ExtUtils/t/zz_cleanup_dummy.t Cleanup MakeMaker test module
lib/ExtUtils/testlib.pm Fixes up @INC to use just-built extension
lib/ExtUtils/typemap Extension interface types
+6.01 Thu May 30 14:48:57 EDT 2002
+ - MacOS Classic fixes from Pudge: recursive make repair,
+ post_initialize() now used, DEFINE & INC work with relative paths,
+ removed dead hybrid method/function call code.
+ * WriteMakefile now a bit more tolerant of wrong arguments, it will
+ warn and try to soldier on rather than just vomiting.
+ - Netware whitespace nits (bleadperl@16811)
+ - Netware Perl version number tag when building dynamic libraries
+ needs to match the current perl version instead of being hard coded
+ (a mutation of bleadperl@16851)
+ - OS/2 bug in TEST_F target found by John Poltorak (bleadperl@16839)
+ - README in 6.00 still declared this as alpha.
+
+6.00 Sat May 25 17:14:09 EDT 2002
+ - VMS 8-level limit test tweak (bleadperl@16764)
+ * Here goes nothing.
+
5.96_01 Wed May 22 19:11:09 EDT 2002
- Fixed ExtUtils::testlib so it doesn't taint @INC.
- Fixed ExtUtils::Command so it groks % shell wildcard on VMS.
use vars qw(@ISA @EXPORT $VERSION);
@ISA = qw(Exporter);
@EXPORT = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f);
-$VERSION = '1.03_01';
+$VERSION = '1.04';
my $Is_VMS = $^O eq 'VMS';
expand_wildcards();
while (@ARGV)
{
- my $file = shift(@ARGV);
+ my $file = shift(@ARGV);
open(FILE,">>$file") || die "Cannot write $file:$!";
close(FILE);
utime($t,$t,$file);
# Broken out of MakeMaker from version 4.11
use vars qw($VERSION);
-$VERSION = 1.28_01;
+$VERSION = 1.29;
use Config;
use Cwd 'cwd';
use vars qw(@ISA $VERSION);
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = 1.02_01;
+$VERSION = 1.03;
=item perl_archive
require ExtUtils::MM_Unix;
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = 1.02_01;
+$VERSION = 1.03;
sub cflags {
my($self,$libperl)=@_;
# built-in ExtUtils::MM_Unix methods if MakeMaker.pm is run under MacOS.
#
# Author: Matthias Neeracher <neeracher@mac.com>
+# Maintainer: Chris Nandor <pudge@pobox.com>
package ExtUtils::MM_MacOS;
require ExtUtils::MM_Any;
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
use vars qw($VERSION);
-$VERSION = '1.00';
+$VERSION = '1.01';
use Config;
use Cwd 'cwd';
}
}
- $class = ++$ExtUtils::MakeMaker::PACKNAME;
+ my $newclass = ++$ExtUtils::MakeMaker::PACKNAME;
+ local @ExtUtils::MakeMaker::Parent = @ExtUtils::MakeMaker::Parent; # Protect against non-local exits
{
- print "Blessing Object into class [$class]\n" if $Verbose>=2;
- ExtUtils::MakeMaker::mv_all_methods("MY",$class);
- bless $self, $class;
- push @Parent, $self;
- @{"$class\:\:ISA"} = 'MM';
- }
-
- if (defined $Parent[-2]){
- $self->{PARENT} = $Parent[-2];
- my $key;
- for $key (keys %Prepend_dot_dot) {
- next unless defined $self->{PARENT}{$key};
- $self->{$key} = $self->{PARENT}{$key};
- $self->{$key} = File::Spec->catdir("::",$self->{$key})
- unless File::Spec->file_name_is_absolute($self->{$key});
- }
- $self->{PARENT}->{CHILDREN}->{$class} = $self if $self->{PARENT};
+ no strict 'refs';
+ print "Blessing Object into class [$newclass]\n" if $Verbose>=2;
+ ExtUtils::MakeMaker::mv_all_methods("MY",$newclass);
+ bless $self, $newclass;
+ push @Parent, $self;
+ require ExtUtils::MY;
+ @{"$newclass\:\:ISA"} = 'MM';
+ }
+
+ if (defined $ExtUtils::MakeMaker::Parent[-2]){
+ $self->{PARENT} = $ExtUtils::MakeMaker::Parent[-2];
+ my $key;
+ for $key (@ExtUtils::MakeMaker::Prepend_parent) {
+ next unless defined $self->{PARENT}{$key};
+ $self->{$key} = $self->{PARENT}{$key};
+ unless ($^O eq 'VMS' && $key =~ /PERL$/) {
+ $self->{$key} = $self->catdir("..",$self->{$key})
+ unless $self->file_name_is_absolute($self->{$key});
+ } else {
+ # PERL or FULLPERL will be a command verb or even a
+ # command with an argument instead of a full file
+ # specification under VMS. So, don't turn the command
+ # into a filespec, but do add a level to the path of
+ # the argument if not already absolute.
+ my @cmd = split /\s+/, $self->{$key};
+ $cmd[1] = $self->catfile('[-]',$cmd[1])
+ unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]);
+ $self->{$key} = join(' ', @cmd);
+ }
+ }
+ if ($self->{PARENT}) {
+ $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
+ foreach my $opt (qw(POLLUTE PERL_CORE)) {
+ if (exists $self->{PARENT}->{$opt}
+ and not exists $self->{$opt})
+ {
+ # inherit, but only if already unspecified
+ $self->{$opt} = $self->{PARENT}->{$opt};
+ }
+ }
+ }
+ my @fm = grep /^FIRST_MAKEFILE=/, @ARGV;
+ $self->parse_args(@fm) if @fm;
} else {
- $self->parse_args(@ARGV);
+ $self->parse_args(split(' ', $ENV{PERL_MM_OPT} || ''),@ARGV);
}
$self->{NAME} ||= $self->guess_name;
delete $self->{SKIP}; # free memory
# We skip many sections for MacOS, but we don't say anything about it in the Makefile
- for (qw/post_initialize const_config tool_autosplit
+ for (qw/ const_config tool_autosplit
tool_xsubpp tools_other dist macro depend post_constants
pasthru c_o xs_c xs_o top_targets linkext
dynamic_bs dynamic_lib static_lib manifypods
sub init_main {
my($self) = @_;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
# --- Initialize Module Name and Paths
sub init_others { # --- Initialize Other Attributes
my($self) = shift;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
if ( !$self->{OBJECT} ) {
# init_dirscan should have found out, if we have C files
sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
my($self) = @_;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
my($name, %dir, %xs, %c, %h, %ignore, %pl_files, %manifypods);
local(%pm); #the sub in find() has to see this hash
sub constants {
my($self) = @_;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
my(@m,$tmp);
for $tmp (qw/
if ($self->{DEFINE}) {
$self->{DEFINE} =~ s/-D/-d /g; # Preprocessor definitions may be useful
- $self->{DEFINE} =~ s/-I\S+//g; # UN*X includes probably are not useful
+ $self->{DEFINE} =~ s/-I\S+/_include($1)/eg; # UN*X includes probably are not useful
}
if ($self->{INC}) {
- $self->{INC} =~ s/-I\S+//g; # UN*X includes probably are not useful
+ $self->{INC} =~ s/-I(\S+)/_include($1)/eg; # UN*X includes probably are not useful
}
for $tmp (qw/
FULLEXT BASEEXT ROOTEXT DEFINE INC
# --- Static Loading Sections ---
my($self) = shift;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
my($extlib) = $self->{MYEXTLIB} ? "\nstatic :: myextlib\n" : "";
'
all :: static
sub dlsyms {
my($self,%attribs) = @_;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
return '' unless !$self->{SKIPHASH}{'dynamic'};
# --- dynamic Loading Sections ---
my($self) = shift;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
'
all :: dynamic
# --- Cleanup and Distribution Sections ---
my($self, %attribs) = @_;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
my(@m,$dir);
push(@m, '
# Delete temporary files but do not touch installed files. We don\'t delete
sub realclean {
my($self, %attribs) = @_;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
my(@m);
push(@m,'
# Delete temporary files (via clean) and also delete installed files
sub rulez {
my($self) = shift;
- unless (ref $self){
- ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
- $self = $ExtUtils::MakeMaker::Parent[-1];
- }
qq'
install install_static install_dynamic ::
\t\$(MACPERL_SRC)PerlInstall -l \$(PERL_LIB)
join "", @m;
}
+sub _include { # for Unix-style includes, with -I instead of -i
+ my($inc) = @_;
+ require File::Spec::Unix;
+
+ # allow only relative paths
+ if (File::Spec::Unix->file_name_is_absolute($inc)) {
+ return '';
+ } else {
+ return '-i ' . macify($inc);
+ }
+}
+
1;
__END__
use File::Basename;
use vars qw(@ISA $VERSION);
-$VERSION = '2.04_01';
+$VERSION = '2.05';
require ExtUtils::MM_Win32;
@ISA = qw(ExtUtils::MM_Win32);
MAKE_FRAG
}
- $m .= ' $(LD) $(LDFLAGS) $(OBJECT:.obj=.obj) -desc "Perl 5.8.0 Extension ($(BASEEXT)) XS_VERSION: $(XS_VERSION)" -nlmversion $(NLM_VERSION)';
+ # Reconstruct the X.Y.Z version.
+ my $version = join '.', map { sprintf "%d", $_ }
+ $] =~ /(\d)\.(\d{3})(\d{2})/;
+ $m .= sprintf ' $(LD) $(LDFLAGS) $(OBJECT:.obj=.obj) -desc "Perl %s Extension ($(BASEEXT)) XS_VERSION: $(XS_VERSION)" -nlmversion $(NLM_VERSION)', $version;
# Taking care of long names like FileHandle, ByteLoader, SDBM_File etc
if($self->{NLM_SHORT_NAME}) {
use ExtUtils::MakeMaker qw(neatvalue);
use File::Spec;
-$VERSION = '1.02_01';
+$VERSION = '1.03';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
use ExtUtils::MakeMaker qw($Verbose neatvalue);
-$VERSION = '1.31_01';
+$VERSION = '1.32';
require ExtUtils::MM_Any;
@ISA = qw(ExtUtils::MM_Any);
use File::Basename;
use File::Spec;
use vars qw($Revision @ISA $VERSION);
-($VERSION) = $Revision = '5.64_01';
+($VERSION) = $Revision = '5.65';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-$VERSION = '1.04_01';
+$VERSION = '1.05';
$ENV{EMXSHELL} = 'sh'; # to run `commands`
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;
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?
=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
=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)
$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
$Is_MacOS $Is_VMS
$Debug $Verbose $Quiet $MANIFEST $DEFAULT_MSKIP);
-$VERSION = 1.37_01;
+$VERSION = 1.38;
@ISA=('Exporter');
@EXPORT_OK = ('mkmanifest', 'manicheck', 'fullcheck', 'filecheck',
'skipcheck', 'maniread', 'manicopy');
package ExtUtils::Mkbootstrap;
-$VERSION = 1.14_01;
+$VERSION = 1.15;
use Config;
use Exporter;
use vars qw(@ISA @EXPORT $VERSION);
@ISA = 'Exporter';
@EXPORT = '&Mksymlists';
-$VERSION = 1.18_00;
+$VERSION = 1.19;
sub Mksymlists {
my(%spec) = @_;
--- /dev/null
+#!/usr/bin/perl -w
+
+# This is a test of the verification of the arguments to
+# WriteMakefile.
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't' if -d 't';
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+
+use strict;
+use Test::More tests => 12;
+
+use TieOut;
+use MakeMaker::Test::Utils;
+
+use ExtUtils::MakeMaker;
+
+chdir 't';
+
+perl_lib();
+
+ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
+ diag("chdir failed: $!");
+
+{
+ ok( my $stdout = tie *STDOUT, 'TieOut' );
+ my $warnings = '';
+ local $SIG{__WARN__} = sub {
+ $warnings .= join '', @_;
+ };
+
+ my $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ MAN3PODS => ' ', # common mistake
+ );
+
+ is( $warnings, <<VERIFY );
+WARNING: MAN3PODS takes a hash reference not a string/number.
+ Please inform the author.
+VERIFY
+ is_deeply( $mm->{MAN3PODS}, {}, 'Wrong argument type corrected' );
+
+ $warnings = '';
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ AUTHOR => sub {},
+ );
+
+ is( $warnings, <<VERIFY );
+WARNING: AUTHOR takes a string/number not a code reference.
+ Please inform the author.
+VERIFY
+
+ is_deeply( $mm->{AUTHOR}, '' );
+
+
+ # LIBS accepts *both* a string or an array ref. The first cut of
+ # our verification did not take this into account.
+ $warnings = '';
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ LIBS => '-lwibble -lwobble',
+ );
+
+ # We'll get warnings about the bogus libs, that's ok.
+ unlike( $warnings, qr/WARNING: .* takes/ );
+ is_deeply( $mm->{LIBS}, ['-lwibble -lwobble'] );
+
+ $warnings = '';
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ LIBS => ['-lwibble', '-lwobble'],
+ );
+
+ # We'll get warnings about the bogus libs, that's ok.
+ unlike( $warnings, qr/WARNING: .* takes/ );
+ is_deeply( $mm->{LIBS}, ['-lwibble', '-lwobble'] );
+
+ $warnings = '';
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ LIBS => { wibble => "wobble" },
+ );
+
+ # We'll get warnings about the bogus libs, that's ok.
+ like( $warnings, qr{^WARNING: LIBS takes a array reference or string/number not a hash reference}m );
+ is_deeply( $mm->{LIBS}, [] );
+
+}
package ExtUtils::testlib;
-$VERSION = 1.14_01;
+$VERSION = 1.15;
use Cwd;
use File::Spec;