From: Vadim Konovalov Date: Sat, 10 Mar 2001 19:26:07 +0000 (+0300) Subject: Re: Another Borland C++ problem. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3b48d85d1f08ba7ec4fa46512fef5124222d20fb;p=p5sagit%2Fp5-mst-13.2.git Re: Another Borland C++ problem. Message-ID: <001601c0a97f$143fcc40$da7b55c2@vad> Borland filename case problem. p4raw-id: //depot/perl@9171 --- diff --git a/MANIFEST b/MANIFEST index 5c750ea..15a8030 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1851,6 +1851,7 @@ win32/perlhost.h Perl "host" implementation win32/perllib.c Win32 port win32/pod.mak Win32 port win32/runperl.c Win32 port +win32/sncfnmcs.pl Win32 port win32/splittree.pl Win32 port win32/vdir.h Perl "host" virtual directory manager win32/vmem.h Perl "host" memory manager diff --git a/README.win32 b/README.win32 index 113c0f5..7d5ebd0 100644 --- a/README.win32 +++ b/README.win32 @@ -78,6 +78,16 @@ A patch is included in the above fixed version.) Fetch and install dmake somewhere on your path (follow the instructions in the README.NOW file). +There exists a minor coexistence problem with dmake and Borland C++ +compilers. Namely, if a distribution have C files named with a mixed +case letters, they will be compiled into appropriate .obj-files named +with all lowercase letters, and every time when dmake will be invoked +to bring files up to date, it will try to recompile such files again. +For example, Tk distribution have a lot of such files, resulting in +multiple recompiling everytime dmake is invoked. To avoid this, you +may use the script "sncfnmcs.pl" after successful build. It is +available in the win32 subdirectory. + =item Command Shell Use the default "cmd" shell that comes with NT. Some versions of the diff --git a/win32/sncfnmcs.pl b/win32/sncfnmcs.pl new file mode 100644 index 0000000..bb62460 --- /dev/null +++ b/win32/sncfnmcs.pl @@ -0,0 +1,63 @@ +=comment + +Synchronize filename cases. +This script takes two arguments - first and second extensions to synchronize +filename cases with. + +There may be specified following options: + --verbose <== say everything what is going on + --recurse <== recurse subdirectories + --dummy <== do not perform actual renaming + --say-subdir +Every such option can be specified with an optional "no" prefix to negate it. + +Typically, it is invoked as: + perl sync-fnamescase.pl c obj --verbose + +=cut + +use strict; + +my ($ext1, $ext2) = map {quotemeta} grep {!/^--/} @ARGV; +my %opts = ( + #defaults + 'verbose' => 0, + 'recurse' => 1, + 'dummy' => 0, + 'say-subdir' => 0, + #options itself + (map {/^--([\-_\w]+)=(.*)$/} @ARGV), # --opt=smth + (map {/^no-?(.*)$/i?($1=>0):($_=>1)} map {/^--([\-_\w]+)$/} @ARGV), # --opt --no-opt --noopt + ); + +my $sp = ''; +sub xx { + opendir DIR, '.'; + my @t = readdir DIR; + my @f = map {/^(.*)\.$ext1$/i} @t; + my %f = map {lc($_)=>$_} map {/^(.*)\.$ext2$/i} @t; + for (@f) { + my $lc = lc($_); + if (exists $f{$lc} and $f{$lc} ne $_) { + print STDERR "$sp$f{$lc}.$ext2 <==> $_.$ext1\n" if $opts{verbose}; + if ($opts{dummy}) { + print STDERR "ren $f{$lc}.$ext2 $_.$ext2\n"; + } + else { + system "ren $f{$lc}.$ext2 $_.$ext2"; + } + } + } + if ($opts{recurse}) { + for (grep {-d&&!/^\.\.?$/} @t) { + print STDERR "$sp\\$_\n" if $opts{'say-subdir'}; + $sp .= ' '; + chdir $_ or die; + xx(); + chdir ".." or die; + chop $sp; + } + } +} + +xx();