avoid race condition in the CAPI extension bootstrap handler
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / MakeMaker.pm
index 070156b..a8ea73e 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
@@ -245,7 +249,7 @@ sub full_setup {
     LINKTYPE MAKEAPERL MAKEFILE MAN1PODS MAN3PODS MAP_TARGET MYEXTLIB
     NAME NEEDS_LINKING NOECHO NORECURS NO_VC OBJECT OPTIMIZE PERL PERLMAINCC
     PERL_ARCHLIB PERL_LIB PERL_SRC PERM_RW PERM_RWX
-    PL_FILES PM PMLIBDIRS PPM_INSTALL_EXEC PPM_INSTALL_SCRIPT PREFIX
+    PL_FILES PM PMLIBDIRS POLLUTE PPM_INSTALL_EXEC PPM_INSTALL_SCRIPT PREFIX
     PREREQ_PM SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
     XS_VERSION clean depend dist dynamic_lib linkext macro realclean
     tool_autosplit
@@ -441,7 +445,14 @@ sub ExtUtils::MakeMaker::new {
        }
        if ($self->{PARENT}) {
            $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
-           $self->{CAPI} = $self->{PARENT}->{CAPI};
+           foreach my $opt (qw(CAPI POLLUTE)) {
+               if (exists $self->{PARENT}->{$opt}
+                   and not exists $self->{$opt})
+                   {
+                       # inherit, but only if already unspecified
+                       $self->{$opt} = $self->{PARENT}->{$opt};
+                   }
+           }
        }
     } else {
        parse_args($self,split(' ', $ENV{PERL_MM_OPT} || ''),@ARGV);
@@ -1210,6 +1221,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
@@ -1604,6 +1619,18 @@ they contain will be installed in the corresponding location in the
 library.  A libscan() method can be used to alter the behaviour.
 Defining PM in the Makefile.PL will override PMLIBDIRS.
 
+=item POLLUTE
+
+Release 5.005 grandfathered old global symbol names by providing preprocessor
+macros for extension source compatibility.  As of release 5.006, these
+preprocessor definitions are not available by default.  The POLLUTE flag
+specifies that the old names should still be defined:
+
+  perl Makefile.PL POLLUTE=1
+
+Please inform the module author if this is necessary to successfully install
+a module under 5.006 or later.
+
 =item PPM_INSTALL_EXEC
 
 Name of the executable used to run C<PPM_INSTALL_SCRIPT> below. (e.g. perl)
@@ -1767,9 +1794,13 @@ be linked.
 
   {FILES => '$(INST_ARCHAUTODIR)/*.xyz'}
 
+=item test
+
+  {TESTS => 't/*.t'}
+
 =item tool_autosplit
 
-  {MAXLEN =E<gt> 8}
+  {MAXLEN => 8}
 
 =back