Initial Commit
[packages] / xemacs-packages / mmm-mode / elisp-comp
1 #!/bin/sh
2 # Copyright (C) 1995 Free Software Foundation, Inc.
3 # François Pinard <pinard@iro.umontreal.ca>, 1995.
4 #
5 # This program 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 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 # This script byte-compiles all `.el' files which are part of its
20 # arguments, using GNU Emacs, and put the resulting `.elc' files into
21 # the current directory, so disregarding the original directories used
22 # in `.el' arguments.
23 #
24 # This script manages in such a way that all Emacs LISP files to
25 # be compiled are made visible between themselves, in the event
26 # they require or load-library one another.
27
28 # This script was modified by Michael Abraham Shulman
29 # <mas@kurukshetra.cjb.net> not to create a temporary directory, so
30 # that elisp files not given on the command line at the same time,
31 # the way Automake *actually* uses this script, can load each other.
32
33 if test $# = 0; then
34    echo 1>&2 "No files given to $0"
35    exit 1
36 else
37    if test -z "$EMACS" || test "$EMACS" = "t"; then
38       # Value of "t" means we are running in a shell under Emacs.
39       # Just assume Emacs is called "emacs".
40       EMACS=emacs
41    fi
42
43 #   tempdir=elc.$$
44 #   mkdir $tempdir
45 #   cp $* $tempdir
46 #   cd $tempdir
47
48 #   echo "elisp-comp called on $*"
49    echo "(setq load-path (cons nil load-path))" > script
50    $EMACS -q -batch -l script -f batch-byte-compile $*
51 #   mv *.elc ..
52
53 #   cd ..
54 #   rm -fr $tempdir
55 fi