summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Koenig <k@anna.in-berlin.de>1996-12-26 10:01:43 +1200
committerChip Salzenberg <chip@atlantic.net>1996-12-28 06:22:00 +1200
commitbab2b58eb229f3521c656bf2c94ca56750560fe3 (patch)
treea61d3a3bf92ea5c82d75abc1b4d0de4cbc1b73fa
parent2ace3117e8814e0a6ee3b0c45306adda1a3bba77 (diff)
downloadperl-bab2b58eb229f3521c656bf2c94ca56750560fe3.tar.gz
Refresh MakeMaker to 5.39
-rw-r--r--lib/ExtUtils/Install.pm4
-rw-r--r--lib/ExtUtils/Liblist.pm2
-rw-r--r--lib/ExtUtils/MM_Unix.pm139
-rw-r--r--lib/ExtUtils/MakeMaker.pm88
-rw-r--r--lib/ExtUtils/Mksymlists.pm2
5 files changed, 162 insertions, 73 deletions
diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm
index dda132565f..c7eb8b4028 100644
--- a/lib/ExtUtils/Install.pm
+++ b/lib/ExtUtils/Install.pm
@@ -1,7 +1,7 @@
package ExtUtils::Install;
-$VERSION = substr q$Revision: 1.15 $, 10;
-# $Date: 1996/09/03 21:58:58 $
+$VERSION = substr q$Revision: 1.16 $, 10;
+# $Date: 1996/12/17 00:31:26 $
use Exporter;
use Carp ();
diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm
index eac7c13ad5..9664e54127 100644
--- a/lib/ExtUtils/Liblist.pm
+++ b/lib/ExtUtils/Liblist.pm
@@ -2,7 +2,7 @@ package ExtUtils::Liblist;
use vars qw($VERSION);
# Broken out of MakeMaker from version 4.11
-$VERSION = substr q$Revision: 1.20 $, 10;
+$VERSION = substr q$Revision: 1.21 $, 10;
use Config;
use Cwd 'cwd';
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index ea4741f23d..f4ba1d73da 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -5,16 +5,16 @@ use Config;
use File::Basename qw(basename dirname fileparse);
use DirHandle;
use strict;
-use vars qw($VERSION $Is_Mac $Is_OS2 $Is_VMS
+use vars qw($VERSION $Is_Mac $Is_OS2 $Is_VMS
$Verbose %pm %static $Xsubpp_Version);
-$VERSION = substr q$Revision: 1.107 $, 10;
-# $Id: MM_Unix.pm,v 1.107 1996/09/03 20:53:39 k Exp $
+$VERSION = substr q$Revision: 1.109 $, 10;
+# $Id: MM_Unix.pm,v 1.109 1996/12/17 00:42:32 k Exp k $
Exporter::import('ExtUtils::MakeMaker',
qw( $Verbose &neatvalue));
-$Is_OS2 = $^O =~ m|^os/?2$|i;
+$Is_OS2 = $^O eq 'os2';
$Is_Mac = $^O eq "MacOS";
if ($Is_VMS = $^O eq 'VMS') {
@@ -61,7 +61,7 @@ sections and complain loudly to the makemaker mailing list.
Not all of the methods below are overridable in a
Makefile.PL. Overridable methods are marked as (o). All methods are
overridable by a platform specific MM_*.pm file (See
-L<ExtUtils::MM_VMS> and L<ExtUtils::MM_OS2>).
+L<ExtUtils::MM_VMS>) and L<ExtUtils::MM_OS2>).
=head2 Preloaded methods
@@ -236,8 +236,12 @@ use SelfLoader;
__DATA__
+=back
+
=head2 SelfLoaded methods
+=over 2
+
=item c_o (o)
Defines the suffix rules to compile different flavors of C files to
@@ -492,7 +496,7 @@ sub constants {
AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION
VERSION_SYM XS_VERSION INST_BIN INST_EXE INST_LIB
- INST_ARCHLIB INST_SCRIPT PREFIX INSTALLDIRS
+ INST_ARCHLIB INST_SCRIPT PREFIX INSTALLDIRS
INSTALLPRIVLIB INSTALLARCHLIB INSTALLSITELIB
INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
@@ -1084,12 +1088,14 @@ in these dirs:
0; # false and not empty
}
+=back
+
=head2 Methods to actually produce chunks of text for the Makefile
-The methods here are called in the order specified by
-@ExtUtils::MakeMaker::MM_Sections. This manpage reflects the order as
-well as possible. Some methods call each other, so in doubt refer to
-the code.
+The methods here are called for each MakeMaker object in the order
+specified by @ExtUtils::MakeMaker::MM_Sections.
+
+=over 2
=item force (o)
@@ -1376,7 +1382,7 @@ sub init_main {
# It may also edit @modparts if required.
if (defined &DynaLoader::mod2fname) {
$modfname = &DynaLoader::mod2fname(\@modparts);
- }
+ }
($self->{PARENT_NAME}, $self->{BASEEXT}) = $self->{NAME} =~ m!([\w:]+::)?(\w+)$! ;
@@ -1421,7 +1427,16 @@ sub init_main {
$self->{PERL_INC} = $self->{PERL_SRC};
# catch a situation that has occurred a few times in the past:
- warn <<EOM unless (-s $self->catfile($self->{PERL_SRC},'cflags') or $Is_VMS && -s $self->catfile($self->{PERL_SRC},'perlshr_attr.opt') or $Is_Mac);
+ unless (
+ -s $self->catfile($self->{PERL_SRC},'cflags')
+ or
+ $Is_VMS
+ &&
+ -s $self->catfile($self->{PERL_SRC},'perlshr_attr.opt')
+ or
+ $Is_Mac
+ ){
+ warn qq{
You cannot build extensions below the perl source tree after executing
a 'make clean' in the perl source tree.
@@ -1433,26 +1448,27 @@ usually without extra arguments.
It is recommended that you unpack and build additional extensions away
from the perl source tree.
-EOM
+};
+ }
} else {
# we should also consider $ENV{PERL5LIB} here
$self->{PERL_LIB} ||= $Config::Config{privlibexp};
$self->{PERL_ARCHLIB} ||= $Config::Config{archlibexp};
$self->{PERL_INC} = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
my $perl_h;
- die <<EOM unless (-f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h")));
+ unless (-f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h"))){
+ die qq{
Error: Unable to locate installed Perl libraries or Perl source code.
It is recommended that you install perl in a standard location before
-building extensions. You can say:
-
- $^X Makefile.PL PERL_SRC=/path/to/perl/source/directory
-
-if you have not yet installed perl but still want to build this
-extension now.
-(You get this message, because MakeMaker could not find "$perl_h")
-EOM
+building extensions. Some precompiled versions of perl do not contain
+these header files, so you cannot build extensions. In such a case,
+please build and install your perl from a fresh perl distribution. It
+usually solves this kind of problem.
+\(You get this message, because MakeMaker could not find "$perl_h"\)
+};
+ }
# print STDOUT "Using header files found in $self->{PERL_INC}\n"
# if $Verbose && $self->needs_linking();
@@ -1495,7 +1511,7 @@ EOM
# The user who requests an installation directory explicitly
# should not have to tell us a architecture installation directory
- # as well We look if a directory exists that is named after the
+ # as well. We look if a directory exists that is named after the
# architecture. If not we take it as a sign that it should be the
# same as the requested installation directory. Otherwise we take
# the found one.
@@ -1523,23 +1539,67 @@ EOM
# requested values. We're going to set the $Config{prefix} part of
# all the installation path variables to literally $(PREFIX), so
# the user can still say make PREFIX=foo
- my($prefix) = $Config{'prefix'};
+ my($configure_prefix) = $Config{'prefix'};
$prefix = VMS::Filespec::unixify($prefix) if $Is_VMS;
- unless ($self->{PREFIX}){
- $self->{PREFIX} = $prefix;
+ $self->{PREFIX} ||= $configure_prefix;
+
+
+ my($install_variable,$search_prefix,$replace_prefix);
+
+ # The rule, taken from Configure, is that if prefix contains perl,
+ # we shape the tree
+ # perlprefix/lib/ INSTALLPRIVLIB
+ # perlprefix/lib/pod/
+ # perlprefix/lib/site_perl/ INSTALLSITELIB
+ # perlprefix/bin/ INSTALLBIN
+ # perlprefix/man/ INSTALLMAN1DIR
+ # else
+ # prefix/lib/perl5/ INSTALLPRIVLIB
+ # prefix/lib/perl5/pod/
+ # prefix/lib/perl5/site_perl/ INSTALLSITELIB
+ # prefix/bin/ INSTALLBIN
+ # prefix/lib/perl5/man/ INSTALLMAN1DIR
+
+ $replace_prefix = qq[\$\(PREFIX\)];
+ for $install_variable (qw/
+ INSTALLBIN
+ INSTALLSCRIPT
+ /) {
+ $self->prefixify($install_variable,$configure_prefix,$replace_prefix);
+ }
+ $search_prefix = $configure_prefix =~ /perl/ ?
+ $self->catdir($configure_prefix,"lib") :
+ $self->catdir($configure_prefix,"lib","perl5");
+ if ($self->{LIB}) {
+ $self->{INSTALLPRIVLIB} = $self->{INSTALLSITELIB} = $self->{LIB};
+ $self->{INSTALLARCHLIB} = $self->{INSTALLSITEARCH} =
+ $self->catdir($self->{LIB},$Config{'archname'});
+ } else {
+ $replace_prefix = $self->{PREFIX} =~ /perl/ ?
+ $self->catdir(qq[\$\(PREFIX\)],"lib") :
+ $self->catdir(qq[\$\(PREFIX\)],"lib","perl5");
+ for $install_variable (qw/
+ INSTALLPRIVLIB
+ INSTALLARCHLIB
+ INSTALLSITELIB
+ INSTALLSITEARCH
+ /) {
+ $self->prefixify($install_variable,$search_prefix,$replace_prefix);
+ }
}
- my($install_variable);
+ $search_prefix = $configure_prefix =~ /perl/ ?
+ $self->catdir($configure_prefix,"man") :
+ $self->catdir($configure_prefix,"lib","perl5","man");
+ $replace_prefix = $self->{PREFIX} =~ /perl/ ?
+ $self->catdir(qq[\$\(PREFIX\)],"man") :
+ $self->catdir(qq[\$\(PREFIX\)],"lib","perl5","man");
for $install_variable (qw/
-
- INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN
- INSTALLMAN1DIR INSTALLMAN3DIR INSTALLSCRIPT
- INSTALLSITELIB INSTALLSITEARCH
-
+ INSTALLMAN1DIR
+ INSTALLMAN3DIR
/) {
- $self->prefixify($install_variable,$prefix,q[$(PREFIX)]);
+ $self->prefixify($install_variable,$search_prefix,$replace_prefix);
}
-
# Now we head at the manpages. Maybe they DO NOT want manpages
# installed
$self->{INSTALLMAN1DIR} = $Config::Config{installman1dir}
@@ -1975,7 +2035,7 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
$cccmd = $self->const_cccmd($libperl);
$cccmd =~ s/^CCCMD\s*=\s*//;
$cccmd =~ s/\$\(INC\)/ -I$self->{PERL_INC} /;
- $cccmd .= " $Config::Config{cccdlflags}"
+ $cccmd .= " $Config::Config{cccdlflags}"
if ($Config::Config{useshrplib} eq 'true');
$cccmd =~ s/\(CC\)/\(PERLMAINCC\)/;
@@ -2343,9 +2403,9 @@ sub parse_version {
my $eval = qq{
package ExtUtils::MakeMaker::_version;
no strict;
-
- \$$1=undef; do {
- $_
+
+ \$$1=undef; do {
+ $_
}; \$$1
};
local($^W) = 0;
@@ -2373,7 +2433,7 @@ sub pasthru {
my($sep) = $Is_VMS ? ',' : '';
$sep .= "\\\n\t";
- foreach $key (qw(LIBPERL_A LINKTYPE PREFIX OPTIMIZE)){
+ foreach $key (qw(LIB LIBPERL_A LINKTYPE PREFIX OPTIMIZE)){
push @pasthru, "$key=\"\$($key)\"";
}
@@ -3138,6 +3198,7 @@ sub xs_o { # many makes are too dumb to use xs_c then c_o
1;
+=back
=head1 SEE ALSO
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index f6da518ee4..2d3dd56e6a 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -2,10 +2,10 @@ BEGIN {require 5.002;} # MakeMaker 5.17 was the last MakeMaker that was compatib
package ExtUtils::MakeMaker;
-$Version = $VERSION = "5.38";
+$Version = $VERSION = "5.39";
$Version_OK = "5.17"; # Makefiles older than $Version_OK will die
# (Will be checked from MakeMaker version 4.13 onwards)
-($Revision = substr(q$Revision: 1.207 $, 10)) =~ s/\s+$//;
+($Revision = substr(q$Revision: 1.208 $, 10)) =~ s/\s+$//;
@@ -69,7 +69,7 @@ package ExtUtils::MakeMaker;
# Now we can can pull in the friends
#
$Is_VMS = $^O eq 'VMS';
-$Is_OS2 = $^O =~ m|^os/?2$|i;
+$Is_OS2 = $^O eq 'os2';
$Is_Mac = $^O eq 'MacOS';
require ExtUtils::MM_Unix;
@@ -236,7 +236,7 @@ sub full_setup {
INSTALLARCHLIB INSTALLBIN INSTALLDIRS INSTALLMAN1DIR
INSTALLMAN3DIR INSTALLPRIVLIB INSTALLSCRIPT INSTALLSITEARCH
INSTALLSITELIB INST_ARCHLIB INST_BIN INST_EXE INST_LIB
- INST_MAN1DIR INST_MAN3DIR INST_SCRIPT LDFROM LIBPERL_A LIBS
+ INST_MAN1DIR INST_MAN3DIR INST_SCRIPT LDFROM LIBPERL_A LIB LIBS
LINKTYPE MAKEAPERL MAKEFILE MAN1PODS MAN3PODS MAP_TARGET MYEXTLIB
NAME NEEDS_LINKING NOECHO NORECURS OBJECT OPTIMIZE PERL PERLMAINCC
PERL_ARCHLIB PERL_LIB PERL_SRC PL_FILES PM PMLIBDIRS PREFIX
@@ -408,10 +408,7 @@ sub ExtUtils::MakeMaker::new {
# This is for old Makefiles written pre 5.00, will go away
if ( Carp::longmess("") =~ /runsubdirpl/s ){
- #$self->{Correct_relativ_directories}++;
Carp::carp("WARNING: Please rerun 'perl Makefile.PL' to regenerate your Makefiles\n");
- } else {
- $self->{Correct_relativ_directories}=0;
}
my $newclass = ++$PACKNAME;
@@ -557,15 +554,8 @@ sub parse_args{
(getpwuid($>))[7]
]ex;
}
- # This may go away, in mid 1996
-# if ($self->{Correct_relativ_directories}){
-# $value = $self->catdir("..",$value)
-# if $Prepend_dot_dot{$name} && ! $self->file_name_is_absolute($value);
-# }
$self->{uc($name)} = $value;
}
- # This may go away, in mid 1996
- delete $self->{Correct_relativ_directories};
# catch old-style 'potential_libs' and inform user how to 'upgrade'
if (defined $self->{potential_libs}){
@@ -862,18 +852,26 @@ Makefiles with a single invocation of WriteMakefile().
=head2 How To Write A Makefile.PL
-The short answer is: Don't. Run h2xs(1) before you start thinking
-about writing a module. For so called pm-only modules that consist of
-C<*.pm> files only, h2xs has the very useful C<-X> switch. This will
-generate dummy files of all kinds that are useful for the module
-developer.
+The short answer is: Don't.
+
+ Always begin with h2xs.
+ Always begin with h2xs!
+ ALWAYS BEGIN WITH H2XS!
+
+even if you're not building around a header file, and even if you
+don't have an XS component.
+
+Run h2xs(1) before you start thinking about writing a module. For so
+called pm-only modules that consist of C<*.pm> files only, h2xs has
+the C<-X> switch. This will generate dummy files of all kinds that are
+useful for the module developer.
The medium answer is:
use ExtUtils::MakeMaker;
WriteMakefile( NAME => "Foo::Bar" );
-The long answer is below.
+The long answer is the rest of the manpage :-)
=head2 Default Makefile Behaviour
@@ -899,7 +897,7 @@ Other interesting targets in the generated Makefile are
=head2 make test
-MakeMaker checks for the existence of a file named "test.pl" in the
+MakeMaker checks for the existence of a file named F<test.pl> in the
current directory and if it exists it adds commands to the test target
of the generated Makefile that will execute the script with the proper
set of perl C<-I> options.
@@ -909,6 +907,22 @@ add commands to the test target of the generated Makefile that execute
all matching files via the L<Test::Harness> module with the C<-I>
switches set correctly.
+=head2 make testdb
+
+A useful variation of the above is the target C<testdb>. It runs the
+test under the Perl debugger (see L<perldebug>). If the file
+F<test.pl> exists in the current directory, it is used for the test.
+
+If you want to debug some other testfile, set C<TEST_FILE> variable
+thusly:
+
+ make testdb TEST_FILE=t/mytest.t
+
+By default the debugger is called using C<-d> option to perl. If you
+want to specify some other option, set C<TESTDB_SW> variable:
+
+ make testdb TESTDB_SW=-Dx
+
=head2 make install
make alone puts all relevant files into directories that are named by
@@ -938,9 +952,7 @@ The INSTALL... macros in turn default to their %Config
You can check the values of these variables on your system with
- perl -MConfig -le 'print join $/, map
- sprintf("%20s: %s", $_, $Config{$_}),
- grep /^install/, keys %Config'
+ perl '-V:install.*'
And to check the sequence in which the library directories are
searched by perl, run
@@ -948,18 +960,29 @@ searched by perl, run
perl -le 'print join $/, @INC'
-=head2 PREFIX attribute
+=head2 PREFIX and LIB attribute
+
+PREFIX and LIB can be used to set several INSTALL* attributes in one
+go. The quickest way to install a module in a non-standard place might
+be
+
+ perl Makefile.PL LIB=~/lib
-The PREFIX attribute can be used to set the INSTALL* attributes in one
-go. The quickest way to install a module in a non-standard place
+This will install the module's architecture-independent files into
+~/lib, the architecture-dependent files into ~/lib/$archname/auto.
+
+Another way to specify many INSTALL directories with a single
+parameter is PREFIX.
perl Makefile.PL PREFIX=~
This will replace the string specified by $Config{prefix} in all
$Config{install*} values.
-Note, that the tilde expansion is done by MakeMaker, not by perl by
-default, nor by make.
+Note, that in both cases the tilde expansion is done by MakeMaker, not
+by perl by default, nor by make. Conflicts between parmeters LIB,
+PREFIX and the various INSTALL* arguments are resolved so that
+XXX
If the user has superuser privileges, and is not working on AFS
(Andrew File System) or relatives, then the defaults for
@@ -1330,6 +1353,11 @@ specify ld flags)
The filename of the perllibrary that will be used together with this
extension. Defaults to libperl.a.
+=item LIB
+
+LIB can only be set at C<perl Makefile.PL> time. It has the effect of
+setting both INSTALLPRIVLIB and INSTALLSITELIB to that value regardless any
+
=item LIBS
An anonymous array of alternative library
@@ -1529,7 +1557,7 @@ B<after> the eval() will be assigned to the VERSION attribute of the
MakeMaker object. The following lines will be parsed o.k.:
$VERSION = '1.00';
- ( $VERSION ) = '$Revision: 1.207 $ ' =~ /\$Revision:\s+([^\s]+)/;
+ ( $VERSION ) = '$Revision: 1.208 $ ' =~ /\$Revision:\s+([^\s]+)/;
$FOO::VERSION = '1.10';
but these will fail:
diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm
index 0f9a132c36..4c96437e15 100644
--- a/lib/ExtUtils/Mksymlists.pm
+++ b/lib/ExtUtils/Mksymlists.pm
@@ -48,7 +48,7 @@ sub Mksymlists {
if ($osname eq 'aix') { _write_aix(\%spec); }
elsif ($osname eq 'VMS') { _write_vms(\%spec) }
- elsif ($osname =~ m|^os/?2$|i) { _write_os2(\%spec) }
+ elsif ($osname eq 'os2') { _write_os2(\%spec) }
else { croak("Don't know how to create linker option file for $osname\n"); }
}