Commit | Line | Data |
---|---|---|
30b50b5c | 1 | #! /usr/bin/perl |
9ad5de0c | 2 | # Build Emacs in several different configurations. |
30b50b5c | 3 | |
f858db9f | 4 | # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
4e6835db | 5 | # Free Software Foundation, Inc. |
9ad5de0c | 6 | |
30b50b5c | 7 | # This file is part of GNU Emacs. |
9ad5de0c GM |
8 | |
9 | # GNU Emacs is free software: you can redistribute it and/or modify | |
30b50b5c | 10 | # it under the terms of the GNU General Public License as published by |
9ad5de0c GM |
11 | # the Free Software Foundation, either version 3 of the License, or |
12 | # (at your option) any later version. | |
13 | ||
30b50b5c GM |
14 | # GNU Emacs is distributed in the hope that it will be useful, |
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | # GNU General Public License for more details. | |
9ad5de0c | 18 | |
30b50b5c | 19 | # You should have received a copy of the GNU General Public License |
9ad5de0c | 20 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
30b50b5c | 21 | |
30b50b5c | 22 | |
53e7bbb8 GM |
23 | require 5; |
24 | use Getopt::Long; | |
25 | use File::Basename; | |
26 | use Cwd; | |
27 | ||
30b50b5c GM |
28 | @configs = |
29 | ( | |
30 | ["--without-x", "--optim"], | |
31 | ["--without-x-toolkit", "--optim"], | |
32 | ["--without-toolkit-scroll-bars", "--optim"], | |
33 | ["--with-x-toolkit=lucid", "--optim"], | |
34 | ["--with-x-toolkit=motif", "--optim"], | |
35 | ["--with-x-toolkit=motif", "--enable-checking"], | |
36 | ["--with-x-toolkit=motif", "--gcc3"], | |
37 | ["--with-x-toolkit=motif", ""], | |
38 | ); | |
39 | ||
40 | $log = "/tmp/$$.out"; | |
41 | print "Using log file $log\n"; | |
42 | unlink $log; | |
43 | ||
44 | $root = $ENV{"EMACS_ROOT"}; | |
45 | $root = "/gd/gnu/emacs" unless $root; | |
53e7bbb8 GM |
46 | |
47 | $rc = GetOptions ("help" => \$help); | |
48 | if ($rc == 0 || $help) | |
49 | { | |
50 | print <<USAGE; | |
51 | build-configs | |
52 | ||
53 | Build Emacs in different configurations. | |
54 | ||
55 | --help show this help | |
56 | ||
57 | USAGE | |
58 | exit 1; | |
59 | } | |
60 | ||
61 | # Chdir to the top-level directory of the tree. If not in a tree | |
62 | # containing Emacs, use the default. | |
63 | ||
64 | while (! -f "src/emacs.c" && cwd () ne "/") | |
65 | { | |
66 | chdir ".."; | |
67 | } | |
68 | ||
69 | chdir $root if cwd () eq "/"; | |
70 | print "Build in ", cwd (), "\n"; | |
30b50b5c GM |
71 | |
72 | foreach $config (@configs) | |
73 | { | |
74 | my $configure_options = @$config[0]; | |
75 | my $make_options = @$config[1]; | |
76 | my $rc; | |
77 | ||
78 | print "$configure_options, $make_options\n"; | |
79 | unlink "config.cache"; | |
80 | ||
81 | $rc = system ("$root/configure $configure_options >>$log 2>&1"); | |
177c0ea7 | 82 | if ($rc != 0) |
30b50b5c GM |
83 | { |
84 | print "configure failed\n"; | |
85 | exit 1; | |
86 | } | |
87 | ||
88 | $rc = system ("make-emacs --all $make_options >>$log 2>&1"); | |
177c0ea7 | 89 | if ($rc != 0) |
30b50b5c GM |
90 | { |
91 | print "Make failed\n"; | |
92 | exit 1; | |
93 | } | |
94 | } | |
95 | ||
96 | # Local Variables: | |
97 | # mode: cperl | |
98 | # End: | |
ab5796a9 MB |
99 | |
100 | # arch-tag: 20a4452d-610a-4e54-9abc-ffe79f5c0d30 |