X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/321600e11320143624e3eb397de01526d976a1af..9100eeb186d403d6c6c6ef15844209cad5a9b9f0:/makedef.pl diff --git a/makedef.pl b/makedef.pl index 35b3046..a52241f 100644 --- a/makedef.pl +++ b/makedef.pl @@ -10,13 +10,14 @@ # # %Config::Config (ie config.sh) # config.h -# global.sym +# embed.fnc # globvar.sym # intrpvar.h # miniperl.map (on OS/2) # perl5.def (on OS/2; this is the old version of the file being made) # perlio.sym # perlvars.h +# regen/opcodes # # plus long lists of function names hard-coded directly in this script. # @@ -39,6 +40,8 @@ my %ARGS = (CCTYPE => 'MSVC', TARG_DIR => ''); my %define; +my $fold; + sub process_cc_flags { foreach (map {split /\s+/, $_} @_) { $define{$1} = $2 // 1 if /^-D(\w+)(?:=(.+))?/; @@ -51,9 +54,13 @@ while (@ARGV) { process_cc_flags($1); } elsif ($flag =~ /^(CCTYPE|FILETYPE|PLATFORM|TARG_DIR)=(.+)$/) { $ARGS{$1} = $2; + } elsif ($flag eq '--sort-fold') { + ++$fold; } } +require "$ARGS{TARG_DIR}regen/embed_lib.pl"; + { my @PLATFORM = qw(aix win32 wince os2 netware vms test); my %PLATFORM; @@ -193,6 +200,9 @@ if ($ARGS{PLATFORM} ne 'os2') { ); if ($ARGS{PLATFORM} eq 'vms') { ++$skip{PL_statusvalue_posix}; + # This is a wrapper if we have symlink, not a replacement + # if we don't. + ++$skip{Perl_my_symlink} unless $Config{d_symlink}; } else { ++$skip{PL_statusvalue_vms}; if ($ARGS{PLATFORM} ne 'aix') { @@ -337,6 +347,7 @@ unless ($define{'USE_ITHREADS'}) { unless ($define{'USE_ITHREADS'}) { ++$skip{$_} foreach qw( + PL_check_mutex PL_op_mutex PL_regex_pad PL_regex_padav @@ -411,10 +422,6 @@ unless ($define{'PERL_DEBUG_READONLY_OPS'}) { ); } -unless ($define{'THREADS_HAVE_PIDS'}) { - ++$skip{PL_ppid}; -} - unless ($define{'PERL_NEED_APPCTX'}) { ++$skip{PL_appctx}; } @@ -532,7 +539,7 @@ if ($define{'PERL_GLOBAL_STRUCT'}) { # functions from *.sym files -my @syms = qw(global.sym globvar.sym); +my @syms = qw(globvar.sym); # Symbols that are the public face of the PerlIO layers implementation # These are in _addition to_ the public face of the abstraction @@ -545,6 +552,7 @@ my @layer_syms = qw( PerlIOBase_eof PerlIOBase_error PerlIOBase_fileno + PerlIOBase_open PerlIOBase_noop_fail PerlIOBase_noop_ok PerlIOBase_popped @@ -729,6 +737,27 @@ if ($define{'USE_PERLIO'}) { # At this point all skip lists should be completed, as we are about to test # many symbols against them. +{ + my %seen; + my ($embed) = setup_embed($ARGS{TARG_DIR}); + + foreach (@$embed) { + my ($flags, $retval, $func, @args) = @$_; + next unless $func; + if ($flags =~ /[AX]/ && $flags !~ /[xm]/ || $flags =~ /b/) { + # public API, so export + + # If a function is defined twice, for example before and after + # an #else, only export its name once. Important to do this test + # within the block, as the *first* definition may have flags which + # mean "don't export" + next if $seen{$func}++; + $func = "Perl_$func" if $flags =~ /[pbX]/; + ++$export{$func} unless exists $skip{$func}; + } + } +} + foreach (@syms) { my $syms = $ARGS{TARG_DIR} . $_; open my $global, '<', $syms or die "failed to open $syms: $!\n"; @@ -941,9 +970,6 @@ if ($ARGS{PLATFORM} =~ /^win(?:32|ce)$/) { win32_getchar win32_putchar )); - if ($ARGS{CCTYPE} eq "BORLAND") { - try_symbols('_matherr'); - } } elsif ($ARGS{PLATFORM} eq 'vms') { try_symbols(qw( @@ -1281,7 +1307,7 @@ if ($ARGS{PLATFORM} =~ /^win(?:32|ce)$/) { print "LIBRARY $dll\n"; # The DESCRIPTION module definition file statement is not supported # by VC7 onwards. - if ($ARGS{CCTYPE} =~ /^(?:MSVC60|GCC|BORLAND)$/) { + if ($ARGS{CCTYPE} =~ /^(?:MSVC60|GCC)$/) { print "DESCRIPTION 'Perl interpreter'\n"; } print "EXPORTS\n"; @@ -1323,9 +1349,9 @@ elsif ($ARGS{PLATFORM} eq 'netware') { # Then the symbols -foreach my $symbol (sort keys %export) { +my @symbols = $fold ? sort {lc $a cmp lc $b} keys %export : sort keys %export; +foreach my $symbol (@symbols) { if ($ARGS{PLATFORM} =~ /^win(?:32|ce)$/) { - $symbol = "_$symbol" if $ARGS{CCTYPE} eq 'BORLAND'; print "\t$symbol\n"; } elsif ($ARGS{PLATFORM} eq 'os2') {