summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2007-08-17 21:02:16 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2007-08-17 21:02:16 +0000
commit3a328db58fe4ada21c1b7d9ca812a675c2bf39eb (patch)
tree5ba34da219f1eeed706f137506f12d0ffba9b998
parentd30dcb0709ae0f8edfb63f0f15a8f952c51d665c (diff)
downloadlibapr-3a328db58fe4ada21c1b7d9ca812a675c2bf39eb.tar.gz
Sync these utilities to 567139
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.2.x@567142 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--build/cvtdsp.pl646
-rw-r--r--build/fixwin32mak.pl71
-rw-r--r--build/lineends.pl89
3 files changed, 406 insertions, 400 deletions
diff --git a/build/cvtdsp.pl b/build/cvtdsp.pl
index 3a21eb7cd..becb75bd5 100644
--- a/build/cvtdsp.pl
+++ b/build/cvtdsp.pl
@@ -29,10 +29,10 @@ elsif ($ARGV[0] eq '-mt') {
find(\&addmt, '.');
}
elsif ($ARGV[0] eq '-m') {
- ## 0 - conapp, 1 - dll lib, 2 - static lib
- $dsptype = 2;
- $name = "apr";
- onemake();
+ ## 0 - conapp, 1 - dll lib, 2 - static lib
+ $dsptype = 2;
+ $name = "apr";
+ onemake();
}
else {
print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n";
@@ -48,33 +48,33 @@ sub addmt {
if (m|\.dsp$|) {
$oname = $_;
- $tname = '.#' . $_;
+ $tname = '.#' . $_;
$verchg = 0;
$srcfl = new IO::File $oname, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- if ($src =~ m|^# TARGTYPE .+ Application|) {
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ if ($src =~ m|^# TARGTYPE .+ Application|) {
$outtype = ".exe"
- }
- if ($src =~ m|^# TARGTYPE .+ Dynamic-Link|) {
+ }
+ if ($src =~ m|^# TARGTYPE .+ Dynamic-Link|) {
$outtype = ".dll"
- }
- if ($src =~ m|^# PROP Output_Dir "(.+)"|) {
+ }
+ if ($src =~ m|^# PROP Output_Dir "(.+)"|) {
$outdir = $1;
$outpath = $oname;
$outpath =~ s|\.dsp||;
$outpath = ".\\" . $outdir . "\\" . $outpath . $outtype;
- }
- if ($src =~ m|^# ADD (BASE )?LINK32 .+ /out:"([^"]+)"|) {
- $outpath = $2;
+ }
+ if ($src =~ m|^# ADD (BASE )?LINK32 .+ /out:"([^"]+)"|) {
+ $outpath = $2;
$outpath =~ s|/|\\|;
$outpath = ".\\" . $outpath if (!($outpath =~ m|^\.|));
$src =~ s|/out:"([^"]+)"|/out:"$outpath"|;
- }
- if (defined($outpath) && ($src =~ m|^# Begin Special Build Tool|)) {
+ }
+ if (defined($outpath) && ($src =~ m|^# Begin Special Build Tool|)) {
undef $outpath;
}
- if (defined($outpath) && defined($outtype) && ($src =~ m|^\s*$|)) {
+ if (defined($outpath) && defined($outtype) && ($src =~ m|^\s*$|)) {
print $dstfl '# Begin Special Build Tool' . "\n";
print $dstfl 'TargetPath=' . $outpath . "\n";
print $dstfl 'SOURCE="$(InputPath)"' . "\n";
@@ -85,64 +85,64 @@ sub addmt {
undef $outpath;
}
print $dstfl $src;
- }
+ }
undef $outtype if (defined($outtype));
undef $outpath if (defined($outpath));
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Added manifest to " . $oname . " in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Added manifest to " . $oname . " in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
sub tovc5 {
if (m|\.dsp$|) {
$oname = $_;
- $tname = '.#' . $_;
+ $tname = '.#' . $_;
$verchg = 0;
- $srcfl = new IO::File $oname, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- 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 =~ s|^(# ADD CPP .*)/EHsc (.*)|$1/GX $2|) {
- $verchg = -1;
- }
- if ($src =~ s|^(# ADD BASE CPP .*)/EHsc (.*)|$1/GX $2|) {
- $verchg = -1;
- }
- while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) {
- $verchg = -1;
- }
- if ($src !~ m|^# PROP AllowPerConfigDependencies|) {
- print $dstfl $src; }
- else {
- $verchg = -1;
- }
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ $srcfl = new IO::File $oname, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ 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 =~ s|^(# ADD CPP .*)/EHsc (.*)|$1/GX $2|) {
+ $verchg = -1;
+ }
+ if ($src =~ s|^(# ADD BASE CPP .*)/EHsc (.*)|$1/GX $2|) {
+ $verchg = -1;
+ }
+ while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) {
+ $verchg = -1;
+ }
+ if ($src !~ m|^# PROP AllowPerConfigDependencies|) {
+ print $dstfl $src; }
+ else {
+ $verchg = -1;
+ }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
@@ -150,43 +150,43 @@ sub tovc6 {
if (m|\.dsp$|) {
$oname = $_;
- $tname = '.#' . $_;
- $verchg = 0;
- $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;
- }
- if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) {
- $cont = <$srcfl>;
- $src = $src . $cont;
- $verchg = -1;
- }
- if ($src =~ s|^(# ADD CPP .*)/GX (.*)|$1/EHsc $2|) {
- $verchg = -1;
- }
- if ($src =~ s|^(# ADD BASE CPP .*)/GX (.*)|$1/EHsc $2|) {
- $verchg = -1;
- }
- while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) {
- $verchg = -1;
- }
+ $tname = '.#' . $_;
+ $verchg = 0;
+ $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;
+ }
+ if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) {
+ $cont = <$srcfl>;
+ $src = $src . $cont;
+ $verchg = -1;
+ }
+ if ($src =~ s|^(# ADD CPP .*)/GX (.*)|$1/EHsc $2|) {
+ $verchg = -1;
+ }
+ if ($src =~ s|^(# ADD BASE CPP .*)/GX (.*)|$1/EHsc $2|) {
+ $verchg = -1;
+ }
+ while ($src =~ s|^(# ADD RSC .*)/d "([^ ="]+)=([^"]+)"|$1/d $2="$3"|) {
+ $verchg = -1;
+ }
print $dstfl $src;
- if ($verchg && $src =~ m|^# Begin Project|) {
- print $dstfl "# PROP AllowPerConfigDependencies 0\n";
- }
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ if ($verchg && $src =~ m|^# Begin Project|) {
+ print $dstfl "# PROP AllowPerConfigDependencies 0\n";
+ }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
@@ -194,32 +194,32 @@ sub tovc2005 {
if (m|\.dsp$| || m|\.mak$|) {
$oname = $_;
- $tname = '.#' . $_;
- $verchg = 0;
- $srcfl = new IO::File $_, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- if ($src =~ s|(\bCPP.*) /GX(.*)|$1 /EHsc$2|) {
- $verchg = -1;
- }
- if ($src =~ s|(\bLINK32.*) /machine:I386(.*)|$1$2|) {
- $verchg = -1;
- }
- while ($src =~ s|^(# ADD RSC .*)/d ([^ ="]+)="([^"]+)"|$1/d "$2=$3"|) {
- $verchg = -1;
- }
+ $tname = '.#' . $_;
+ $verchg = 0;
+ $srcfl = new IO::File $_, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ if ($src =~ s|(\bCPP.*) /GX(.*)|$1 /EHsc$2|) {
+ $verchg = -1;
+ }
+ if ($src =~ s|(\bLINK32.*) /machine:I386(.*)|$1$2|) {
+ $verchg = -1;
+ }
+ while ($src =~ s|^(# ADD RSC .*)/d ([^ ="]+)="([^"]+)"|$1/d "$2=$3"|) {
+ $verchg = -1;
+ }
print $dstfl $src;
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Converted project " . $oname . " to 2005 in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Converted project " . $oname . " to 2005 in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
@@ -227,29 +227,29 @@ sub tow3 {
if (m|\.dsp$| || m|\.mak$|) {
$oname = $_;
- $tname = '.#' . $_;
- $verchg = 0;
- $srcfl = new IO::File $_, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- while ($src =~ m|\\\n$|) {
- $src = $src . <$srcfl>
- }
- if ($src =~ s|(\bCPP.*) /W4(.*)|$1 /W3$2|) {
- $verchg = -1;
- }
+ $tname = '.#' . $_;
+ $verchg = 0;
+ $srcfl = new IO::File $_, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ while ($src =~ m|\\\n$|) {
+ $src = $src . <$srcfl>
+ }
+ if ($src =~ s|(\bCPP.*) /W4(.*)|$1 /W3$2|) {
+ $verchg = -1;
+ }
print $dstfl $src;
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Converted project " . $oname . " to warn:3 in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Converted project " . $oname . " to warn:3 in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
@@ -257,29 +257,29 @@ sub tow4 {
if (m|\.dsp$| || m|\.mak$|) {
$oname = $_;
- $tname = '.#' . $_;
- $verchg = 0;
- $srcfl = new IO::File $_, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- while ($src =~ m|\\\n$|) {
- $src = $src . <$srcfl>
- }
- if ($src =~ s|(\bCPP.*) /W3(.*)|$1 /W4$2|) {
- $verchg = -1;
- }
+ $tname = '.#' . $_;
+ $verchg = 0;
+ $srcfl = new IO::File $_, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ while ($src =~ m|\\\n$|) {
+ $src = $src . <$srcfl>
+ }
+ if ($src =~ s|(\bCPP.*) /W3(.*)|$1 /W4$2|) {
+ $verchg = -1;
+ }
print $dstfl $src;
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Converted project " . $oname . " to warn:4 " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Converted project " . $oname . " to warn:4 " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
@@ -287,52 +287,52 @@ sub tovc64 {
if (m|\.dsp$| || m|\.mak$|) {
$oname = $_;
- $tname = '.#' . $_;
- $verchg = 0;
- $srcfl = new IO::File $_, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- while ($src =~ m|\\\n$|) {
- $src = $src . <$srcfl>
- }
- if ($src =~ s|Win32 \(x86\) (Release)|Win32 (IA64) $1|s) {
- $verchg = -1;
- }
- if ($src =~ s|Win32 \(x86\) (Debug)|Win32 (IA64) $1|s) {
- $verchg = -1;
- }
- if ($src =~ s| - Win32 (Release)| - Win32 (IA64) $1|s) {
- $verchg = -1;
- }
- if ($src =~ s| - Win32 (Debug)| - Win32 (IA64) $1|s) {
- $verchg = -1;
- }
- # Cross compilation exceptions
- if (!(m|gen[^/]*$| || m|dftables[^/]*$|)) {
- if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As64 /Wp64$2$3|s) {
- $verchg = -1;
- }
- if ($src =~ s|(\bLINK.*/machine):I386(.*)|$1:IA64$2|s) {
- $verchg = -1;
- }
- }
- else {
- if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As32 /Wp64$2$3|s) {
- $verchg = -1;
- }
- }
+ $tname = '.#' . $_;
+ $verchg = 0;
+ $srcfl = new IO::File $_, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ while ($src =~ m|\\\n$|) {
+ $src = $src . <$srcfl>
+ }
+ if ($src =~ s|Win32 \(x86\) (Release)|Win32 (IA64) $1|s) {
+ $verchg = -1;
+ }
+ if ($src =~ s|Win32 \(x86\) (Debug)|Win32 (IA64) $1|s) {
+ $verchg = -1;
+ }
+ if ($src =~ s| - Win32 (Release)| - Win32 (IA64) $1|s) {
+ $verchg = -1;
+ }
+ if ($src =~ s| - Win32 (Debug)| - Win32 (IA64) $1|s) {
+ $verchg = -1;
+ }
+ # Cross compilation exceptions
+ if (!(m|gen[^/]*$| || m|dftables[^/]*$|)) {
+ if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As64 /Wp64$2$3|s) {
+ $verchg = -1;
+ }
+ if ($src =~ s|(\bLINK.*/machine):I386(.*)|$1:IA64$2|s) {
+ $verchg = -1;
+ }
+ }
+ else {
+ if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As32 /Wp64$2$3|s) {
+ $verchg = -1;
+ }
+ }
print $dstfl $src;
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Converted build file " . $oname . " to Win64 in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Converted build file " . $oname . " to Win64 in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
@@ -340,29 +340,29 @@ sub todebugpools {
if (m|\.dsp$|) {
$oname = $_;
- $tname = '.#' . $_;
+ $tname = '.#' . $_;
$verchg = 0;
- $srcfl = new IO::File $oname, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- if ($src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "APR_POOL_DEBUG" |) {
- $verchg = -1;
+ $srcfl = new IO::File $oname, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ if ($src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "APR_POOL_DEBUG" |) {
+ $verchg = -1;
if ($oname =~ /apr\.dsp$/) {
- $src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "POOL_DEBUG" |;
+ $src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "POOL_DEBUG" |;
}
- }
+ }
print $dstfl $src;
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Converted project " . $oname . " to debug pools in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Converted project " . $oname . " to debug pools in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
@@ -370,26 +370,26 @@ sub tobrowsesources {
if (m|\.dsp$|) {
$oname = $_;
- $tname = '.#' . $_;
+ $tname = '.#' . $_;
$verchg = 0;
- $srcfl = new IO::File $oname, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) {
- $verchg = -1;
- }
+ $srcfl = new IO::File $oname, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) {
+ $verchg = -1;
+ }
print $dstfl $src;
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
@@ -397,27 +397,27 @@ sub frommakefiles {
if (m|\.mak\.in$|) {
$oname = $_;
- $dname = $_;
- $_ =~ s/\.mak\.in/.dsp/;
+ $dname = $_;
+ $_ =~ s/\.mak\.in/.dsp/;
$verchg = 0;
- $srcfl = new IO::File $oname, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) {
- $verchg = -1;
- }
+ $srcfl = new IO::File $oname, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) {
+ $verchg = -1;
+ }
print $dstfl $src;
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
}
}
@@ -425,47 +425,47 @@ sub frommakefiles {
sub onemake {
if ($dsptype == 0) {
- $cdefs = qq{/D "WIN32" /D "_CONSOLE"};
- $lmodel = qq{/subsystem:console};
- $targname = "Win32 (x86) Console Application";
- $targid = "0x0103";
- $debpath = "Debug"; $relpath = "Release";
+ $cdefs = qq{/D "WIN32" /D "_CONSOLE"};
+ $lmodel = qq{/subsystem:console};
+ $targname = "Win32 (x86) Console Application";
+ $targid = "0x0103";
+ $debpath = "Debug"; $relpath = "Release";
} elsif ($dsptype == 1) {
- $cdefs = qq{/D "WIN32" /D "_WINDOWS"};
- $lmodel = qq{/subsystem:windows /dll};
- $targname = "Win32 (x86) Dynamic-Link Library";
- $targid = "0x0102";
- $debpath = "Debug"; $relpath = "Release";
+ $cdefs = qq{/D "WIN32" /D "_WINDOWS"};
+ $lmodel = qq{/subsystem:windows /dll};
+ $targname = "Win32 (x86) Dynamic-Link Library";
+ $targid = "0x0102";
+ $debpath = "Debug"; $relpath = "Release";
} elsif($dsptype == 2) {
- $cdefs = qq{/D "WIN32" /D "_CONSOLE"};
- $lmodel = qq{/subsystem:console};
- $targname = "Win32 (x86) Static Library";
- $targid = "0x0104";
- $debpath = "LibD"; $relpath = "LibR";
+ $cdefs = qq{/D "WIN32" /D "_CONSOLE"};
+ $lmodel = qq{/subsystem:console};
+ $targname = "Win32 (x86) Static Library";
+ $targid = "0x0104";
+ $debpath = "LibD"; $relpath = "LibR";
}
- $file = dspheader();
+ $file = dspheader();
- $second = "";
+ $second = "";
- $model = "Release";
- $usedebuglib = "0";
- $debugdef = "NDEBUG";
- $cflags = "/MD /W3 /O2";
- $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"};
- $lflags = qq{/map};
- $file .= dsponemodel();
+ $model = "Release";
+ $usedebuglib = "0";
+ $debugdef = "NDEBUG";
+ $cflags = "/MD /W3 /O2";
+ $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"};
+ $lflags = qq{/map};
+ $file .= dsponemodel();
- $second = "ELSE";
- $model = "Debug";
- $usedebuglib = "1";
- $debugdef = "_DEBUG";
- $cflags = "/MDd /W3 /GX /Zi /Od";
- $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"};
- $lflags = qq{/incremental:no /debug};
- $file .= dsponemodel();
+ $second = "ELSE";
+ $model = "Debug";
+ $usedebuglib = "1";
+ $debugdef = "_DEBUG";
+ $cflags = "/MDd /W3 /GX /Zi /Od";
+ $cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"};
+ $lflags = qq{/incremental:no /debug};
+ $file .= dsponemodel();
- $file .= qq{
+ $file .= qq{
!ENDIF
# Begin Target
@@ -477,24 +477,24 @@ sub onemake {
$toroot = ".";
#HERE IS OUR FOREACH!
- $file .= qq{# Begin Source File
+ $file .= qq{# Begin Source File
SOURCE=./server/main.c
# End Source File
};
if ($dsptype == 0) {
- #HERE IS OUR ICON!
- $icon="$toroot/build/win32/apache.ico";
- $file .= qq{# Begin Source File
+ #HERE IS OUR ICON!
+ $icon="$toroot/build/win32/apache.ico";
+ $file .= qq{# Begin Source File
SOURCE=$icon
# End Source File
};
- $icon = "icon=" . $icon . " ";
+ $icon = "icon=" . $icon . " ";
}
if ($dsptype == 0 || $dsptype == 1) {
- $file .= qq{
+ $file .= qq{
# Begin Source File
SOURCE=./$name.rc
@@ -507,24 +507,24 @@ SOURCE=$toroot/include/ap_release.h
InputPath=$toroot/include/ap_release.h $toroot/build/win32/win32ver.awk
"./$name.rc" : \$(SOURCE) "\$(INTDIR)" "\$(OUTDIR)"
- awk -f $toroot/build/win32/win32ver.awk $name "Apache HTTP Server" $toroot/include/ap_release.h $icon> ./Apache.rc
+ awk -f $toroot/build/win32/win32ver.awk $name "Apache HTTP Server" $toroot/include/ap_release.h $icon> ./Apache.rc
# End Custom Build
# End Source File
};
}
- $file .= qq{
+ $file .= qq{
# End Target
# End Project
};
- print $file;
+ print $file;
}
sub dspheader {
if ($dsptype == 1) {
- $midl = "MTL=midl.exe\n";
+ $midl = "MTL=midl.exe\n";
} else {
- $midl = ""
+ $midl = ""
}
qq{# Microsoft Developer Studio Project File - Name="$name" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
@@ -559,26 +559,26 @@ ${midl}RSC=rc.exe
}
sub dsponemodel {
if ($model eq "Release") {
- $targpath = $relpath;
+ $targpath = $relpath;
} else {
- $targpath = $debpath;
+ $targpath = $debpath;
}
if ($dsptype == 1) {
- $midl =
+ $midl =
qq{# ADD BASE MTL /nologo /D "$debugdef" /win32
# ADD MTL /nologo /D "$debugdef" /mktyplib203 /win32
}; }
if ($dsptype == 2) {
- $linkop = qq{LIB32=link.exe -lib
+ $linkop = qq{LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
};
} else {
- $linkop = qq{LINK32=link.exe
+ $linkop = qq{LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo $lmodel $lflags /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo $lmodel $lflags /machine:I386
};
- }
+ }
qq{
!${second}IF "\$(CFG)" == "$name - Win32 $model"
diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl
index 9ee8918e9..7efdc11bf 100644
--- a/build/fixwin32mak.pl
+++ b/build/fixwin32mak.pl
@@ -14,63 +14,68 @@ $root = cwd;
# ignore our own direcory (allowing us to move into any parallel tree)
$root =~ s|^.:(.*)?$|cd "$1|;
$root =~ s|/|\\\\|g;
-print "Testing " . $root . "\n";
+$altroot = $root;
+$altroot =~ s| ".:| "|;
+print "Stripping " . $root . " and " . $altroot . "\n";
find(\&fixcwd, '.');
sub fixcwd {
if (m|.mak$|) {
$thisroot = $File::Find::dir;
- $thisroot =~ s|^./(.*)$|$1|;
- $thisroot =~ s|/|\\\\|g;
+ $thisroot =~ s|^./(.*)$|$1|;
+ $thisroot =~ s|/|\\\\|g;
$thisroot = $root . "\\\\" . $thisroot;
+ $thisaltroot = $altroot . "\\\\" . $thisroot;
$oname = $_;
- $tname = '.#' . $_;
- $verchg = 0;
-#print "Processing " . $thisroot . " of " . $_ . "\n";
- $srcfl = new IO::File $_, "r" || die;
- $dstfl = new IO::File $tname, "w" || die;
- while ($src = <$srcfl>) {
- if ($src =~ m|^\s*($root[^\"]*)\".*$|) {
-#print "Found " . $1 . "\"\n";
- $orig = $thisroot;
+ $tname = '.#' . $_;
+ $verchg = 0;
+ $srcfl = new IO::File $_, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ if ($src =~ m|^\s*($root[^\"]*)\".*$|) {
+ $orig = $thisroot;
+ } elsif ($src =~ m|^\s*($altroot[^\"]*)\".*$|) {
+ $orig = $thisaltroot;
+ }
+ if (defined($orig)) {
$repl = "cd \".";
while (!($src =~ s|$orig|$repl|)) {
-#print "Tried replacing " . $orig . " with " . $repl . "\n";
- if (!($orig =~ s|^(.*)\\\\[^\\]+$|$1|)) {
+ if (!($orig =~ s|^(.*)\\\\[^\\]+$|$1|)) {
break;
}
- $repl .= "\\..";
- }
-#print "Replaced " . $orig . " with " . $repl . "\n";
- $verchg = -1;
- }
+ $repl .= "\\..";
+ }
+ print "Replaced " . $orig . " with " . $repl . "\n";
+ $verchg = -1;
+ undef $orig;
+ }
print $dstfl $src;
- }
- undef $srcfl;
- undef $dstfl;
- if ($verchg) {
- unlink $oname || die;
- rename $tname, $oname || die;
- print "Corrected absolute paths within " . $oname . " in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname;
- }
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if ($verchg) {
+ unlink $oname || die;
+ rename $tname, $oname || die;
+ print "Corrected absolute paths within " . $oname . " in " . $File::Find::dir . "\n";
+ }
+ else {
+ unlink $tname;
+ }
$dname = $oname;
$dname =~ s/.mak$/.dsp/;
- @dstat = stat($dname);
+ @dstat = stat($dname);
@ostat = stat($oname);
if ($ostat[9] && $dstat[9] && ($ostat[9] != $dstat[9])) {
@onames = ($oname);
utime $dstat[9], $dstat[9], @onames;
- print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n";
+ print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n";
}
$oname =~ s/.mak$/.dep/;
@ostat = stat($oname);
if ($ostat[9] && $dstat[9] && ($ostat[9] != $dstat[9])) {
@onames = ($oname);
utime $dstat[9], $dstat[9], @onames;
- print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n";
+ print "Touched datestamp for " . $oname . " in " . $File::Find::dir . "\n";
}
}
}
diff --git a/build/lineends.pl b/build/lineends.pl
index 9b723f418..3e3067f76 100644
--- a/build/lineends.pl
+++ b/build/lineends.pl
@@ -26,16 +26,16 @@ $ignore .= "gif-jpg-jpeg-png-ico-bmp-";
$ignore .= "tar-gz-z-zip-jar-war-bz2-tgz-";
# Many document formats
-$ignore .= "eps-psd-pdf-ai-";
+$ignore .= "eps-psd-pdf-chm-ai-";
# Some encodings
$ignore .= "ucs2-ucs4-";
# Some binary objects
-$ignore .= "class-so-dll-exe-obj-a-o-lo-slo-sl-dylib-";
+$ignore .= "class-so-dll-exe-obj-lib-a-o-lo-slo-sl-dylib-";
# Some build env files
-$ignore .= "mcp-xdc-ncb-opt-pdb-ilk-sbr-";
+$ignore .= "mcp-xdc-ncb-opt-pdb-ilk-exp-res-pch-idb-sbr-";
$preservedate = 1;
@@ -63,22 +63,22 @@ while (defined @ARGV[0]) {
}
elsif (@ARGV[0] =~ m/^-/) {
die "What is " . @ARGV[0] . " supposed to mean?\n\n"
- . "Syntax:\t$0 [option()s] [path(s)]\n\n" . <<'OUTCH'
-Where: paths specifies the top level directory to convert (default of '.')
- options are;
+ . "Syntax:\t$0 [option()s] [path(s)]\n\n" . <<'OUTCH'
+Where: paths specifies the top level directory to convert (default of '.')
+ options are;
- --cr keep/add one ^M
- --nocr remove ^M's
- --touch the datestamp (default: keeps date/attribs)
- --force mismatched corrections (unbalanced ^M's)
- --FORCE all files regardless of file name!
+ --cr keep/add one ^M
+ --nocr remove ^M's
+ --touch the datestamp (default: keeps date/attribs)
+ --force mismatched corrections (unbalanced ^M's)
+ --FORCE all files regardless of file name!
OUTCH
}
else {
find(\&totxt, @ARGV[0]);
- print "scanned " . @ARGV[0] . "\n";
- $givenpaths = 1;
+ print "scanned " . @ARGV[0] . "\n";
+ $givenpaths = 1;
}
shift @ARGV;
}
@@ -90,49 +90,50 @@ if (!$givenpaths) {
sub totxt {
$oname = $_;
- $tname = '.#' . $_;
+ $tname = '.#' . $_;
if (!-f) {
return;
}
- @exts = split /\./;
- if ($forceending < 2) {
+ @exts = split /\./;
+ if ($forceending < 2) {
while ($#exts && ($ext = pop(@exts))) {
if ($ignore =~ m|-$ext-|i) {
return;
}
- }
+ }
}
- @ostat = stat($oname);
+ return if ($File::Find::dir =~ m|^(.+/)?.svn(/.+)?$|);
+ @ostat = stat($oname);
$srcfl = new IO::File $oname, "r" or die;
- $dstfl = new IO::File $tname, "w" or die;
+ $dstfl = new IO::File $tname, "w" or die;
binmode $srcfl;
- if ($notnative) {
+ if ($notnative) {
binmode $dstfl;
- }
- undef $t;
+ }
+ undef $t;
while (<$srcfl>) {
if (s/(\r*)\n$/\n/) {
- $n = length $1;
- if (!defined $t) {
- $t = $n;
- }
- if (!$forceending && (($n != $t) || m/\r/)) {
- print "mismatch in " .$oname. ":" .$n. " expected " .$t. "\n";
- undef $t;
- last;
- }
- elsif ($notnative > 0) {
+ $n = length $1;
+ if (!defined $t) {
+ $t = $n;
+ }
+ if (!$forceending && (($n != $t) || m/\r/)) {
+ print "mismatch in " .$oname. ":" .$n. " expected " .$t. "\n";
+ undef $t;
+ last;
+ }
+ elsif ($notnative > 0) {
s/\n$/\r\n/;
}
}
- print $dstfl $_;
- }
- if (defined $t && (tell $srcfl == tell $dstfl)) {
- undef $t;
- }
- undef $srcfl;
- undef $dstfl;
- if (defined $t) {
+ print $dstfl $_;
+ }
+ if (defined $t && (tell $srcfl == tell $dstfl)) {
+ undef $t;
+ }
+ undef $srcfl;
+ undef $dstfl;
+ if (defined $t) {
unlink $oname or die;
rename $tname, $oname or die;
@anames = ($oname);
@@ -142,8 +143,8 @@ sub totxt {
chmod $ostat[2] & 07777, @anames;
chown $ostat[5], $ostat[6], @anames;
print "Converted file " . $oname . " to text in " . $File::Find::dir . "\n";
- }
- else {
- unlink $tname or die;
- }
+ }
+ else {
+ unlink $tname or die;
+ }
}