build-configs 2.2 KB

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