changeset 40052:0f6e6a0405c4

Add --help option. Add support for building in arbitrary source trees.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 19 Oct 2001 11:31:22 +0000
parents d63231947663
children 9e38aa44c426
files admin/build-configs
diffstat 1 files changed, 30 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/admin/build-configs	Fri Oct 19 11:19:33 2001 +0000
+++ b/admin/build-configs	Fri Oct 19 11:31:22 2001 +0000
@@ -21,6 +21,11 @@
 
 # Build Emacs in several different configurations.
 
+require 5;
+use Getopt::Long;
+use File::Basename;
+use Cwd;
+
 @configs =
   (
    ["--without-x", 		  "--optim"],
@@ -39,7 +44,31 @@
 
 $root = $ENV{"EMACS_ROOT"};
 $root = "/gd/gnu/emacs" unless $root;
-chdir ($root) or die "Cannot chdir to emacs";
+
+$rc = GetOptions ("help" => \$help);
+if ($rc == 0 || $help)
+  {
+    print <<USAGE;
+build-configs
+
+Build Emacs in different configurations.
+
+--help			show this help
+
+USAGE
+    exit 1;
+  }
+
+# Chdir to the top-level directory of the tree.  If not in a tree
+# containing Emacs, use the default.
+
+while (! -f "src/emacs.c" && cwd () ne "/")
+  {
+    chdir "..";
+  }
+
+chdir $root if cwd () eq "/";
+print "Build in ", cwd (), "\n";
 
 foreach $config (@configs)
   {