From: Michael G. Schwern Date: Tue, 30 Apr 2002 00:24:59 +0000 (-0400) Subject: MakeMaker 5.91_02 -> 5.92_01 X-Git-Tag: perl-5.8.0~1128 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/f582e4890c8c9d8f1af27c006641dda54d419af6 MakeMaker 5.91_02 -> 5.92_01 Message-ID: <20020430042459.GJ756@blackrider> p4raw-id: //depot/perl@16278 --- diff --git a/MANIFEST b/MANIFEST index 068283c..1af1242 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1026,6 +1026,7 @@ lib/ExtUtils/MM_Any.pm MakeMaker methods for Any OS lib/ExtUtils/MM_BeOS.pm MakeMaker methods for BeOS lib/ExtUtils/MM_Cygwin.pm MakeMaker methods for Cygwin lib/ExtUtils/MM_DOS.pm MakeMaker methods for DOS +lib/ExtUtils/MM_MacOS.pm MakeMaker methods for MacOS lib/ExtUtils/MM_NW5.pm MakeMaker methods for NetWare lib/ExtUtils/MM_OS2.pm MakeMaker methods for OS/2 lib/ExtUtils/MM_Unix.pm MakeMaker methods for Unix diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes index 7ae0d6c..36857bf 100644 --- a/lib/ExtUtils/Changes +++ b/lib/ExtUtils/Changes @@ -1,3 +1,10 @@ +5.92_01 Mon Apr 29 23:09:38 EDT 2002 + - Fixing case of modules with no .pm files on VMS. + - LDLOADLIBS fix for NetBSD and easier overriding (bleadperl 16233) + * syncing in MM_MacOS from pudge. + - syncing in NetWare fixes (16266 & 16190) + - Cleaning up MM_NW5.pm somewhat. + 5.91_02 Wed Apr 24 01:29:56 EDT 2002 - Adjustments to tests for inclusion in the core. diff --git a/lib/ExtUtils/MM_MacOS.pm b/lib/ExtUtils/MM_MacOS.pm new file mode 100644 index 0000000..4d32dbb --- /dev/null +++ b/lib/ExtUtils/MM_MacOS.pm @@ -0,0 +1,879 @@ +# MM_MacOS.pm +# MakeMaker default methods for MacOS +# This package is inserted into @ISA of MakeMaker's MM before the +# built-in ExtUtils::MM_Unix methods if MakeMaker.pm is run under MacOS. +# +# Author: Matthias Neeracher + +package ExtUtils::MM_MacOS; +require ExtUtils::MM_Any; +require ExtUtils::MM_Unix; +@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); + +use Config; +use Cwd 'cwd'; +require Exporter; +use File::Basename; +use File::Spec; +use vars qw(%make_data); + +use ExtUtils::MakeMaker qw($Verbose &neatvalue); + +=head1 NAME + +ExtUtils::MM_MacOS - methods to override UN*X behaviour in ExtUtils::MakeMaker + +=head1 SYNOPSIS + + use ExtUtils::MM_MacOS; # Done internally by ExtUtils::MakeMaker if needed + +=head1 DESCRIPTION + +MM_MacOS currently only produces an approximation to the correct Makefile. + +=cut + +sub new { + my($class,$self) = @_; + my($key); + my($cwd) = cwd(); + + print STDOUT "Mac MakeMaker (v$ExtUtils::MakeMaker::VERSION)\n" if $Verbose; + if (-f "MANIFEST" && ! -f "Makefile.mk"){ + ExtUtils::MakeMaker::check_manifest(); + } + + mkdir("Obj", 0777) unless -d "Obj"; + + $self = {} unless (defined $self); + + my(%initial_att) = %$self; # record initial attributes + + if (defined $self->{CONFIGURE}) { + if (ref $self->{CONFIGURE} eq 'CODE') { + $self = { %$self, %{&{$self->{CONFIGURE}}}}; + } else { + Carp::croak "Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n"; + } + } + + $class = ++$ExtUtils::MakeMaker::PACKNAME; + { + 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}; + } else { + $self->parse_args(@ARGV); + } + + $self->{NAME} ||= $self->guess_name; + + ($self->{NAME_SYM} = $self->{NAME}) =~ s/\W+/_/g; + + $self->init_main(); + $self->init_dirscan(); + $self->init_others(); + + push @{$self->{RESULT}}, <{NAME} extension to perl. +# +# It was generated automatically by MakeMaker version +# $VERSION (Revision: $Revision) from the contents of +# Makefile.PL. Don't edit this file, edit Makefile.PL instead. +# +# ANY CHANGES MADE HERE WILL BE LOST! +# +# MakeMaker Parameters: +END + + foreach $key (sort keys %initial_att){ + my($v) = neatvalue($initial_att{$key}); + $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/; + $v =~ tr/\n/ /s; + push @{$self->{RESULT}}, "# $key => $v"; + } + + # turn the SKIP array into a SKIPHASH hash + my (%skip,$skip); + for $skip (@{$self->{SKIP} || []}) { + $self->{SKIPHASH}{$skip} = 1; + } + 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 + 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 + installbin subdirs dist_basics dist_core + dist_dir dist_test dist_ci install force perldepend makefile + staticmake test pm_to_blib selfdocument cflags + const_loadlibs const_cccmd + /) + { + $self->{SKIPHASH}{$_} = 2; + } + push @ExtUtils::MakeMaker::MM_Sections, "rulez" + unless grep /rulez/, @ExtUtils::MakeMaker::MM_Sections; + + if ($self->{PARENT}) { + for (qw/install dist dist_basics dist_core dist_dir dist_test dist_ci/) { + $self->{SKIPHASH}{$_} = 1; + } + } + + # We run all the subdirectories now. They don't have much to query + # from the parent, but the parent has to query them: if they need linking! + unless ($self->{NORECURS}) { + $self->eval_in_subdirs if @{$self->{DIR}}; + } + + my $section; + foreach $section ( @ExtUtils::MakeMaker::MM_Sections ){ + next if ($self->{SKIPHASH}{$section} == 2); + print "Processing Makefile '$section' section\n" if ($Verbose >= 2); + $self->{ABSTRACT_FROM} = macify($self->{ABSTRACT_FROM}) + if $self->{ABSTRACT_FROM}; + my($skipit) = $self->skipcheck($section); + if ($skipit){ + push @{$self->{RESULT}}, "\n# --- MakeMaker $section section $skipit."; + } else { + my(%a) = %{$self->{$section} || {}}; + push @{$self->{RESULT}}, "\n# --- MakeMaker $section section:"; + push @{$self->{RESULT}}, "# " . join ", ", %a if $Verbose && %a; + push @{$self->{RESULT}}, $self->nicetext($self->$section( %a )); + } + } + + push @{$self->{RESULT}}, "\n# End."; + pop @Parent; + + $ExtUtils::MM_MacOS::make_data{$cwd} = $self; + $self; +} + +sub skipcheck { + my($self) = shift; + my($section) = @_; + return 'skipped' if $self->{SKIPHASH}{$section}; + return ''; +} + +=item maybe_command + +Returns true, if the argument is likely to be a command. + +=cut + +sub maybe_command { + my($self,$file) = @_; + return $file if ! -d $file; + return; +} + +=item guess_name + +Guess the name of this package by examining the working directory's +name. MakeMaker calls this only if the developer has not supplied a +NAME attribute. + +=cut + +sub guess_name { + my($self) = @_; + my $name = cwd(); + $name =~ s/.*:// unless ($name =~ s/^.*:ext://); + $name =~ s#:#::#g; + $name =~ s#[\-_][\d.\-]+$##; # this is new with MM 5.00 + $name; +} + +=item macify + +Translate relative path names into Mac names. + +=cut + +sub macify { + # mmm, better ... and this condition should always be satisified, + # as the module is now distributed with MacPerl, but leave in anyway + if (do 'Mac/FileSpec/Unixish.pm') { + return Mac::FileSpec::Unixish::nativize($_[0]); + } + + my($unix) = @_; + my(@mac); + + $unix =~ s|^\./||; + + foreach (split(/[ \t\n]+/, $unix)) { + if (m|/|) { + $_ = ":$_"; + s|/|:|g; + } + push(@mac, $_); + } + + return "@mac"; +} + +=item patternify + +Translate to Mac names & patterns + +=cut + +sub patternify { + my($unix) = @_; + my(@mac); + + foreach (split(/[ \t\n]+/, $unix)) { + if (m|/|) { + $_ = ":$_"; + s|/|:|g; + s|\*|Å|g; + $_ = "'$_'" if /[?Å]/; + push(@mac, $_); + } + } + + return "@mac"; +} + +=item init_main + +Initializes some of NAME, FULLEXT, BASEEXT, ROOTEXT, DLBASE, PERL_SRC, +PERL_LIB, PERL_ARCHLIB, PERL_INC, INSTALLDIRS, INST_*, INSTALL*, +PREFIX, CONFIG, AR, AR_STATIC_ARGS, LD, OBJ_EXT, LIB_EXT, MAP_TARGET, +LIBPERL_A, VERSION_FROM, VERSION, DISTNAME, VERSION_SYM. + +=cut + +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 + + # NAME = The perl module name for this extension (eg DBD::Oracle). + # FULLEXT = Pathname for extension directory (eg DBD/Oracle). + # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. + # ROOTEXT = Directory part of FULLEXT with trailing :. + ($self->{FULLEXT} = + $self->{NAME}) =~ s!::!:!g ; #eg. BSD:Foo:Socket + ($self->{BASEEXT} = + $self->{NAME}) =~ s!.*::!! ; #eg. Socket + ($self->{ROOTEXT} = + $self->{FULLEXT}) =~ s#:?\Q$self->{BASEEXT}\E$## ; #eg. BSD:Foo + $self->{ROOTEXT} .= ":" if ($self->{ROOTEXT}); + + # --- Initialize PERL_LIB, INST_LIB, PERL_SRC + + # *Real* information: where did we get these two from? ... + my $inc_config_dir = dirname($INC{'Config.pm'}); + my $inc_carp_dir = dirname($INC{'Carp.pm'}); + + unless ($self->{PERL_SRC}){ + my($dir); + foreach $dir (qw(:: ::: :::: ::::: ::::::)){ + if (-f "${dir}perl.h") { + $self->{PERL_SRC}=$dir ; + last; + } + } + if (!$self->{PERL_SRC} && -f "$ENV{MACPERL}CORE:perl:perl.h") { + # Mac pathnames may be very nasty, so we'll install symlinks + unlink(":PerlCore", ":PerlLib"); + symlink("$ENV{MACPERL}CORE:", "PerlCore"); + symlink("$ENV{MACPERL}lib:", "PerlLib"); + $self->{PERL_SRC} = ":PerlCore:perl:" ; + $self->{PERL_LIB} = ":PerlLib:"; + } + } + if ($self->{PERL_SRC}){ + $self->{MACPERL_SRC} = File::Spec->catdir("$self->{PERL_SRC}","macos:"); + $self->{MACPERL_LIB} ||= File::Spec->catdir("$self->{MACPERL_SRC}","lib"); + $self->{PERL_LIB} ||= File::Spec->catdir("$self->{PERL_SRC}","lib"); + $self->{PERL_ARCHLIB} = $self->{PERL_LIB}; + $self->{PERL_INC} = $self->{PERL_SRC}; + $self->{MACPERL_INC} = $self->{MACPERL_SRC}; + } else { +# hmmmmmmm ... ? + $self->{PERL_LIB} ||= "$ENV{MACPERL}site_perl"; + $self->{PERL_ARCHLIB} = $self->{PERL_LIB}; + $self->{PERL_INC} = $ENV{MACPERL}; +# die <{INSTALLDIRS} = "perl"; + $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB}; + $self->{INST_MAN1DIR} = $self->{INSTALLMAN1DIR} = "none"; + $self->{MAN1EXT} ||= $Config::Config{man1ext}; + $self->{INST_MAN3DIR} = $self->{INSTALLMAN3DIR} = "none"; + $self->{MAN3EXT} ||= $Config::Config{man3ext}; + $self->{MAP_TARGET} ||= "perl"; + + # make a simple check if we find Exporter + # hm ... do we really care? at all? +# warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory +# (Exporter.pm not found)" +# unless -f File::Spec->catfile("$self->{PERL_LIB}","Exporter.pm") || +# $self->{NAME} eq "ExtUtils::MakeMaker"; + + # Determine VERSION and VERSION_FROM + ($self->{DISTNAME}=$self->{NAME}) =~ s#(::)#-#g unless $self->{DISTNAME}; + if ($self->{VERSION_FROM}){ + local *FH; + open(FH,macify($self->{VERSION_FROM})) or + die "Could not open '$self->{VERSION_FROM}' (attribute VERSION_FROM): $!"; + while () { + chop; + next unless /\$([\w:]*\bVERSION)\b.*=/; + local $ExtUtils::MakeMaker::module_version_variable = $1; + my($eval) = "$_;"; + eval $eval; + die "Could not eval '$eval': $@" if $@; + if ($self->{VERSION} = $ {$ExtUtils::MakeMaker::module_version_variable}){ + print "$self->{NAME} VERSION is $self->{VERSION} (from $self->{VERSION_FROM})\n" if $Verbose; + } else { + # XXX this should probably croak + print "WARNING: Setting VERSION via file '$self->{VERSION_FROM}' failed\n"; + } + last; + } + close FH; + } + + if ($self->{VERSION}) { + $self->{VERSION} =~ s/^\s+//; + $self->{VERSION} =~ s/\s+$//; + } + + $self->{VERSION} = "0.10" unless $self->{VERSION}; + ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g; + + + # Graham Barr and Paul Marquess had some ideas how to ensure + # version compatibility between the *.pm file and the + # corresponding *.xs file. The bottomline was, that we need an + # XS_VERSION macro that defaults to VERSION: + $self->{XS_VERSION} ||= $self->{VERSION}; + + # --- Initialize Perl Binary Locations + + # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL' + # will be working versions of perl 5. miniperl has priority over perl + # for PERL to ensure that $(PERL) is usable while building ./ext/* + my ($component,@defpath); + foreach $component ($self->{PERL_SRC}, File::Spec->path(), $Config::Config{binexp}) { + push @defpath, $component if defined $component; + } + $self->{PERL} = "$self->{PERL_SRC}miniperl"; + $self->{FULLPERL} = "$self->{PERL_SRC}perl"; + $self->{MAKEFILE} = "Makefile.mk"; +} + +=item init_others + +Initializes LDLOADLIBS, LIBS + +=cut + +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 + $self->{OBJECT} = ""; + $self->{OBJECT} = "$self->{BASEEXT}.c" if @{$self->{C}||[]}; + } else { + $self->{OBJECT} =~ s/\$\(O_FILES\)/@{$self->{C}||[]}/; + } + my($src); + foreach (split(/[ \t\n]+/, $self->{OBJECT})) { + if (/^$self->{BASEEXT}\.o(bj)?$/) { + $src .= " $self->{BASEEXT}.c"; + } elsif (/^(.*\..*)\.o$/) { + $src .= " $1"; + } elsif (/^(.*)(\.o(bj)?|\$\(OBJ_EXT\))$/) { + if (-f "$1.cp") { + $src .= " $1.cp"; + } else { + $src .= " $1.c"; + } + } else { + $src .= " $_"; + } + } + $self->{SOURCE} = $src; +} + + +=item init_dirscan + +Initializes DIR, XS, PM, C, O_FILES, H, PL_FILES, MAN*PODS, EXE_FILES. + +=cut + +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 + + # in case we don't find it below! + if ($self->{VERSION_FROM}) { + my $version_from = macify($self->{VERSION_FROM}); + $pm{$version_from} = File::Spec->catfile('$(INST_LIBDIR)', + $version_from); + } + + $ignore{'test.pl'} = 1; + foreach $name ($self->lsdir(":")){ + next if ($name =~ /^\./ or $ignore{$name}); + next unless $self->libscan($name); + if (-d $name){ + $dir{$name} = $name if (-f ":$name:Makefile.PL"); + } elsif ($name =~ /\.xs$/){ + my($c); ($c = $name) =~ s/\.xs$/.c/; + $xs{$name} = $c; + $c{$c} = 1; + } elsif ($name =~ /\.c(p|pp|xx|c)?$/i){ # .c .C .cpp .cxx .cc .cp + $c{$name} = 1 + unless $name =~ m/perlmain\.c/; # See MAP_TARGET + } elsif ($name =~ /\.h$/i){ + $h{$name} = 1; + } elsif ($name =~ /\.(p[ml]|pod)$/){ + $pm{$name} = File::Spec->catfile('$(INST_LIBDIR)',$name); + } elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") { + ($pl_files{$name} = $name) =~ s/\.PL$// ; + } + } + + # Some larger extensions often wish to install a number of *.pm/pl + # files into the library in various locations. + + # The attribute PMLIBDIRS holds an array reference which lists + # subdirectories which we should search for library files to + # install. PMLIBDIRS defaults to [ 'lib', $self->{BASEEXT} ]. We + # recursively search through the named directories (skipping any + # which don't exist or contain Makefile.PL files). + + # For each *.pm or *.pl file found $self->libscan() is called with + # the default installation path in $_[1]. The return value of + # libscan defines the actual installation location. The default + # libscan function simply returns the path. The file is skipped + # if libscan returns false. + + # The default installation location passed to libscan in $_[1] is: + # + # ./*.pm => $(INST_LIBDIR)/*.pm + # ./xyz/... => $(INST_LIBDIR)/xyz/... + # ./lib/... => $(INST_LIB)/... + # + # In this way the 'lib' directory is seen as the root of the actual + # perl library whereas the others are relative to INST_LIBDIR + # (which includes ROOTEXT). This is a subtle distinction but one + # that's important for nested modules. + + $self->{PMLIBDIRS} = ['lib', $self->{BASEEXT}] + unless $self->{PMLIBDIRS}; + + #only existing directories that aren't in $dir are allowed + + my (@pmlibdirs) = map { macify ($_) } @{$self->{PMLIBDIRS}}; + my ($pmlibdir); + @{$self->{PMLIBDIRS}} = (); + foreach $pmlibdir (@pmlibdirs) { + -d $pmlibdir && !$dir{$pmlibdir} && push @{$self->{PMLIBDIRS}}, $pmlibdir; + } + + if (@{$self->{PMLIBDIRS}}){ + print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n" + if ($Verbose >= 2); + require File::Find; + File::Find::find(sub { + if (-d $_){ + if ($_ eq "CVS" || $_ eq "RCS"){ + $File::Find::prune = 1; + } + return; + } + my($path, $prefix) = ($File::Find::name, '$(INST_LIBDIR)'); + my($striplibpath,$striplibname); + $prefix = '$(INST_LIB)' if (($striplibpath = $path) =~ s:^(\W*)lib\W:$1:); + ($striplibname,$striplibpath) = fileparse($striplibpath); + my($inst) = File::Spec->catfile($prefix,$striplibpath,$striplibname); + local($_) = $inst; # for backwards compatibility + $inst = $self->libscan($inst); + print "libscan($path) => '$inst'\n" if ($Verbose >= 2); + return unless $inst; + $pm{$path} = $inst; + }, @{$self->{PMLIBDIRS}}); + } + + $self->{DIR} = [sort keys %dir] unless $self->{DIR}; + $self->{XS} = \%xs unless $self->{XS}; + $self->{PM} = \%pm unless $self->{PM}; + $self->{C} = [sort keys %c] unless $self->{C}; + $self->{H} = [sort keys %h] unless $self->{H}; + $self->{PL_FILES} = \%pl_files unless $self->{PL_FILES}; + + # Set up names of manual pages to generate from pods + unless ($self->{MAN1PODS}) { + $self->{MAN1PODS} = {}; + } + unless ($self->{MAN3PODS}) { + $self->{MAN3PODS} = {}; + } +} + +=item libscan (o) + +Takes a path to a file that is found by init_dirscan and returns false +if we don't want to include this file in the library. Mainly used to +exclude RCS, CVS, and SCCS directories from installation. + +=cut + +# '; + +sub libscan { + my($self,$path) = @_; + return '' if $path =~ m/:(RCS|CVS|SCCS):/ ; + $path; +} + +=item constants (o) + +Initializes lots of constants and .SUFFIXES and .PHONY + +=cut + +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/ + NAME DISTNAME NAME_SYM VERSION VERSION_SYM XS_VERSION + INST_LIB INST_ARCHLIB PERL_LIB PERL_SRC MACPERL_SRC MACPERL_LIB PERL FULLPERL + XSPROTOARG MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED SOURCE TYPEMAPS + / ) { + next unless defined $self->{$tmp}; + push @m, "$tmp = $self->{$tmp}\n"; + } + + push @m, q{ +MODULES = }.join(" \\\n\t", sort keys %{$self->{PM}})."\n"; + push @m, "PMLIBDIRS = @{$self->{PMLIBDIRS}}\n" if @{$self->{PMLIBDIRS}}; + + push @m, ' + +.INCLUDE : $(MACPERL_SRC)BuildRules.mk + +'; + + push @m, qq{ +VERSION_MACRO = VERSION +DEFINE_VERSION = -d \$(VERSION_MACRO)="¶"\$(VERSION)¶"" +XS_VERSION_MACRO = XS_VERSION +XS_DEFINE_VERSION = -d \$(XS_VERSION_MACRO)="¶"\$(XS_VERSION)¶"" +}; + + $self->{DEFINE} .= " \$(XS_DEFINE_VERSION) \$(DEFINE_VERSION)"; + + push @m, qq{ +MAKEMAKER = $INC{'ExtUtils/MakeMaker.pm'} +MM_VERSION = $ExtUtils::MakeMaker::VERSION +}; + + push @m, q{ +# FULLEXT = Pathname for extension directory (eg DBD:Oracle). +# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. +# ROOTEXT = Directory part of FULLEXT (eg DBD) +# DLBASE = Basename part of dynamic library. May be just equal BASEEXT. +}; + + 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 + } + if ($self->{INC}) { + $self->{INC} =~ s/-I\S+//g; # UN*X includes probably are not useful + } + for $tmp (qw/ + FULLEXT BASEEXT ROOTEXT DEFINE INC + / ) { + next unless defined $self->{$tmp}; + push @m, "$tmp = $self->{$tmp}\n"; + } + + push @m, " +# Handy lists of source code files: +XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})." +C_FILES = ".join(" \\\n\t", @{$self->{C}})." +H_FILES = ".join(" \\\n\t", @{$self->{H}})." +"; + + push @m, ' + +.INCLUDE : $(MACPERL_SRC)ExtBuildRules.mk +'; + + join('',@m); +} + +=item static (o) + +Defines the static target. + +=cut + +sub static { +# --- 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 + +install :: do_install_static + +install_static :: do_install_static +' . $extlib; +} + +=item dlsyms (o) + +Used by MacOS to define DL_FUNCS and DL_VARS and write the *.exp +files. + +=cut + +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'}; + + my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {}; + my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || []; + my(@m); + + push(@m," +dynamic :: $self->{BASEEXT}.exp + +") unless $self->{SKIPHASH}{'dynamic'}; + + my($extlib) = $self->{MYEXTLIB} ? " myextlib" : ""; + + push(@m," +$self->{BASEEXT}.exp: Makefile.PL$extlib +", qq[\t\$(PERL) "-I\$(PERL_LIB)" -e 'use ExtUtils::Mksymlists; ], + 'Mksymlists("NAME" => "',$self->{NAME},'", "DL_FUNCS" => ', + neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\' +'); + + join('',@m); +} + +=item dynamic (o) + +Defines the dynamic target. + +=cut + +sub dynamic { +# --- dynamic Loading Sections --- + + my($self) = shift; + unless (ref $self){ + ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]); + $self = $ExtUtils::MakeMaker::Parent[-1]; + } + ' +all :: dynamic + +install :: do_install_dynamic + +install_dynamic :: do_install_dynamic +'; +} + + +=item clean (o) + +Defines the clean target. + +=cut + +sub clean { +# --- 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 +# the Makefile here so a later make realclean still has a makefile to use. + +clean :: +'); + # clean subdirectories first + for $dir (@{$self->{DIR}}) { + push @m, +" Set OldEcho \{Echo\} + Set Echo 0 + Directory $dir + If \"\`Exists -f $self->{MAKEFILE}\`\" != \"\" + \$(MAKE) clean + End + Set Echo \{OldEcho\} + "; + } + + my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files + push(@otherfiles, patternify($attribs{FILES})) if $attribs{FILES}; + push @m, "\t\$(RM_RF) @otherfiles\n"; + # See realclean and ext/utils/make_ext for usage of Makefile.old + push(@m, + "\t\$(MV) $self->{MAKEFILE} $self->{MAKEFILE}.old\n"); + push(@m, + "\t$attribs{POSTOP}\n") if $attribs{POSTOP}; + join("", @m); +} + +=item realclean (o) + +Defines the realclean target. + +=cut + +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 +realclean purge :: clean +'); + # realclean subdirectories first (already cleaned) + my $sub = +" Set OldEcho \{Echo\} + Set Echo 0 + Directory %s + If \"\`Exists -f %s\`\" != \"\" + \$(MAKE) realclean + End + Set Echo \{OldEcho\} + "; + foreach(@{$self->{DIR}}){ + push(@m, sprintf($sub,$_,"$self->{MAKEFILE}.old","-f $self->{MAKEFILE}.old")); + push(@m, sprintf($sub,$_,"$self->{MAKEFILE}",'')); + } + my(@otherfiles) = ($self->{MAKEFILE}, + "$self->{MAKEFILE}.old"); # Makefiles last + push(@otherfiles, patternify($attribs{FILES})) if $attribs{FILES}; + push(@m, "\t\$(RM_RF) @otherfiles\n") if @otherfiles; + push(@m, "\t$attribs{POSTOP}\n") if $attribs{POSTOP}; + join("", @m); +} + +=item rulez (o) + +=cut + +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) + +.INCLUDE : \$(MACPERL_SRC)BulkBuildRules.mk +'; +} + +sub xsubpp_version +{ + return $ExtUtils::MakeMaker::Version; +} + + +=item processPL (o) + +Defines targets to run *.PL files. + +=cut + +sub processPL { + my($self) = shift; + return "" unless $self->{PL_FILES}; + my(@m, $plfile); + foreach $plfile (sort keys %{$self->{PL_FILES}}) { + my $list = ref($self->{PL_FILES}->{$plfile}) + ? $self->{PL_FILES}->{$plfile} + : [$self->{PL_FILES}->{$plfile}]; + foreach $target (@$list) { + push @m, " +ProcessPL :: $target +\t$self->{NOECHO}\$(NOOP) + +$target :: $plfile +\t\$(PERL) -I\$(MACPERL_LIB) -I\$(PERL_LIB) $plfile $target +"; + } + } + join "", @m; +} + +1; + +__END__ diff --git a/lib/ExtUtils/MM_NW5.pm b/lib/ExtUtils/MM_NW5.pm index d02e0e0..97cee2e 100644 --- a/lib/ExtUtils/MM_NW5.pm +++ b/lib/ExtUtils/MM_NW5.pm @@ -18,10 +18,12 @@ the semantics. =cut +use strict; use Config; use File::Basename; + use vars qw(@ISA $VERSION); -$VERSION = '2.01_01'; +$VERSION = '2.02_01'; require ExtUtils::MM_Win32; @ISA = qw(ExtUtils::MM_Win32); @@ -30,33 +32,30 @@ use ExtUtils::MakeMaker qw( &neatvalue ); $ENV{EMXSHELL} = 'sh'; # to run `commands` -$BORLAND = 1 if $Config{'cc'} =~ /^bcc/i; -$GCC = 1 if $Config{'cc'} =~ /^gcc/i; -$DMAKE = 1 if $Config{'make'} =~ /^dmake/i; -$NMAKE = 1 if $Config{'make'} =~ /^nmake/i; -$PERLMAKE = 1 if $Config{'make'} =~ /^pmake/i; +my $BORLAND = 1 if $Config{'cc'} =~ /^bcc/i; +my $GCC = 1 if $Config{'cc'} =~ /^gcc/i; +my $DMAKE = 1 if $Config{'make'} =~ /^dmake/i; - -sub init_others -{ - my ($self) = @_; - $self->SUPER::init_others(@_); +sub init_others { + my ($self) = @_; + $self->SUPER::init_others(@_); - # incpath is copied to makefile var INCLUDE in constants sub, here just make it empty - my $libpth = $Config{'libpth'}; - $libpth =~ s( )(;); - $self->{'LIBPTH'} = $libpth; - $self->{'BASE_IMPORT'} = $Config{'base_import'}; + # incpath is copied to makefile var INCLUDE in constants sub, here just + # make it empty + my $libpth = $Config{'libpth'}; + $libpth =~ s( )(;); + $self->{'LIBPTH'} = $libpth; + $self->{'BASE_IMPORT'} = $Config{'base_import'}; - # Additional import file specified from Makefile.pl - if($self->{'base_import'}) { - $self->{'BASE_IMPORT'} .= ', ' . $self->{'base_import'}; - } + # Additional import file specified from Makefile.pl + if($self->{'base_import'}) { + $self->{'BASE_IMPORT'} .= ', ' . $self->{'base_import'}; + } - $self->{'NLM_VERSION'} = $Config{'nlm_version'}; - $self->{'MPKTOOL'} = $Config{'mpktool'}; - $self->{'TOOLPATH'} = $Config{'toolpath'}; + $self->{'NLM_VERSION'} = $Config{'nlm_version'}; + $self->{'MPKTOOL'} = $Config{'mpktool'}; + $self->{'TOOLPATH'} = $Config{'toolpath'}; } @@ -65,15 +64,17 @@ sub init_others Initializes lots of constants and .SUFFIXES and .PHONY =cut -# NetWare override + sub const_cccmd { my($self,$libperl)=@_; return $self->{CONST_CCCMD} if $self->{CONST_CCCMD}; return '' unless $self->needs_linking(); - return $self->{CONST_CCCMD} = - q{CCCMD = $(CC) $(CCFLAGS) $(INC) $(OPTIMIZE) \\ - $(PERLTYPE) $(MPOLLUTE) -o $@ \\ - -DVERSION=\"$(VERSION)\" -DXS_VERSION=\"$(XS_VERSION)\"}; + return $self->{CONST_CCCMD} = <<'MAKE_FRAG'; +CCCMD = $(CC) $(CCFLAGS) $(INC) $(OPTIMIZE) \ + $(PERLTYPE) $(MPOLLUTE) -o $@ \ + -DVERSION="$(VERSION)" -DXS_VERSION="$(XS_VERSION)" +MAKE_FRAG + } sub constants { @@ -92,27 +93,27 @@ sub constants { INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC - PERL_INC PERL FULLPERL LIBPTH BASE_IMPORT PERLRUN FULLPERLRUN PERLRUNINST - FULL_AR PERL_CORE FULLPERLRUNINST NLM_VERSION MPKTOOL TOOLPATH - + PERL_INC PERL FULLPERL LIBPTH BASE_IMPORT PERLRUN + FULLPERLRUN PERLRUNINST FULLPERLRUNINST + FULL_AR PERL_CORE NLM_VERSION MPKTOOL TOOLPATH + / ) { next unless defined $self->{$tmp}; push @m, "$tmp = $self->{$tmp}\n"; } - (my $boot = $self->{'NAME'}) =~ s/:/_/g; - $self->{'BOOT_SYMBOL'}=$boot; - push @m, "BOOT_SYMBOL = $self->{'BOOT_SYMBOL'}\n"; - - # If the final binary name is greater than 8 chars, - # truncate it here and rename it after creation - # otherwise, Watcom Linker fails - - if(length($self->{'BASEEXT'}) > 8) { - $self->{'NLM_SHORT_NAME'} = substr($self->{'BASEEXT'},0,8); - push @m, "NLM_SHORT_NAME = $self->{'NLM_SHORT_NAME'}\n"; - } - + (my $boot = $self->{'NAME'}) =~ s/:/_/g; + $self->{'BOOT_SYMBOL'}=$boot; + push @m, "BOOT_SYMBOL = $self->{'BOOT_SYMBOL'}\n"; + + # If the final binary name is greater than 8 chars, + # truncate it here and rename it after creation + # otherwise, Watcom Linker fails + if(length($self->{'BASEEXT'}) > 8) { + $self->{'NLM_SHORT_NAME'} = substr($self->{'BASEEXT'},0,8); + push @m, "NLM_SHORT_NAME = $self->{'NLM_SHORT_NAME'}\n"; + } + push @m, qq{ VERSION_MACRO = VERSION DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\" @@ -120,24 +121,22 @@ XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\" }; - # Get the include path and replace the spaces with ; - # Copy this to makefile as INCLUDE = d:\...;d:\; - (my $inc = $Config{'incpath'}) =~ s/([ ]*)-I/;/g; + # Get the include path and replace the spaces with ; + # Copy this to makefile as INCLUDE = d:\...;d:\; + (my $inc = $Config{'incpath'}) =~ s/([ ]*)-I/;/g; - # Get the additional include path and append to INCLUDE, keep it in - # INC will give problems during compilation, hence reset it after getting - # the value - $self->{'INC'} = ''; - push @m, qq{ -INCLUDE = $inc; -}; + # Get the additional include path and append to INCLUDE, keeping it + # in INC will give problems during compilation, hence reset it + # after getting the value + $self->{INC} = ''; -push @m, qq{ + push @m, qq{ INCLUDE = $inc; }; - # Set the path to CodeWarrior binaries which might not have been set in - # any other place - push @m, qq{ + + # Set the path to CodeWarrior binaries which might not have been set in + # any other place + push @m, qq{ PATH = \$(PATH);\$(TOOLPATH) }; @@ -194,12 +193,6 @@ makemakerdflt: all .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT) -# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that -# some make implementations will delete the Makefile when we rebuild it. Because -# we call false(1) when we rebuild it. So make(1) is not completely wrong when it -# does so. Our milage may vary. -# .PRECIOUS: Makefile # seems to be not necessary anymore - .PHONY: all config static dynamic test linkext manifest # Where is the Config information that we are using/depend on @@ -239,12 +232,6 @@ EXPORT_LIST = $tmp PERL_ARCHIVE = $tmp "; -# push @m, q{ -#INST_PM = }.join(" \\\n\t", sort values %{$self->{PM}}).q{ -# -#PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{ -#}; - push @m, q{ TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{ @@ -254,38 +241,50 @@ PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{ join('',@m); } + +=item static_lib (o) + +=cut + sub static_lib { my($self) = @_; -# Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC -# return '' unless $self->needs_linking(); #might be because of a subdir return '' unless $self->has_link_code; - my(@m); - push(@m, <<'END'); + my $m = <<'END'; $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)\.exists $(RM_RF) $@ END # If this extension has it's own library (eg SDBM_File) # then copy that to $(INST_STATIC) and add $(OBJECT) into it. - push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB}; + $m .= <<'END' if $self->{MYEXTLIB}; + $self->{CP} $(MYEXTLIB) $\@ +END + + my $ar_arg; + if( $BORLAND ) { + $ar_arg = '$@ $(OBJECT:^"+")'; + } + elsif( $GCC ) { + $ar_arg = '-ru $@ $(OBJECT)'; + } + else { + $ar_arg = '-type library -o $@ $(OBJECT)'; + } - push @m, -q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")' - : ($GCC ? '-ru $@ $(OBJECT)' - : '-type library -o $@ $(OBJECT)')).q{ - }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld + $m .= sprintf <<'END', $ar_arg; + $(AR) %s + $(NOECHO)echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld $(CHMOD) 755 $@ -}; -# CW change ( -type library ... ) -# Old mechanism - still available: +END + + $m .= <<'END' if $self->{PERL_SRC}; + $(NOECHO)echo "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs - push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs}."\n\n" - if $self->{PERL_SRC}; +END - push @m, $self->dir_target('$(INST_ARCHAUTODIR)'); - join('', "\n",@m); + return $m; } @@ -296,7 +295,7 @@ Defines how to produce the *.so (or equivalent) files. =cut sub dynamic_lib { - my($self, %attribs) = @_; + my($self, %attribs) = @_; return '' unless $self->needs_linking(); #might be because of a subdir return '' unless $self->has_link_code; @@ -304,96 +303,64 @@ sub dynamic_lib { my($otherldflags) = $attribs{OTHERLDFLAGS} || ($BORLAND ? 'c0d32.obj': ''); my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || ""; my($ldfrom) = '$(LDFROM)'; - my(@m); - (my $boot = $self->{NAME}) =~ s/:/_/g; - my ($mpk); - push(@m,' + + (my $boot = $self->{NAME}) =~ s/:/_/g; + + my $m = <<'MAKE_FRAG'; # This section creates the dynamically loadable $(INST_DYNAMIC) # from $(OBJECT) and possibly $(MYEXTLIB). OTHERLDFLAGS = '.$otherldflags.' INST_DYNAMIC_DEP = '.$inst_dynamic_dep.' +# Create xdc data for an MT safe NLM in case of mpk build $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) -'); -# push(@m, -# q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) } -# .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)}); - - # Create xdc data for an MT safe NLM in case of mpk build -# if ( scalar(keys %XS) == 0 ) { return; } - push(@m, - q{ @echo Export boot_$(BOOT_SYMBOL) > $(BASEEXT).def -}); - push(@m, - q{ @echo $(BASE_IMPORT) >> $(BASEEXT).def -}); - push(@m, - q{ @echo Import @$(PERL_INC)\perl.imp >> $(BASEEXT).def -}); - - if ( $self->{CCFLAGS} =~ m/ -DMPK_ON /) { - $mpk=1; - push @m, ' $(MPKTOOL) $(XDCFLAGS) $(BASEEXT).xdc -'; - push @m, ' @echo xdcdata $(BASEEXT).xdc >> $(BASEEXT).def -'; - } else { - $mpk=0; - } - - push(@m, - q{ $(LD) $(LDFLAGS) $(OBJECT:.obj=.obj) } - ); - - push(@m, - q{ -desc "Perl 5.7.3 Extension ($(BASEEXT)) XS_VERSION: $(XS_VERSION)" -nlmversion $(NLM_VERSION) } - ); - - # Taking care of long names like FileHandle, ByteLoader, SDBM_File etc - if($self->{NLM_SHORT_NAME}) { - # In case of nlms with names exceeding 8 chars, build nlm in the - # current dir, rename and move to auto\lib. If we create in auto\lib - # in the first place, we can't rename afterwards. - push(@m, - q{ -o $(NLM_SHORT_NAME).$(DLEXT)} - ); - } else { - push(@m, - q{ -o $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)} - ); - } - # Add additional lib files if any (SDBM_File) - if($self->{MYEXTLIB}) { - push(@m, - q{ $(MYEXTLIB) } - ); - } - -#For now lets comment all the Watcom lib calls -#q{ LibPath $(LIBPTH) Library plib3s.lib Library math3s.lib Library clib3s.lib Library emu387.lib Library $(PERL_ARCHIVE) Library $(PERL_INC)\Main.lib} - - - push(@m, - q{ $(PERL_INC)\Main.lib} - .q{ -commandfile $(BASEEXT).def } - ); - - # If it is having a short name, rename it - if($self->{NLM_SHORT_NAME}) { - push @m, ' - if exist $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT) del $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)'; - push @m, ' - rename $(NLM_SHORT_NAME).$(DLEXT) $(BASEEXT).$(DLEXT)'; - push @m, ' - move $(BASEEXT).$(DLEXT) $(INST_AUTODIR)'; - } - - push @m, ' + @echo Export boot_$(BOOT_SYMBOL) > $(BASEEXT).def + @echo $(BASE_IMPORT) >> $(BASEEXT).def + @echo Import @$(PERL_INC)\perl.imp >> $(BASEEXT).def +MAKE_FRAG + + + if ( $self->{CCFLAGS} =~ m/ -DMPK_ON /) { + $m .= <<'MAKE_FRAG'; + $(MPKTOOL) $(XDCFLAGS) $(BASEEXT).xdc + @echo xdcdata $(BASEEXT).xdc >> $(BASEEXT).def +MAKE_FRAG + } + + $m .= ' $(LD) $(LDFLAGS) $(OBJECT:.obj=.obj) -desc "Perl 5.7.3 Extension ($(BASEEXT)) XS_VERSION: $(XS_VERSION)" -nlmversion $(NLM_VERSION)'; + + # Taking care of long names like FileHandle, ByteLoader, SDBM_File etc + if($self->{NLM_SHORT_NAME}) { + # In case of nlms with names exceeding 8 chars, build nlm in the + # current dir, rename and move to auto\lib. If we create in auto\lib + # in the first place, we can't rename afterwards. + $m .= q{ -o $(NLM_SHORT_NAME).$(DLEXT)} + } else { + $m .= q{ -o $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)} + } + + # Add additional lib files if any (SDBM_File) + $m .= q{ $(MYEXTLIB) } if $self->{MYEXTLIB}; + + $m .= q{ $(PERL_INC)\Main.lib -commandfile $(BASEEXT).def}."\n"; + + # If it is having a short name, rename it + if($self->{NLM_SHORT_NAME}) { + $m .= <<'MAKE_FRAG'; + if exist $(INST_AUTODIR)\$(BASEEXT).$(DLEXT) del $(INST_AUTODIR)\$(BASEEXT).$(DLEXT) + rename $(NLM_SHORT_NAME).$(DLEXT) $(BASEEXT).$(DLEXT) + move $(BASEEXT).$(DLEXT) $(INST_AUTODIR) +MAKE_FRAG + } + + $m .= <<'MAKE_FRAG'; + $(CHMOD) 755 $@ -'; +MAKE_FRAG + + $m .= $self->dir_target('$(INST_ARCHAUTODIR)'); - push @m, $self->dir_target('$(INST_ARCHAUTODIR)'); - join('',@m); + return $m; } @@ -404,3 +371,4 @@ __END__ =cut + diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index a31d56c..4cd97da 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -12,7 +12,7 @@ use File::Spec; use DirHandle; use strict; use vars qw($VERSION @ISA - $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_VOS $Is_NetWare + $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_VOS $Verbose %pm %static $Xsubpp_Version %Config_Override ); @@ -26,7 +26,7 @@ require ExtUtils::MM_Any; $Is_OS2 = $^O eq 'os2'; $Is_Mac = $^O eq 'MacOS'; -$Is_Win32 = $^O eq 'MSWin32' || $Config{'osname'} eq 'NetWare'; +$Is_Win32 = $^O eq 'MSWin32' || $Config{osname} eq 'NetWare'; $Is_Dos = $^O eq 'dos'; $Is_VOS = $^O eq 'vos'; $Is_VMS = $^O eq 'VMS'; diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index d3c9ede..044bd2e 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -14,7 +14,7 @@ use VMS::Filespec; use File::Basename; use File::Spec; use vars qw($Revision @ISA $VERSION); -($VERSION) = $Revision = '5.63_01'; +($VERSION) = $Revision = '5.64_01'; require ExtUtils::MM_Any; require ExtUtils::MM_Unix; @@ -734,11 +734,10 @@ command line to find args. sub pm_to_blib { my($self) = @_; - my($line,$from,$to,@m); my($autodir) = File::Spec->catdir($self->{INST_LIB},'auto'); - my(@files) = @{$self->{PM_TO_BLIB}}; + my(%files) = @{$self->{PM_TO_BLIB}}; - push @m, q{ + my $m = <<'MAKE_FRAG'; # Dummy target to match Unix target name; we use pm_to_blib.ts as # timestamp file to avoid repeated invocations under VMS @@ -747,28 +746,38 @@ pm_to_blib : pm_to_blib.ts # As always, keep under DCL's 255-char limit pm_to_blib.ts : $(TO_INST_PM) -}; - - if (scalar(@files) > 0) { # protect ourselves from empty PM_TO_BLIB - - push(@m,qq[\t\$(NOECHO) \$(RM_F) .MM_tmp\n]); - $line = ''; # avoid uninitialized var warning - while ($from = shift(@files),$to = shift(@files)) { - $line .= " $from $to"; - if (length($line) > 128) { - push(@m,"\t\$(NOECHO) \$(PERL) -e \"print '$line'\" >>.MM_tmp\n"); - $line = ''; - } - } - push(@m,"\t\$(NOECHO) \$(PERL) -e \"print '$line'\" >>.MM_tmp\n") if $line; +MAKE_FRAG + + if( keys %files ) { + $m .= <<'MAKE_FRAG'; + $(NOECHO) $(RM_F) .MM_tmp +MAKE_FRAG + + my $line = ''; + while (my($from, $to) = each %files) { + $line .= " $from $to"; + if (length($line) > 128) { + $m .= sprintf <<'MAKE_FRAG', $line; + $(NOECHO) $(PERL) -e "print '%s'" >>.MM_tmp +MAKE_FRAG + $line = ''; + } + } + $m .= sprintf <<'MAKE_FRAG', $line if $line; + $(NOECHO) $(PERL) -e "print '%s'" >>.MM_tmp +MAKE_FRAG - push(@m,q[ $(PERLRUN) "-MExtUtils::Install" -e "pm_to_blib({split(' ',)},'].$autodir.q[','$(PM_FILTER)')" <.MM_tmp]); - push(@m,qq[\n\t\$(NOECHO) \$(RM_F) .MM_tmp\n]); + $m .= sprintf <<'MAKE_FRAG', $autodir; + $(PERLRUN) "-MExtUtils::Install" -e "pm_to_blib({split(' ',)},'%s','$(PM_FILTER)')" <.MM_tmp + $(NOECHO) $(RM_F) .MM_tmp +MAKE_FRAG } - push(@m,qq[\t\$(NOECHO) \$(TOUCH) pm_to_blib.ts]); + $m .= <<'MAKE_FRAG'; + $(NOECHO) $(TOUCH) pm_to_blib.ts +MAKE_FRAG - join('',@m); + return $m; } =item tool_autosplit (override) diff --git a/lib/ExtUtils/MM_Win95.pm b/lib/ExtUtils/MM_Win95.pm index 65fac14..a6eddae 100644 --- a/lib/ExtUtils/MM_Win95.pm +++ b/lib/ExtUtils/MM_Win95.pm @@ -7,7 +7,20 @@ require ExtUtils::MM_Win32; @ISA = qw(ExtUtils::MM_Win32); -# a few workarounds for command.com (very basic) +=head1 NAME + +ExtUtils::MM_Win95 - method to customize MakeMaker for Win9X + +=head1 SYNOPSIS + + You should not be using this module directly. + +=head1 DESCRIPTION + +This is a subclass of ExtUtils::MM_Win32 containing changes necessary +to get MakeMaker playing nice with command.com and other Win9Xisms. + +=cut sub dist_test { my($self) = shift; diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 3614050..dbd881d 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -2,10 +2,10 @@ BEGIN {require 5.004;} package ExtUtils::MakeMaker; -$VERSION = "5.91_02"; +$VERSION = "5.92_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.44 $, 10)) =~ s/\s+$//; +($Revision = substr(q$Revision: 1.46 $, 10)) =~ s/\s+$//; require Exporter; use Config; @@ -79,7 +79,8 @@ sub prompt ($;$) { sub eval_in_subdirs { my($self) = @_; use Cwd qw(cwd abs_path); - my $pwd = cwd(); + my $pwd = cwd() || die "Can't figure out your cwd!"; + local @INC = map eval {abs_path($_) if -e} || $_, @INC; push @INC, '.'; # '.' has to always be at the end of @INC @@ -1811,7 +1812,7 @@ MakeMaker object. The following lines will be parsed o.k.: $VERSION = '1.00'; *VERSION = \'1.01'; - ( $VERSION ) = '$Revision: 1.43 $ ' =~ /\$Revision:\s+([^\s]+)/; + ( $VERSION ) = '$Revision: 1.46 $ ' =~ /\$Revision:\s+([^\s]+)/; $FOO::VERSION = '1.10'; *FOO::VERSION = \'1.11'; our $VERSION = 1.2.3; # new for perl5.6.0