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