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
|
36
|
35 EMACS="./src/xemacs"
|
|
36 export EMACS
|
|
37
|
0
|
38 echo " (using $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 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
|
14
|
54 BYTECOMP="$REAL -batch -q -no-site-file "
|
0
|
55 echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`"
|
|
56 echo " with $REAL..."
|
|
57
|
34
|
58 $EMACS -batch -q -l `pwd`/lisp/prim/cleantree -f batch-remove-old-elc lisp
|
30
|
59
|
12
|
60 prune_vc="( -name SCCS -o -name RCS -o -name CVS ) -prune -o"
|
0
|
61
|
|
62 tmp1=/tmp/rcl1.$$
|
|
63 tmp2=/tmp/rcl2.$$
|
|
64 rm -f $tmp1 $tmp2
|
|
65
|
|
66 # tmp1 is a list of all .el files
|
|
67 # tmp2 is a list of all .elc files
|
12
|
68 find lisp/. $prune_vc -name '*.el' -print | sort > $tmp1
|
|
69 find lisp/. $prune_vc -name '*.elc' -print | sed 's/elc$/el/' | sort > $tmp2
|
0
|
70
|
|
71 echon "Deleting .elc files without .el files... "
|
|
72 # (except for vm/vm.elc)
|
|
73 comm -13 $tmp1 $tmp2 | sed 's/\(.*\)\.el$/echo \1.elc ; rm \1.elc/' | sh
|
|
74 echo done.
|
|
75
|
|
76 # first recompile the byte-compiler, so that the other compiles take place
|
|
77 # with the latest version (assuming we're compiling the lisp dir of the emacs
|
|
78 # we're running, which might not be the case, but often is.)
|
|
79 #
|
|
80 echon "Checking the byte compiler... "
|
12
|
81 $BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp
|
0
|
82
|
30
|
83 # vm is hard, and must be done first ...
|
|
84 #
|
|
85 echon "Compiling VM... "
|
32
|
86 ( cd lisp/vm ; ${MAKE:-make} EMACS=$REAL autoload)
|
30
|
87 echo done.
|
|
88
|
0
|
89 echo Compiling files without .elc...
|
|
90
|
|
91 # Isn't it wonderful the number of different ways you can
|
|
92 # iterate over a list of files?
|
|
93
|
|
94 #
|
30
|
95 # Second compile all files which don't have a .elc version, except for these:
|
0
|
96 #
|
|
97
|
|
98 NUMTOCOMPILE=20 # compile up to 20 files with each invocation
|
|
99
|
|
100 comm -23 $tmp1 $tmp2 | sed '
|
|
101 \!/,!d
|
|
102 \!/edebug/edebug-test.el$!d
|
|
103 \!/energize/energize-load.el$!d
|
|
104 \!/energize/write-file.el$!d
|
|
105 \!/eos/!d
|
|
106 \!/gnus/!d
|
22
|
107 \!/efs/!d
|
0
|
108 \!/ilisp/!d
|
|
109 \!/paths.el$!d
|
|
110 \!/prim/loadup.el$!d
|
|
111 \!/prim/loadup-el.el$!d
|
|
112 \!/prim/update-elc.el$!d
|
|
113 \!/site-start.el$!d
|
|
114 \!/site-load.el$!d
|
|
115 \!/site-init.el$!d
|
|
116 \!/version.el$!d
|
|
117 \!/sunpro/sunpro-load.el$!d
|
|
118 \!/vm/!d
|
|
119 \!/w3/!d
|
|
120 \!/hyperbole/!d
|
24
|
121 \!/auctex/!d
|
0
|
122 \!/oobr/!d
|
|
123 \!/egg/!d
|
|
124 \!/its/!d
|
|
125 \!/mule/!d
|
|
126 \!/quail/!d
|
12
|
127 ' | xargs -t -n$NUMTOCOMPILE $BYTECOMP -f batch-byte-compile
|
0
|
128
|
|
129 rm -f $tmp1 $tmp2
|
|
130 echo Done.
|
|
131
|
|
132 if [ -d lisp/ediff ]; then
|
|
133 echo Compiling EDIFF...
|
32
|
134 ( cd lisp/ediff ; ${MAKE:-make} EMACS=$REAL elc )
|
0
|
135 echo EDIFF done.
|
|
136 fi
|
|
137
|
|
138 if [ -d lisp/viper ]; then
|
|
139 echo Compiling Viper...
|
32
|
140 ( cd lisp/viper ; ${MAKE:-make} EMACS=$REAL elc )
|
0
|
141 echo Viper done.
|
|
142 fi
|
|
143
|
22
|
144 if [ -d lisp/efs ]; then
|
|
145 echo Compiling efs...
|
32
|
146 ( cd lisp/efs ; ${MAKE:-make} EMACS=$REAL )
|
22
|
147 echo efs done.
|
|
148 fi
|
|
149
|
0
|
150 # Gnus now has a makefile...
|
|
151 echo Compiling Gnus...
|
32
|
152 ( cd lisp/gnus ; ${MAKE:-make} EMACS=$REAL some )
|
0
|
153 echo Gnus done.
|
|
154
|
|
155 # and gee w3 has its own makefile as well
|
|
156 # (no especial need to use it, though)
|
|
157 echo Compiling W3...
|
38
|
158 ( cd lisp/w3 ; ${MAKE:-make} EMACS=$REAL xemacs-w3 )
|
0
|
159 echo W3 done.
|
|
160
|
|
161 # Hyperbole has to be different as well. What is it with these big packages?
|
|
162 echo Compiling Hyperbole...
|
32
|
163 ( cd lisp/hyperbole ; ${MAKE:-make} EMACS=$REAL elc )
|
0
|
164 echo Hyperbole done.
|
|
165
|
|
166 # OO-Browser too
|
|
167 echo Compiling OO-Browser...
|
32
|
168 ( cd lisp/oobr ; ${MAKE:-make} EMACS=$REAL HYPB_ELC='' elc )
|
0
|
169 echo OO-Browser done.
|
|
170
|
|
171 # this is not strictly necessary but there are some special dependencies
|
|
172 echo Compiling EOS...
|
32
|
173 ( cd lisp/eos ; ${MAKE:-make} -k EMACS=$REAL )
|
0
|
174 echo EOS done.
|
|
175
|
|
176 # ilisp would seem to take a little extra now as well
|
|
177 # previously this was up top, but it requires that comint.elc exists.
|
|
178
|
|
179 echo Compiling Ilisp...
|
32
|
180 ( cd lisp/ilisp ; ${MAKE:-make} elc -f Makefile EMACS=$REAL )
|
0
|
181 echo Ilisp done.
|
|
182
|
24
|
183 # AUC TeX requires special treatment
|
|
184 echo Compiling AUC TeX...
|
32
|
185 ( cd lisp/auctex ; ${MAKE:-make} some -f Makefile EMACS=$REAL )
|
24
|
186 echo AUC TeX done.
|