summaryrefslogtreecommitdiff
path: root/admin/build-configs
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-10-19 11:31:22 +0000
committerGerd Moellmann <gerd@gnu.org>2001-10-19 11:31:22 +0000
commit53e7bbb89f7ad9b07b281f2fe826167779863ade (patch)
treea69df901995c1da7133f55ff882183fbe862b53a /admin/build-configs
parentc4e7e308b3e3b4f1911089b11a47d47b6198fec2 (diff)
downloademacs-53e7bbb89f7ad9b07b281f2fe826167779863ade.tar.gz
Add --help option. Add support for building
in arbitrary source trees.
Diffstat (limited to 'admin/build-configs')
-rwxr-xr-xadmin/build-configs31
1 files changed, 30 insertions, 1 deletions
diff --git a/admin/build-configs b/admin/build-configs
index 521afb3acff..5827276bf5e 100755
--- a/admin/build-configs
+++ b/admin/build-configs
@@ -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 @@ unlink $log;
$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)
{