summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2001-02-25 23:03:29 +0100
committerWilliam A. Rowe Jr <wrowe@apache.org>2001-02-25 23:03:29 +0100
commitc4ff126a35968ad69c43f8cd9950fc353eed6e85 (patch)
treeb90f7c5a3e026f51a5993aa90b55d67e6cf16306 /build
parent Whoops ... if I'm enabling mod_info to build on Win32, better clean (diff)
downloadapache2-c4ff126a35968ad69c43f8cd9950fc353eed6e85.tar.xz
apache2-c4ff126a35968ad69c43f8cd9950fc353eed6e85.zip
Ok ... .mak files are nasty. Here's a bit to clean up -some- of that
nastyness - the absolute paths that .dsp dependencies off of parent directories are encoded with. This chops cd "\checkout\httpd-2.0" from the support directory down to cd "..", a much nicer solution. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88334 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build')
-rw-r--r--build/fixwin32mak.pl48
1 files changed, 48 insertions, 0 deletions
diff --git a/build/fixwin32mak.pl b/build/fixwin32mak.pl
new file mode 100644
index 0000000000..d447697d1d
--- /dev/null
+++ b/build/fixwin32mak.pl
@@ -0,0 +1,48 @@
+#
+# fixwin32mak.pl ::: Apache/Win32 maintanace program
+#
+# This program, launched from the build/ directory, replaces all nasty absoulute paths
+# in the win32 .mak files with the appropriate relative root.
+#
+# Run this program prior to committing or packaging any newly exported make files.
+
+use Cwd;
+use IO::File;
+use File::Find;
+
+chdir '..';
+$root = cwd;
+$root =~ s|.:(.*)|cd "$1|;
+$root =~ s|/|\\\\|g;
+print $root . "\n";
+find(\&fixcwd, '.');
+
+sub fixcwd {
+ if (m|.mak$|) {
+ $repl = $File::Find::dir;
+ $repl =~ s|^./||;
+ $repl =~ s|[^\./]+|..|g;
+ $repl =~ s|/|\\\\|;
+ $oname = $_;
+ $tname = '.#' . $_;
+ $verchg = 0;
+ $srcfl = new IO::File $_, "r" || die;
+ $dstfl = new IO::File $tname, "w" || die;
+ while ($src = <$srcfl>) {
+ if ($src =~ s|^(\s*)$root|$1cd "$repl|) {
+ $verchg = -1;
+ }
+ 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;
+ }
+ }
+}