| 1 | #! /usr/bin/perl |
| 2 | |
| 3 | # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 |
| 4 | # Free Software Foundation, Inc. |
| 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 |
| 10 | # the Free Software Foundation; either version 3, or (at your option) |
| 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 |
| 20 | # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 | # Boston, MA 02110-1301, USA. |
| 22 | |
| 23 | # Build Emacs in several different configurations. |
| 24 | |
| 25 | require 5; |
| 26 | use Getopt::Long; |
| 27 | use File::Basename; |
| 28 | use Cwd; |
| 29 | |
| 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"; |
| 43 | print "Using log file $log\n"; |
| 44 | unlink $log; |
| 45 | |
| 46 | $root = $ENV{"EMACS_ROOT"}; |
| 47 | $root = "/gd/gnu/emacs" unless $root; |
| 48 | |
| 49 | $rc = GetOptions ("help" => \$help); |
| 50 | if ($rc == 0 || $help) |
| 51 | { |
| 52 | print <<USAGE; |
| 53 | build-configs |
| 54 | |
| 55 | Build Emacs in different configurations. |
| 56 | |
| 57 | --help show this help |
| 58 | |
| 59 | USAGE |
| 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 | |
| 66 | while (! -f "src/emacs.c" && cwd () ne "/") |
| 67 | { |
| 68 | chdir ".."; |
| 69 | } |
| 70 | |
| 71 | chdir $root if cwd () eq "/"; |
| 72 | print "Build in ", cwd (), "\n"; |
| 73 | |
| 74 | foreach $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"); |
| 84 | if ($rc != 0) |
| 85 | { |
| 86 | print "configure failed\n"; |
| 87 | exit 1; |
| 88 | } |
| 89 | |
| 90 | $rc = system ("make-emacs --all $make_options >>$log 2>&1"); |
| 91 | if ($rc != 0) |
| 92 | { |
| 93 | print "Make failed\n"; |
| 94 | exit 1; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | # Local Variables: |
| 99 | # mode: cperl |
| 100 | # End: |
| 101 | |
| 102 | # arch-tag: 20a4452d-610a-4e54-9abc-ffe79f5c0d30 |