forked from kmroz/rmoo
-
Notifications
You must be signed in to change notification settings - Fork 5
/
elisp-comp
executable file
·88 lines (82 loc) · 3.3 KB
/
elisp-comp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
# Copyright (C) 1995 Free Software Foundation, Inc.
# François Pinard <[email protected]>, 1995.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# This script byte-compiles all `.el' files which are part of its
# arguments, using GNU Emacs, and put the resulting `.elc' files into
# the current directory, so disregarding the original directories used
# in `.el' arguments.
#
# This script manages in such a way that all Emacs LISP files to
# be compiled are made visible between themselves, in the event
# they require or load-library one another.
#
# Matthew Campbell <[email protected]> modified this script to add the
# contents of the srcdir environment variable to the Emacs load-path
# variable, so that files in $srcdir (most likely other source files in the
# package) are visible to the file being compiled. This is necessary because
# Makefiles generated by GNU automake call elisp-comp on one Lisp file at a
# time, but these Lisp files may depend on each other. It was also necessary
# to modify the rule for compiling Lisp files to set the srcdir variable
# before calling elisp-comp.
#
# $Author: mattcampbell $
# $Date: 2000/10/18 21:29:13 $
# $Revision: 1.8 $
if test $# = 0; then
echo 1>&2 "No files given to $0"
exit 1
else
if test -z "$EMACS" || test "$EMACS" = "t"; then
# Value of "t" means we are running in a shell under Emacs.
# Just assume Emacs is called "emacs".
EMACS=emacs
fi
tempdir=elc.$$
mkdir $tempdir
cp $* $tempdir
cd $tempdir
echo "(setq load-path (cons (expand-file-name \"$srcdir\" \"..\") load-path))" > script
$EMACS -q -batch -l script -f batch-byte-compile *.el
mv *.elc ..
cd ..
rm -fr $tempdir
fi
# $Log: elisp-comp,v $
# Revision 1.8 2000/10/18 21:29:13 mattcampbell
# Updated my email address.
#
# Revision 1.7 2000/01/17 05:31:47 mattcamp
# Added missing quotes around substituted srcdir variable.
#
# Revision 1.6 2000/01/16 21:16:29 mattcamp
# Changed the load-path setting statement so that the srcdir environment is substituted by the shell instead of being fetched by Emacs with the getenv function.
#
# Revision 1.5 1999/12/27 00:56:24 mattcamp
# Added prominent notice of modification required by the GPL.
#
# Revision 1.4 1999/11/24 19:25:01 mattcamp
# Added missing backslashes in "(setq load-path ...)" statement.
#
# Revision 1.3 1999/11/24 19:16:23 mattcamp
# Modified to include the source directory, not the temporary compile directory, in the load path.
#
# Revision 1.2 1999/10/30 01:00:59 mattcamp
# Modified to add the pathname of the current directory, rather than nil, to the load-path when running Emacs.
#
# Revision 1.1 1999/10/30 00:59:37 mattcamp
# Initial revision
#