This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PL_scopestack_name is only defined in DEBUGGING perl
[perl5.git] / makedef.pl
index 354b82a..cef774e 100644 (file)
@@ -6,10 +6,35 @@
 # and by AIX for creating libperl.a when -Dusershrplib is in effect,
 # and by MacOS Classic.
 #
-# reads global.sym, pp.sym, perlvars.h, intrpvar.h, config.h
-# On OS/2 reads miniperl.map and the previous version of perl5.def as well
+# Reads from information stored in
+#
+#    config.h
+#    config.sh
+#    global.sym
+#    globvar.sym
+#    intrpvar.h
+#    macperl.sym  (on MacOS)
+#    miniperl.map (on OS/2)
+#    perl5.def    (on OS/2; this is the old version of the file being made)
+#    perlio.sym
+#    perlvars.h
+#
+# plus long lists of function names hard-coded directly in this script and
+# in the DATA section.
+#
+# Writes the result to STDOUT.
+#
+# Normally this script is invoked from a makefile (e.g. win32/Makefile),
+# which redirects STDOUT to a suitable file, such as:
+#
+#    perl5.def   OS/2
+#    perldll.def Windows
+#    perl.exp    AIX
+#    perl.imp    NetWare
+
 
 BEGIN { unshift @INC, "lib" }
+use Config;
 use strict;
 
 use vars qw($PLATFORM $CCTYPE $FILETYPE $CONFIG_ARGS $ARCHNAME $PATCHLEVEL);
@@ -51,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";
@@ -603,6 +632,7 @@ unless ($define{'DEBUGGING'}) {
                    Perl_pad_sv
                    Perl_hv_assert
                    PL_block_type
+                   PL_scopestack_name
                    PL_watchaddr
                    PL_watchok
                    PL_watch_pvx