0
|
1 #!/bin/sh
|
|
2 ### update-elc.sh --- recompile all missing or out-or-date .elc files
|
|
3
|
|
4 # Author: Jamie Zawinski <jwz@lucid.com>
|
|
5 # Maintainer: Ben Wing <ben.wing@Eng.Sun.COM>
|
|
6 # Created: ?
|
|
7 # Version: 1.0
|
|
8 # Modified: 94/07/13 16:18:44
|
|
9 # Keywords: recompile .el .elc
|
|
10
|
|
11 ### Commentary:
|
|
12 ## Recompile all .elc files that need recompilation. Requires a working
|
|
13 ## version of 'xemacs'. Correctly handles the case where the .elc files
|
|
14 ## are missing; thus you can execute 'rm lisp/*/*.elc' before running
|
|
15 ## this script. Run this from the parent directory of 'src', 'lisp',
|
|
16 ## and 'etc'. (If this is a Sun workspace, you can run it from
|
|
17 ## 'era-specific' instead.)
|
|
18
|
|
19 set -eu
|
2
|
20 unset MAKEFLAGS # GNU make sets MAKEFLAGS to -w; confuses non-GNU make
|
0
|
21
|
|
22 # This means we're running in a Sun workspace
|
|
23 if [ -d ../era-specific ]; then
|
|
24 cd ../editor
|
|
25 fi
|
|
26
|
|
27 # get to the right directory
|
|
28 if [ ! -d ./lisp ]; then
|
|
29 if [ -d ../lisp ]; then
|
|
30 cd ..
|
|
31 else
|
|
32 echo $0: neither ./lisp/ nor ../lisp/ exist
|
|
33 exit 1
|
|
34 fi
|
|
35 fi
|
|
36
|
|
37 EMACS=${XEMACS:-./src/xemacs}
|
|
38 echo " (using $EMACS)"
|
|
39
|
|
40 export EMACS
|
|
41
|
|
42 # fuckin' sysv, man...
|
|
43 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
|
|
44 echon()
|
|
45 {
|
|
46 /bin/echo $* '\c'
|
|
47 }
|
|
48 else
|
|
49 echon()
|
|
50 {
|
|
51 echo -n $*
|
|
52 }
|
|
53 fi
|
|
54
|
|
55
|
|
56 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
|
12
|
57 BYTECOMP="$REAL -batch -q -no-site-file -l bytecomp"
|
0
|
58 echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`"
|
|
59 echo " with $REAL..."
|
|
60
|
12
|
61 prune_vc="( -name SCCS -o -name RCS -o -name CVS ) -prune -o"
|
0
|
62
|
|
63 tmp1=/tmp/rcl1.$$
|
|
64 tmp2=/tmp/rcl2.$$
|
|
65 rm -f $tmp1 $tmp2
|
|
66
|
|
67 # tmp1 is a list of all .el files
|
|
68 # tmp2 is a list of all .elc files
|
12
|
69 find lisp/. $prune_vc -name '*.el' -print | sort > $tmp1
|
|
70 find lisp/. $prune_vc -name '*.elc' -print | sed 's/elc$/el/' | sort > $tmp2
|
0
|
71
|
|
72 echon "Deleting .elc files without .el files... "
|
|
73 # (except for vm/vm.elc)
|
|
74 comm -13 $tmp1 $tmp2 | sed 's/\(.*\)\.el$/echo \1.elc ; rm \1.elc/' | sh
|
|
75 echo done.
|
|
76
|
|
77
|
|
78 # first recompile the byte-compiler, so that the other compiles take place
|
|
79 # with the latest version (assuming we're compiling the lisp dir of the emacs
|
|
80 # we're running, which might not be the case, but often is.)
|
|
81 #
|
|
82 echon "Checking the byte compiler... "
|
12
|
83 $BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp
|
0
|
84
|
|
85 echo Compiling files without .elc...
|
|
86
|
|
87 # Isn't it wonderful the number of different ways you can
|
|
88 # iterate over a list of files?
|
|
89
|
|
90 #
|
|
91 # First compile all files which don't have a .elc version, except for these:
|
|
92 #
|
|
93
|
|
94 NUMTOCOMPILE=20 # compile up to 20 files with each invocation
|
|
95
|
|
96 comm -23 $tmp1 $tmp2 | sed '
|
|
97 \!/,!d
|
|
98 \!/edebug/edebug-test.el$!d
|
|
99 \!/emulators/edt.el$!d
|
|
100 \!/energize/energize-load.el$!d
|
|
101 \!/energize/write-file.el$!d
|
|
102 \!/eos/!d
|
|
103 \!/gnus/!d
|
|
104 \!/ilisp/!d
|
|
105 \!/paths.el$!d
|
|
106 \!/prim/loadup.el$!d
|
|
107 \!/prim/loadup-el.el$!d
|
|
108 \!/prim/update-elc.el$!d
|
|
109 \!/site-start.el$!d
|
|
110 \!/site-load.el$!d
|
|
111 \!/site-init.el$!d
|
|
112 \!/version.el$!d
|
|
113 \!/sunpro/sunpro-load.el$!d
|
|
114 \!/tm/!d
|
|
115 \!/tl/!d
|
|
116 \!/mel/!d
|
|
117 \!/url/!d
|
|
118 \!/viper/!d
|
|
119 \!/vm/!d
|
|
120 \!/w3/!d
|
|
121 \!/hyperbole/!d
|
|
122 \!/oobr/!d
|
|
123 \!/ediff/!d
|
|
124 \!/egg/!d
|
|
125 \!/its/!d
|
|
126 \!/mule/!d
|
|
127 \!/quail/!d
|
12
|
128 ' | xargs -t -n$NUMTOCOMPILE $BYTECOMP -f batch-byte-compile
|
0
|
129
|
|
130 rm -f $tmp1 $tmp2
|
|
131 echo Done.
|
|
132
|
|
133 # vm is hard...
|
|
134 #
|
|
135 echon "Compiling VM... "
|
|
136 ( cd lisp/vm ; make EMACS=$REAL )
|
|
137 echo done.
|
|
138
|
|
139 if [ -d lisp/ediff ]; then
|
|
140 echo Compiling EDIFF...
|
|
141 ( cd lisp/ediff ; make EMACS=$REAL elc )
|
|
142 echo EDIFF done.
|
|
143 fi
|
|
144
|
|
145 if [ -d lisp/viper ]; then
|
|
146 echo Compiling Viper...
|
|
147 ( cd lisp/viper ; make EMACS=$REAL elc )
|
|
148 echo Viper done.
|
|
149 fi
|
|
150
|
|
151 # Gnus now has a makefile...
|
|
152 echo Compiling Gnus...
|
|
153 ( cd lisp/gnus ; make EMACS=$REAL some )
|
|
154 echo Gnus done.
|
|
155
|
|
156 # This is really part of w3.
|
|
157 echo Compiling URL...
|
|
158 ( cd lisp/url ; make EMACS=$REAL )
|
|
159 echo URL done.
|
|
160
|
|
161 # and gee w3 has its own makefile as well
|
|
162 # (no especial need to use it, though)
|
|
163 echo Compiling W3...
|
|
164 ( cd lisp/w3 ; make EMACS=$REAL )
|
|
165 echo W3 done.
|
|
166
|
|
167 # Hyperbole has to be different as well. What is it with these big packages?
|
|
168 echo Compiling Hyperbole...
|
|
169 ( cd lisp/hyperbole ; make EMACS=$REAL elc )
|
|
170 echo Hyperbole done.
|
|
171
|
|
172 # OO-Browser too
|
|
173 echo Compiling OO-Browser...
|
12
|
174 ( cd lisp/oobr ; make EMACS=$REAL HYPB_ELC='' elc )
|
0
|
175 echo OO-Browser done.
|
|
176
|
|
177 # this is not strictly necessary but there are some special dependencies
|
|
178 echo Compiling EOS...
|
|
179 ( cd lisp/eos ; make -k EMACS=$REAL )
|
|
180 echo EOS done.
|
|
181
|
|
182 # ilisp would seem to take a little extra now as well
|
|
183 # previously this was up top, but it requires that comint.elc exists.
|
|
184
|
|
185 echo Compiling Ilisp...
|
12
|
186 ( cd lisp/ilisp ; make elc -f Makefile EMACS=$REAL )
|
0
|
187 echo Ilisp done.
|
|
188
|
|
189 #
|
|
190 # Now get the files whose .el is newer than .elc
|
|
191 #
|
|
192 echo Compiling files with out-of-date .elc...
|
12
|
193 $BYTECOMP -f batch-byte-recompile-directory lisp
|