source: trunk/third/perl/djgpp/fixpmain @ 14545

Revision 14545, 1.0 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14544, which included commits to RCS files with non-trunk default branches.
Line 
1#!perl -w
2# Fix perlmain.c under DOS (short & case insensitive filenames).
3# Called from Makefile.aperl when needed.
4# You don't need this when LFN=y.
5
6use Config;
7
8open (PERLM,"<perlmain.c") or die "Can't load perlmain.c: $!";
9open (MAKEFILE,"<makefile.pl") or die "Can't load makefile.pl: $!";
10undef $/;
11$perlmain=<PERLM>;
12$makefile=<MAKEFILE>;
13
14($_) = $makefile =~ /\bNAME\b.*=>\W*([\w\:]+)/; # extract module name
15$badname=join ("__",map {lc substr ($_,0,8)} split /:+/); # dosify
16$perlmain =~ s/^.*boot_$badname.*$//gm if $badname; # delete bad lines
17
18@exts=('DynaLoader',split (" ",$Config{known_extensions}));
19for $realname (@exts)
20{
21    $dosname=join ("__",map {lc substr ($_,0,8)} split /\//,$realname);
22    $realname =~ s!/!__!g;
23    $perlmain =~ s/\bboot_$dosname/boot_$realname/gm;
24    $perlmain =~ s/\b$dosname(::bootstrap)/$realname$1/gm;
25}
26
27#DynaLoader is special
28$perlmain =~ s/(DynaLoader:\:boot)strap/$1_DynaLoader/gm;
29
30open (PERLM,">perlmain.c") or die "Can't write perlmain.c: $!";
31print PERLM $perlmain;
Note: See TracBrowser for help on using the repository browser.