From commits-return-8556-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Fri Aug 24 10:43:20 2007 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 68552 invoked from network); 24 Aug 2007 10:43:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Aug 2007 10:43:18 -0000 Received: (qmail 31652 invoked by uid 500); 24 Aug 2007 10:43:14 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 31637 invoked by uid 500); 24 Aug 2007 10:43:14 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 31626 invoked by uid 99); 24 Aug 2007 10:43:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2007 03:43:14 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2007 10:43:52 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 667701A9832; Fri, 24 Aug 2007 03:42:48 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r569339 - /apr/apr/trunk/build/fixwin32mak.pl Date: Fri, 24 Aug 2007 10:42:48 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070824104248.667701A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wrowe Date: Fri Aug 24 03:42:47 2007 New Revision: 569339 URL: http://svn.apache.org/viewvc?rev=569339&view=rev Log: We needed to fix the fix of .mak files to prevent insane amounts of recursion, because VS98 wasn't quite exporting the post-build targets appropriatly, and didn't respect the RECURSE flag. Modified: apr/apr/trunk/build/fixwin32mak.pl Modified: apr/apr/trunk/build/fixwin32mak.pl URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/fixwin32mak.pl?rev=569339&r1=569338&r2=569339&view=diff ============================================================================== --- apr/apr/trunk/build/fixwin32mak.pl (original) +++ apr/apr/trunk/build/fixwin32mak.pl Fri Aug 24 03:42:47 2007 @@ -19,6 +19,30 @@ print "Stripping " . $root . " and " . $altroot . "\n"; find(\&fixcwd, '.'); +# Given this pattern that disregarded the RECURSE flag... +# +# !IF "$(RECURSE)" == "0" +# +# ALL : "$(OUTDIR)\mod_charset_lite.so" +# +# !ELSE +# +# ALL : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_charset_lite.so" +# +# !ENDIF +#... +# DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep +#... +# ALL : $(DS_POSTBUILD_DEP) +# +# $(DS_POSTBUILD_DEP) : "libhttpd - Win32 Release" "libaprutil - Win32 Release" "libapr - Win32 Release" "$(OUTDIR)\mod_charset_lite.so" +# +# we will axe the final ALL : clause, +# strip all but the final element from $(DS_POSTBUILD_DEP) : clause +# move the DS_POSTBUILD_DEP assignment above the IF (for true ALL : targets) +# and in pass 2, append the $(DS_POSTBUILD_DEP) to the valid ALL : targets + + sub fixcwd { if (m|.mak$|) { $thisroot = $File::Find::dir; @@ -29,9 +53,22 @@ $oname = $_; $tname = '.#' . $_; $verchg = 0; + $postdep = 0; $srcfl = new IO::File $_, "r" || die; $dstfl = new IO::File $tname, "w" || die; while ($src = <$srcfl>) { + if ($src =~ m|^(DS_POSTBUILD_DEP=.+)$|) { + $postdepval = $1 . "\n\n"; + } + if ($src =~ s|^ALL : \$\(DS_POSTBUILD_DEP\)||) { + $postdep = -1; + $verchg = -1; + $src = <$srcfl>; + $src = <$srcfl> if ($src =~ m|^$|); + } + if ($postdep) { + $src =~ s|^(\$\(DS_POSTBUILD_DEP\)) :.+(\"[^\"]+\")$|"$1" : $2|; + } if ($src =~ m|^\s*($root[^\"]*)\".*$|) { $orig = $thisroot; } elsif ($src =~ m|^\s*($altroot[^\"]*)\".*$|) { @@ -54,9 +91,26 @@ undef $srcfl; undef $dstfl; if ($verchg) { - unlink $oname || die; - rename $tname, $oname || die; - print "Corrected absolute paths within " . $oname . " in " . $File::Find::dir . "\n"; + if ($postdep) { + $srcfl = new IO::File $tname, "r" || die; + $dstfl = new IO::File $oname, "w" || die; + while ($src = <$srcfl>) { + if ($src =~ m|^\!IF "\$\(RECURSE\)" == "0".*$|) { + print $dstfl $postdepval; + } + $src =~ s|^(ALL : .+)$|$1 "\$\(DS_POSTBUILD_DEP\)"|; + print $dstfl $src; + } + undef $srcfl; + undef $dstfl; + unlink $tname || die; + print "Corrected post-dependency within " . $oname . " in " . $File::Find::dir . "\n"; + } + else { + unlink $oname || die; + rename $tname, $oname || die; + print "Corrected absolute paths within " . $oname . " in " . $File::Find::dir . "\n"; + } } else { unlink $tname;