You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@locus.apache.org on 2000/12/04 21:39:59 UTC
cvs commit: apr/test MakeWin32Make.pl
wrowe 00/12/04 12:39:58
Added: test MakeWin32Make.pl
Log:
Test Makefile.in -> Makefile converter for Win32 ... I'll wrap with a
.dsp soonish. I have no issues with using a .pl for apr/test builders,
since they are the exception, rather than the typical user.
Revision Changes Path
1.1 apr/test/MakeWin32Make.pl
Index: MakeWin32Make.pl
===================================================================
use IO::File;
$srcfl = new IO::File "Makefile.in", "r" || die "failed to open .in file";
$dstfl = new IO::File "Makefile", "w" || die "failed to create Makefile";
print $dstfl "LINK=link.exe\n";
while ($t = <$srcfl>) {
if ($t =~ s|\@CFLAGS\@|\/nologo \/MDd \/W3 \/Gm \/GX \/Zi \/Od \/D "_DEBUG" \/D "WIN32" \/D APR_DECLARE_STATIC \/FD|) {
$t =~ s|-g ||;
}
$t =~ s|\@LDFLAGS\@|\/nologo \/debug \/machine:I386|;
$t =~ s|\@RM\@|del|;
$t =~ s|(\$\(RM\)) -f|$1|;
$t =~ s|\@CC\@|cl|;
$t =~ s|\@RANLIB\@||;
$t =~ s|\@OPTIM\@||;
$t =~ s|\@LIBS\@|kernel32\.lib user32\.lib advapi32\.lib ws2_32\.lib wsock32\.lib|;
$t =~ s|-I\$\(INCDIR\)|\/I "\$\(INCDIR\)"|;
$t =~ s|\.\.\/libapr\.a|\.\./LibD/apr\.lib|;
if ($t =~ s|\@EXEEXT\@|\.exe|) {
$t =~ s|\$\(CC\) \$\(CFLAGS\)|\$\(LINK\) \/subsystem:console|;
$t =~ s|-o (\S+)|\/out:\"$1\"|;
$t =~ s|--export-dynamic ||;
$t =~ s|-fPIC ||;
}
if ($t =~ s|\$\(CC\) -shared|\$\(LINK\) \/subsystem:windows \/dll|) {
$t =~ s|-o (\S+)|\/out:\"$1\"|;
}
while ($t =~ s|\.a\b|\.lib|) {}
while ($t =~ s|\.o\b|\.obj|) {}
while ($t =~ s|\.so\b|\.dll|) {}
print $dstfl $t;
}
undef $srcfl;
undef $dstfl;