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