diff options
author | Molnar Laszlo <molnarl@cdata.tvnet.hu> | 1997-11-21 11:58:26 +0100 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-12-17 14:10:50 +0000 |
commit | 39e571d41067215a80f26089b260f1418caeb36b (patch) | |
tree | e0bca433f79179f69a7b158d5bcd0759cc98e18c /djgpp/fixpmain | |
parent | 1f70e1ea8280242937e42514e140f4e467e09404 (diff) | |
download | perl-39e571d41067215a80f26089b260f1418caeb36b.tar.gz |
Major changes to the DOS/djgpp port (including threading):
Subject: Re: dos-djgpp port not in perl 5.004_54
p4raw-id: //depot/perl@373
Diffstat (limited to 'djgpp/fixpmain')
-rw-r--r-- | djgpp/fixpmain | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/djgpp/fixpmain b/djgpp/fixpmain new file mode 100644 index 0000000000..6db6555ecf --- /dev/null +++ b/djgpp/fixpmain @@ -0,0 +1,30 @@ +#!perl -w +# Fix perlmain.c under DOS (short & case insensitive filenames). +# Called from Makefile.aperl when needed. +# You don't need this when LFN=y. + +use Config; + +open (PERLM,"<perlmain.c") or die "Can't load perlmain.c: $!"; +open (MAKEFILE,"<makefile.pl") or die "Can't load makefile.pl: $!"; +undef $/; +$perlmain=<PERLM>; +$makefile=<MAKEFILE>; + +($_) = $makefile =~ /\bNAME\b.*=>\W*([\w\:]+)/; # extract module name +$badname=join ("__",map {lc substr ($_,0,8)} split /:+/); # dosify +$perlmain =~ s/^.*boot_$badname.*$//gm if $badname; # delete bad lines + +@exts=split (" ",$Config{known_extensions}); +for $realname (@exts,'DynaLoader') +{ + $dosname=substr (lc $realname,0,8); + $perlmain =~ s/boot_$dosname/boot_$realname/gm; + $perlmain =~ s/$dosname(::bootstrap)/$realname$1/gm; +} + +#DynaLoader is special +$perlmain =~ s/(DynaLoader:\:boot)strap/$1_DynaLoader/gm; + +open (PERLM,">perlmain.c") or die "Can't write perlmain.c: $!"; +print PERLM $perlmain; |