summaryrefslogtreecommitdiff
path: root/makedef.pl
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2002-02-21 01:02:48 -0500
committerAbhijit Menon-Sen <ams@wiw.org>2002-02-21 12:45:28 +0000
commit52e4c28238dd5834ab1196c65b774cc4e074cf56 (patch)
tree071879333716c476e9776eb6c6d6841fa3ffab41 /makedef.pl
parent65197d9353c381a2c9b77780fe37feba9ff535ab (diff)
downloadperl-52e4c28238dd5834ab1196c65b774cc4e074cf56.tar.gz
cosmetic OS/2 patches
Message-Id: <20020221060248.A29705@math.ohio-state.edu> p4raw-link: @14577 on //depot/perl: 0ad5258ff3f3328f321188cbb4fcd6a74b365431 p4raw-id: //depot/perl@14810
Diffstat (limited to 'makedef.pl')
-rw-r--r--makedef.pl26
1 files changed, 21 insertions, 5 deletions
diff --git a/makedef.pl b/makedef.pl
index c6a535556e..b75eff987e 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -97,8 +97,9 @@ unless ($PLATFORM eq 'win32' || $PLATFORM eq 'MacOS' || $PLATFORM eq 'netware')
$define{$1} = 1 while /-D(\w+)/g;
}
if ($PLATFORM eq 'os2') {
- $CONFIG_ARGS = $1 if /^(?:config_args)='(.+)'$/;
- $ARCHNAME = $1 if /^(?:archname)='(.+)'$/;
+ $CONFIG_ARGS = $1 if /^config_args='(.+)'$/;
+ $ARCHNAME = $1 if /^archname='(.+)'$/;
+ $PATCHLEVEL = $1 if /^perl_patchlevel='(.+)'$/;
}
}
close(CFG);
@@ -121,6 +122,8 @@ if ($define{USE_ITHREADS}) {
}
}
+my $sym_ord = 0;
+
$define{PERL_IMPLICIT_CONTEXT} ||=
$define{USE_ITHREADS} ||
$define{USE_5005THREADS} ||
@@ -140,9 +143,21 @@ if ($PLATFORM eq 'win32') {
}
}
elsif ($PLATFORM eq 'os2') {
+ if (open my $fh, '<', 'perl5.def') {
+ while (<$fh>) {
+ last if /^\s*EXPORTS\b/;
+ }
+ while (<$fh>) {
+ $ordinal{$1} = $2 if /^\s*"(\w+)"\s*\@(\d+)\s*$/;
+ # This allows skipping ordinals which were used in older versions
+ $sym_ord = $1 if /^\s*;\s*LAST_ORDINAL\s*=\s*(\d+)\s*$/;
+ }
+ $sym_ord < $_ and $sym_ord = $_ for values %ordinal; # Take the max
+ }
($v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/;
$v .= '-thread' if $ARCHNAME =~ /-thread/;
($dll = $define{PERL_DLL}) =~ s/\.dll$//i;
+ $v .= "\@$PATCHLEVEL" if $PATCHLEVEL;
$d = "DESCRIPTION '\@#perl5-porters\@perl.org:$v#\@ Perl interpreter, configured as $CONFIG_ARGS'";
$d = substr($d, 0, 249) . "...'" if length $d > 253;
print <<"---EOP---";
@@ -1105,6 +1120,8 @@ if ($PLATFORM eq 'netware') {
# that the last symbol will not contain a comma else
# Watcom linker cribs
print "\tdummy\n";
+} elsif ($PLATFORM eq 'os2') {
+ print "; LAST_ORDINAL=$sym_ord\n";
}
sub emit_symbol {
@@ -1113,8 +1130,6 @@ sub emit_symbol {
$export{$symbol} = 1;
}
-my $sym_ord = 0;
-
sub output_symbol {
my $symbol = shift;
$symbol = $bincompat5005{$symbol}
@@ -1145,7 +1160,8 @@ sub output_symbol {
# }
}
elsif ($PLATFORM eq 'os2') {
- printf qq( %-31s \@%s\n), qq("$symbol"), ++$sym_ord;
+ printf qq( %-31s \@%s\n),
+ qq("$symbol"), $ordinal{$symbol} || ++$sym_ord;
}
elsif ($PLATFORM eq 'aix' || $PLATFORM eq 'MacOS') {
print "$symbol\n";