4
if ($ARGV[0] eq '-6') {
7
elsif ($ARGV[0] eq '-5') {
10
elsif ($ARGV[0] eq '-w3') {
13
elsif ($ARGV[0] eq '-w4') {
16
elsif ($ARGV[0] eq '-ia64') {
19
elsif ($ARGV[0] eq '-d') {
20
find(\&todebugpools, '.');
22
elsif ($ARGV[0] eq '-b') {
23
find(\&tobrowse, '.');
25
elsif ($ARGV[0] eq '-m') {
26
## 0 - conapp, 1 - dll lib, 2 - static lib
32
print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n";
33
print "Specify -w3 or -w4 for .dsp build with warning level 3 or 4 (strict)\n\n";
34
print "Specify -ia64 for build targeted at Itanium (req's psdk tools)\n\n";
35
print "Specify -p for extreme pool debugging\n\n";
36
die "Missing argument";
45
$srcfl = new IO::File $oname, "r" || die;
46
$dstfl = new IO::File $tname, "w" || die;
47
while ($src = <$srcfl>) {
48
if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) {
51
if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) {
54
if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) {
57
if ($src =~ s|^(# ADD CPP .*)/EHsc (.*)|$1/GX $2|) {
60
if ($src =~ s|^(# ADD BASE CPP .*)/EHsc (.*)|$1/GX $2|) {
63
if ($src !~ m|^# PROP AllowPerConfigDependencies|) {
73
rename $tname, $oname || die;
74
print "Converted VC6 project " . $oname . " to VC5 in " . $File::Find::dir . "\n";
88
$srcfl = new IO::File $_, "r" || die;
89
$dstfl = new IO::File $tname, "w" || die;
90
while ($src = <$srcfl>) {
91
if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) {
94
if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) {
99
if ($src =~ s|^(# ADD CPP .*)/GX (.*)|$1/EHsc $2|) {
102
if ($src =~ s|^(# ADD BASE CPP .*)/GX (.*)|$1/EHsc $2|) {
106
if ($verchg && $src =~ m|^# Begin Project|) {
107
print $dstfl "# PROP AllowPerConfigDependencies 0\n";
113
unlink $oname || die;
114
rename $tname, $oname || die;
115
print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n";
125
if (m|\.dsp$| || m|\.mak$|) {
129
$srcfl = new IO::File $_, "r" || die;
130
$dstfl = new IO::File $tname, "w" || die;
131
while ($src = <$srcfl>) {
132
while ($src =~ m|\\\n$|) {
133
$src = $src . <$srcfl>
135
if ($src =~ s|(\bCPP.*) /W4(.*)|$1 /W3$2|) {
143
unlink $oname || die;
144
rename $tname, $oname || die;
145
print "Converted project " . $oname . " to warn:3 in " . $File::Find::dir . "\n";
155
if (m|\.dsp$| || m|\.mak$|) {
159
$srcfl = new IO::File $_, "r" || die;
160
$dstfl = new IO::File $tname, "w" || die;
161
while ($src = <$srcfl>) {
162
while ($src =~ m|\\\n$|) {
163
$src = $src . <$srcfl>
165
if ($src =~ s|(\bCPP.*) /W3(.*)|$1 /W4$2|) {
173
unlink $oname || die;
174
rename $tname, $oname || die;
175
print "Converted project " . $oname . " to warn:4 " . $File::Find::dir . "\n";
185
if (m|\.dsp$| || m|\.mak$|) {
189
$srcfl = new IO::File $_, "r" || die;
190
$dstfl = new IO::File $tname, "w" || die;
191
while ($src = <$srcfl>) {
192
while ($src =~ m|\\\n$|) {
193
$src = $src . <$srcfl>
195
if ($src =~ s|Win32 \(x86\) (Release)|Win32 (IA64) $1|s) {
198
if ($src =~ s|Win32 \(x86\) (Debug)|Win32 (IA64) $1|s) {
201
if ($src =~ s| - Win32 (Release)| - Win32 (IA64) $1|s) {
204
if ($src =~ s| - Win32 (Debug)| - Win32 (IA64) $1|s) {
207
# Cross compilation exceptions
208
if (!(m|gen[^/]*$| || m|dftables[^/]*$|)) {
209
if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As64 /Wp64$2$3|s) {
212
if ($src =~ s|(\bLINK.*/machine):I386(.*)|$1:IA64$2|s) {
217
if ($src =~ s|(\bCPP.* /W3)(.*) /FD(.*)|$1 /As32 /Wp64$2$3|s) {
226
unlink $oname || die;
227
rename $tname, $oname || die;
228
print "Converted build file " . $oname . " to Win64 in " . $File::Find::dir . "\n";
242
$srcfl = new IO::File $oname, "r" || die;
243
$dstfl = new IO::File $tname, "w" || die;
244
while ($src = <$srcfl>) {
245
if ($src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "APR_POOL_DEBUG" |) {
247
if ($oname =~ /apr\.dsp$/) {
248
$src =~ s|^(# ADD CPP .* /D "_DEBUG" )|$1/D "POOL_DEBUG" |;
256
unlink $oname || die;
257
rename $tname, $oname || die;
258
print "Converted project " . $oname . " to debug pools in " . $File::Find::dir . "\n";
266
sub tobrowsesources {
272
$srcfl = new IO::File $oname, "r" || die;
273
$dstfl = new IO::File $tname, "w" || die;
274
while ($src = <$srcfl>) {
275
if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) {
283
unlink $oname || die;
284
rename $tname, $oname || die;
285
print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n";
298
$_ =~ s/\.mak\.in/.dsp/;
300
$srcfl = new IO::File $oname, "r" || die;
301
$dstfl = new IO::File $tname, "w" || die;
302
while ($src = <$srcfl>) {
303
if ($src =~ s|^(# ADD CPP .*)( /Fd)|$1 /Fr "/httpd-2.0/srclib/apr"$2|) {
311
unlink $oname || die;
312
rename $tname, $oname || die;
313
print "Converted project " . $oname . " to browse sources in " . $File::Find::dir . "\n";
325
$cdefs = qq{/D "WIN32" /D "_CONSOLE"};
326
$lmodel = qq{/subsystem:console};
327
$targname = "Win32 (x86) Console Application";
329
$debpath = "Debug"; $relpath = "Release";
330
} elsif ($dsptype == 1) {
331
$cdefs = qq{/D "WIN32" /D "_WINDOWS"};
332
$lmodel = qq{/subsystem:windows /dll};
333
$targname = "Win32 (x86) Dynamic-Link Library";
335
$debpath = "Debug"; $relpath = "Release";
336
} elsif($dsptype == 2) {
337
$cdefs = qq{/D "WIN32" /D "_CONSOLE"};
338
$lmodel = qq{/subsystem:console};
339
$targname = "Win32 (x86) Static Library";
341
$debpath = "LibD"; $relpath = "LibR";
350
$debugdef = "NDEBUG";
351
$cflags = "/MD /W3 /O2";
352
$cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"};
354
$file .= dsponemodel();
359
$debugdef = "_DEBUG";
360
$cflags = "/MDd /W3 /GX /Zi /Od";
361
$cincl = qq{/I "./include" /I "./os/win32" /I "./srclib/apr/include" /I "./srclib/apr-util/include"};
362
$lflags = qq{/incremental:no /debug};
363
$file .= dsponemodel();
370
# Name "$name - Win32 Release"
371
# Name "$name - Win32 Debug"
376
#HERE IS OUR FOREACH!
377
$file .= qq{# Begin Source File
379
SOURCE=./server/main.c
385
$icon="$toroot/build/win32/apache.ico";
386
$file .= qq{# Begin Source File
391
$icon = "icon=" . $icon . " ";
393
if ($dsptype == 0 || $dsptype == 1) {
401
SOURCE=$toroot/include/ap_release.h
402
# PROP Ignore_Default_Tool 1
403
# Begin Custom Build - Creating Version Resource
404
InputPath=$toroot/include/ap_release.h $toroot/build/win32/win32ver.awk
406
"./$name.rc" : \$(SOURCE) "\$(INTDIR)" "\$(OUTDIR)"
407
awk -f $toroot/build/win32/win32ver.awk $name "Apache HTTP Server" $toroot/include/ap_release.h $icon> ./Apache.rc
422
$midl = "MTL=midl.exe\n";
426
qq{# Microsoft Developer Studio Project File - Name="$name" - Package Owner=<4>
427
# Microsoft Developer Studio Generated Build File, Format Version 6.00
430
# TARGTYPE "$targname" $targid
432
CFG=$name - Win32 Release
433
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
434
!MESSAGE use the Export Makefile command and run
436
!MESSAGE NMAKE /f "$name.mak".
438
!MESSAGE You can specify a configuration when running NMAKE
439
!MESSAGE by defining the macro CFG on the command line. For example:
441
!MESSAGE NMAKE /f "$name.mak" CFG="$name - Win32 Release"
443
!MESSAGE Possible choices for configuration are:
445
!MESSAGE "$name - Win32 Release" (based on "$targname")
446
!MESSAGE "$name - Win32 Debug" (based on "$targname")
450
# PROP AllowPerConfigDependencies 0
451
# PROP Scc_ProjName ""
452
# PROP Scc_LocalPath ""
458
if ($model eq "Release") {
459
$targpath = $relpath;
461
$targpath = $debpath;
465
qq{# ADD BASE MTL /nologo /D "$debugdef" /win32
466
# ADD MTL /nologo /D "$debugdef" /mktyplib203 /win32
469
$linkop = qq{LIB32=link.exe -lib
470
# ADD BASE LIB32 /nologo
474
$linkop = qq{LINK32=link.exe
475
# ADD BASE LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo $lmodel $lflags /machine:I386
476
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib mswsock.lib /nologo $lmodel $lflags /machine:I386
481
!${second}IF "\$(CFG)" == "$name - Win32 $model"
483
# PROP BASE Use_MFC 0
484
# PROP BASE Use_Debug_Libraries $usedebuglib
485
# PROP BASE Output_Dir "$targpath"
486
# PROP BASE Intermediate_Dir "$targpath"
487
# PROP BASE Target_Dir ""
489
# PROP Use_Debug_Libraries $usedebuglib
490
# PROP Output_Dir "$targpath"
491
# PROP Intermediate_Dir "$targpath"
492
# PROP Ignore_Export_Lib 0
494
# ADD BASE CPP /nologo $cflags $cincl /D "$debugdef" $cdefs /FD /c
495
# ADD CPP /nologo $cflags $cincl /D "$debugdef" $cdefs /Fd"$targpath/$name" /FD /c
496
${midl}# ADD BASE RSC /l 0x409 /d "$debugdef"
497
# ADD RSC /l 0x409 /d "$debugdef"
499
# ADD BASE BSC32 /nologo
b'\\ No newline at end of file'