This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Export PL_curinterp symbol for MULTIPLICITY without USE_ITHREADS
[perl5.git] / makedef.pl
index 1b3c2b5..b4d76ea 100644 (file)
@@ -34,6 +34,7 @@
 
 
 BEGIN { unshift @INC, "lib" }
+use Config;
 use strict;
 
 use vars qw($PLATFORM $CCTYPE $FILETYPE $CONFIG_ARGS $ARCHNAME $PATCHLEVEL);
@@ -75,7 +76,11 @@ if ($PLATFORM eq 'win32' or $PLATFORM eq 'wince' or $PLATFORM eq "aix") {
        # the user might have chosen to disable because the canned configs are
        # minimal configs that don't include any of those options.
        my $opts = ($PLATFORM eq 'wince' ? '-MCross' : ''); # for wince need Cross.pm to get Config.pm
-       my $config = `$^X $opts -Ilib -V`;
+
+       $ENV{PERL5LIB} = join $Config{path_sep}, @INC;
+       my $cmd = "$^X $opts -V";
+       my $config = `$cmd`
+           or die "Couldn't run [$cmd]: $!";
        my($options) = $config =~ /^  Compile-time options: (.*?)\n^  \S/ms;
        $options =~ s/\s+/ /g;
        print STDERR "Options: ($options)\n";
@@ -753,6 +758,7 @@ unless ($define{'USE_ITHREADS'}) {
                    PL_sharedsv_space_mutex
                    PL_dollarzero_mutex
                    PL_hints_mutex
+                   PL_my_ctx_mutex
                    PL_perlio_mutex
                    PL_regdupe
                    Perl_parser_dup
@@ -788,7 +794,6 @@ unless ($define{'USE_ITHREADS'}) {
 
 unless ($define{'PERL_IMPLICIT_CONTEXT'}) {
     skip_symbols [qw(
-                   PL_my_ctx_mutex
                    PL_my_cxt_index
                    PL_my_cxt_list
                    PL_my_cxt_size
@@ -1218,6 +1223,10 @@ if ($define{'MULTIPLICITY'}) {
        my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" });
        emit_symbols $glob;
     }
+    unless ($define{'USE_ITHREADS'}) {
+       # XXX needed for XS extensions that define PERL_CORE
+       emit_symbol("PL_curinterp");
+    }
     # XXX AIX seems to want the perlvars.h symbols, for some reason
     if ($PLATFORM eq 'aix' or $PLATFORM eq 'os2') {    # OS/2 needs PL_thr_key
        my $glob = readvar($perlvars_h);
@@ -1279,6 +1288,7 @@ if ($PLATFORM =~ /^win(?:32|ce)$/) {
                            win32_open
                            win32_close
                            win32_eof
+                           win32_isatty
                            win32_read
                            win32_write
                            win32_spawnvp