Obtained from:
Submitted by:
Reviewed by:

  Prevent the .dsp project files from being touched if they were
  already cleanly converted.  Note that just loading the 6.0 .dsp
  in the 5.0 MSVC environment doesn't toggle the /ZI->/Zi option.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85315 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
William A. Rowe Jr
2000-05-27 17:47:02 +00:00
parent 2f0e895df0
commit 0d59289527
2 changed files with 39 additions and 14 deletions

View File

@ -8,20 +8,35 @@ sub tovc5 {
if (m|.dsp$|) {
$tname = '.#' . $_;
print "Convert VC6 project " . $_ . " to VC5 in " . $File::Find::dir . "\n";
$verchg = 0;
$srcfl = new IO::File $_, "r" || die;
$dstfl = new IO::File $tname, "w" || die;
while ($src = <$srcfl>) {
$src =~ s|Format Version 6\.00|Format Version 5\.00|;
# This is BUCK UGLY... and I know there is a way to do it right... would someone fix?
$src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|;
$src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|;
if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) {
$verchg = -1;
}
if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) {
$verchg = -1;
}
if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) {
$verchg = -1;
}
if ($src !~ m|^# PROP AllowPerConfigDependencies|) {
print $dstfl $src; }
else {
$verchg = -1;
}
}
undef $srcfl;
undef $dstfl;
unlink $_;
rename $tname, $_;
if ($verchg) {
unlink $_;
rename $tname, $_;
print "Converted VC6 project " . $_ . " to VC5 in " . $File::Find::dir . "\n";
}
else {
unlink $tname;
}
}
}

View File

@ -9,19 +9,23 @@ sub tovc6 {
if (m|.dsp$|) {
$tname = '.#' . $_;
$verchg = 0;
print "Convert VC6 project " . $_ . " to VC5 in " . $File::Find::dir . "\n";
$srcfl = new IO::File $_, "r" || die;
$dstfl = new IO::File $tname, "w" || die;
while ($src = <$srcfl>) {
if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) {
$verchg = -1;
}
$src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|;
$src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|;
if ($src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|) {
$verchg = -1;
}
if ($src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|) {
$verchg = -1;
}
if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) {
$cont = <$srcfl>;
$cont = <$srcfl>;
$src = $src . $cont;
}
$verchg = -1;
}
print $dstfl $src;
if ($verchg && $src =~ m|^# Begin Project|) {
print $dstfl "# PROP AllowPerConfigDependencies 0\n";
@ -29,7 +33,13 @@ sub tovc6 {
}
undef $srcfl;
undef $dstfl;
unlink $_;
rename $tname, $_;
if ($verchg) {
unlink $_;
rename $tname, $_;
print "Converted VC6 project " . $_ . " to VC5 in " . $File::Find::dir . "\n";
}
else {
unlink $tname;
}
}
}