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
|
34
|
18 set -e
|
0
|
19
|
|
20 # This means we're running in a Sun workspace
|
|
21 if [ -d ../era-specific ]; then
|
|
22 cd ../editor
|
|
23 fi
|
|
24
|
|
25 # get to the right directory
|
|
26 if [ ! -d ./lisp ]; then
|
|
27 if [ -d ../lisp ]; then
|
|
28 cd ..
|
|
29 else
|
|
30 echo $0: neither ./lisp/ nor ../lisp/ exist
|
|
31 exit 1
|
|
32 fi
|
|
33 fi
|
|
34
|
|
35 EMACS=${XEMACS:-./src/xemacs}
|
|
36 echo " (using $EMACS)"
|
|
37
|
|
38 export EMACS
|
|
39
|
|
40 # fuckin' sysv, man...
|
|
41 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
|
|
42 echon()
|
|
43 {
|
|
44 /bin/echo $* '\c'
|
|
45 }
|
|
46 else
|
|
47 echon()
|
|
48 {
|
|
49 echo -n $*
|
|
50 }
|
|
51 fi
|
|
52
|
|
53
|
|
54 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
|
14
|
55 BYTECOMP="$REAL -batch -q -no-site-file "
|
0
|
56 echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`"
|
|
57 echo " with $REAL..."
|
|
58
|
34
|
59 $EMACS -batch -q -l `pwd`/lisp/prim/cleantree -f batch-remove-old-elc lisp
|
30
|
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 # first recompile the byte-compiler, so that the other compiles take place
|
|
78 # with the latest version (assuming we're compiling the lisp dir of the emacs
|
|
79 # we're running, which might not be the case, but often is.)
|
|
80 #
|
|
81 echon "Checking the byte compiler... "
|
12
|
82 $BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp
|
0
|
83
|
30
|
84 # vm is hard, and must be done first ...
|
|
85 #
|
|
86 echon "Compiling VM... "
|
32
|
87 ( cd lisp/vm ; ${MAKE:-make} EMACS=$REAL autoload)
|
30
|
88 echo done.
|
|
89
|
0
|
90 echo Compiling files without .elc...
|
|
91
|
|
92 # Isn't it wonderful the number of different ways you can
|
|
93 # iterate over a list of files?
|
|
94
|
|
95 #
|
30
|
96 # Second compile all files which don't have a .elc version, except for these:
|
0
|
97 #
|
|
98
|
|
99 NUMTOCOMPILE=20 # compile up to 20 files with each invocation
|
|
100
|
|
101 comm -23 $tmp1 $tmp2 | sed '
|
|
102 \!/,!d
|
|
103 \!/edebug/edebug-test.el$!d
|
|
104 \!/energize/energize-load.el$!d
|
|
105 \!/energize/write-file.el$!d
|
|
106 \!/eos/!d
|
|
107 \!/gnus/!d
|
22
|
108 \!/efs/!d
|
0
|
109 \!/ilisp/!d
|
|
110 \!/paths.el$!d
|
|
111 \!/prim/loadup.el$!d
|
|
112 \!/prim/loadup-el.el$!d
|
|
113 \!/prim/update-elc.el$!d
|
|
114 \!/site-start.el$!d
|
|
115 \!/site-load.el$!d
|
|
116 \!/site-init.el$!d
|
|
117 \!/version.el$!d
|
|
118 \!/sunpro/sunpro-load.el$!d
|
|
119 \!/vm/!d
|
|
120 \!/w3/!d
|
|
121 \!/hyperbole/!d
|
24
|
122 \!/auctex/!d
|
0
|
123 \!/oobr/!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 if [ -d lisp/ediff ]; then
|
|
134 echo Compiling EDIFF...
|
32
|
135 ( cd lisp/ediff ; ${MAKE:-make} EMACS=$REAL elc )
|
0
|
136 echo EDIFF done.
|
|
137 fi
|
|
138
|
|
139 if [ -d lisp/viper ]; then
|
|
140 echo Compiling Viper...
|
32
|
141 ( cd lisp/viper ; ${MAKE:-make} EMACS=$REAL elc )
|
0
|
142 echo Viper done.
|
|
143 fi
|
|
144
|
22
|
145 if [ -d lisp/efs ]; then
|
|
146 echo Compiling efs...
|
32
|
147 ( cd lisp/efs ; ${MAKE:-make} EMACS=$REAL )
|
22
|
148 echo efs done.
|
|
149 fi
|
|
150
|
0
|
151 # Gnus now has a makefile...
|
|
152 echo Compiling Gnus...
|
32
|
153 ( cd lisp/gnus ; ${MAKE:-make} EMACS=$REAL some )
|
0
|
154 echo Gnus done.
|
|
155
|
|
156 # and gee w3 has its own makefile as well
|
|
157 # (no especial need to use it, though)
|
|
158 echo Compiling W3...
|
32
|
159 ( cd lisp/w3 ; ${MAKE:-make} EMACS=$REAL )
|
0
|
160 echo W3 done.
|
|
161
|
|
162 # Hyperbole has to be different as well. What is it with these big packages?
|
|
163 echo Compiling Hyperbole...
|
32
|
164 ( cd lisp/hyperbole ; ${MAKE:-make} EMACS=$REAL elc )
|
0
|
165 echo Hyperbole done.
|
|
166
|
|
167 # OO-Browser too
|
|
168 echo Compiling OO-Browser...
|
32
|
169 ( cd lisp/oobr ; ${MAKE:-make} EMACS=$REAL HYPB_ELC='' elc )
|
0
|
170 echo OO-Browser done.
|
|
171
|
|
172 # this is not strictly necessary but there are some special dependencies
|
|
173 echo Compiling EOS...
|
32
|
174 ( cd lisp/eos ; ${MAKE:-make} -k EMACS=$REAL )
|
0
|
175 echo EOS done.
|
|
176
|
|
177 # ilisp would seem to take a little extra now as well
|
|
178 # previously this was up top, but it requires that comint.elc exists.
|
|
179
|
|
180 echo Compiling Ilisp...
|
32
|
181 ( cd lisp/ilisp ; ${MAKE:-make} elc -f Makefile EMACS=$REAL )
|
0
|
182 echo Ilisp done.
|
|
183
|
24
|
184 # AUC TeX requires special treatment
|
|
185 echo Compiling AUC TeX...
|
32
|
186 ( cd lisp/auctex ; ${MAKE:-make} some -f Makefile EMACS=$REAL )
|
24
|
187 echo AUC TeX done.
|