cygwin32 update (untested adaptation of patch against 5.005_03)
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / MakeMaker.pm
index 51fb62e..95477fa 100644 (file)
@@ -70,6 +70,7 @@ $Is_VMS   = $^O eq 'VMS';
 $Is_OS2   = $^O eq 'os2';
 $Is_Mac   = $^O eq 'MacOS';
 $Is_Win32 = $^O eq 'MSWin32';
+$Is_Cygwin= $^O =~ /cygwin/i;
 
 require ExtUtils::MM_Unix;
 
@@ -86,6 +87,9 @@ if ($Is_Mac) {
 if ($Is_Win32) {
     require ExtUtils::MM_Win32;
 }
+if ($Is_Cygwin) {
+    require ExtUtils::MM_Cygwin;
+}
 
 # The SelfLoader would bring a lot of overhead for MakeMaker, because
 # we know for sure we will use most of the autoloaded functions once
@@ -439,7 +443,15 @@ sub ExtUtils::MakeMaker::new {
                unless $self->file_name_is_absolute($self->{$key})
                || ($^O eq 'VMS' and ($key =~ /PERL$/ && $self->{$key} =~ /^[\w\-\$]+$/));
        }
-       $self->{PARENT}->{CHILDREN}->{$newclass} = $self if $self->{PARENT};
+       if ($self->{PARENT}) {
+           $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
+           if (exists $self->{PARENT}->{CAPI}
+               and not exists $self->{CAPI})
+           {
+               # inherit, but only if already unspecified
+               $self->{CAPI} = $self->{PARENT}->{CAPI};
+           }
+       }
     } else {
        parse_args($self,split(' ', $ENV{PERL_MM_OPT} || ''),@ARGV);
     }
@@ -1019,7 +1031,7 @@ This will replace the string specified by $Config{prefix} in all
 $Config{install*} values.
 
 Note, that in both cases the tilde expansion is done by MakeMaker, not
-by perl by default, nor by make. Conflicts between parmeters LIB,
+by perl by default, nor by make. Conflicts between parameters LIB,
 PREFIX and the various INSTALL* arguments are resolved so that 
 XXX
 
@@ -1207,6 +1219,10 @@ currently used by MakeMaker but may be handy in Makefile.PLs.
 
 Switch to force usage of the Perl C API even when compiling for PERL_OBJECT.
 
+Note that this attribute is passed through to any recursive build,
+but if and only if the submodule's Makefile.PL itself makes no mention
+of the 'CAPI' attribute.
+
 =item CCFLAGS
 
 String that will be included in the compiler call command line between
@@ -1285,7 +1301,7 @@ is ignored if INCLUDE_EXT is present.  Consult INCLUDE_EXT for more
 details.  (e.g.  [ qw( Socket POSIX ) ] )
 
 This attribute may be most useful when specified as a string on the
-commandline:  perl Makefile.PL EXCLUDE_EXT='Socket Safe'
+command line:  perl Makefile.PL EXCLUDE_EXT='Socket Safe'
 
 =item EXE_FILES
 
@@ -1336,7 +1352,7 @@ filling in INCLUDE_EXT.  If the INCLUDE_EXT is mentioned but is empty then
 only DynaLoader and the current extension will be included in the build.
 
 This attribute may be most useful when specified as a string on the
-commandline:  perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek'
+command line:  perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek'
 
 =item INSTALLARCHLIB
 
@@ -1560,7 +1576,7 @@ avoided, it may be undefined)
 
 =item PERM_RW
 
-Desired Permission for read/writable files. Defaults to C<644>.
+Desired permission for read/writable files. Defaults to C<644>.
 See also L<MM_Unix/perm_rw>.
 
 =item PERM_RWX
@@ -1577,7 +1593,11 @@ and the basename of the file being the value. E.g.
   {'foobar.PL' => 'foobar'}
 
 The *.PL files are expected to produce output to the target files
-themselves.
+themselves. If multiple files can be generated from the same *.PL
+file then the value in the hash can be a reference to an array of
+target file names. E.g.
+
+  {'foobar.PL' => ['foobar1','foobar2']}
 
 =item PM
 
@@ -1760,9 +1780,13 @@ be linked.
 
   {FILES => '$(INST_ARCHAUTODIR)/*.xyz'}
 
+=item test
+
+  {TESTS => 't/*.t'}
+
 =item tool_autosplit
 
-  {MAXLEN =E<gt> 8}
+  {MAXLEN => 8}
 
 =back