Mercurial > hg > xemacs-beta
comparison lib-src/update-elc.sh @ 0:376386a54a3c r19-14
Import from CVS: tag r19-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:45:50 +0200 |
parents | |
children | ac2d302a0011 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:376386a54a3c |
---|---|
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 | |
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` | |
56 | |
57 echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`" | |
58 echo " with $REAL..." | |
59 | |
60 | |
61 tmp1=/tmp/rcl1.$$ | |
62 tmp2=/tmp/rcl2.$$ | |
63 rm -f $tmp1 $tmp2 | |
64 | |
65 # tmp1 is a list of all .el files | |
66 # tmp2 is a list of all .elc files | |
67 find lisp/. -name SCCS -prune -o -name '*.el' -print | sort > $tmp1 | |
68 find lisp/. -name SCCS -prune -o -name 'w3.elc' -prune -o -name 'vm.elc' \ | |
69 -prune -o -name '*.elc' -print | sed 's/elc$/el/' | sort > $tmp2 | |
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 | |
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... " | |
82 $REAL -batch -q -no-site-file -f batch-byte-recompile-directory lisp/bytecomp | |
83 | |
84 echo Compiling files without .elc... | |
85 | |
86 # Isn't it wonderful the number of different ways you can | |
87 # iterate over a list of files? | |
88 | |
89 # | |
90 # First compile all files which don't have a .elc version, except for these: | |
91 # | |
92 | |
93 NUMTOCOMPILE=20 # compile up to 20 files with each invocation | |
94 | |
95 comm -23 $tmp1 $tmp2 | sed ' | |
96 \!/,!d | |
97 \!/edebug/edebug-test.el$!d | |
98 \!/emulators/edt.el$!d | |
99 \!/energize/energize-load.el$!d | |
100 \!/energize/write-file.el$!d | |
101 \!/eos/!d | |
102 \!/gnus/!d | |
103 \!/ilisp/!d | |
104 \!/paths.el$!d | |
105 \!/prim/loadup.el$!d | |
106 \!/prim/loadup-el.el$!d | |
107 \!/prim/update-elc.el$!d | |
108 \!/site-start.el$!d | |
109 \!/site-load.el$!d | |
110 \!/site-init.el$!d | |
111 \!/version.el$!d | |
112 \!/sunpro/sunpro-load.el$!d | |
113 \!/tm/!d | |
114 \!/tl/!d | |
115 \!/mel/!d | |
116 \!/url/!d | |
117 \!/viper/!d | |
118 \!/vm/!d | |
119 \!/w3/!d | |
120 \!/hyperbole/!d | |
121 \!/oobr/!d | |
122 \!/ediff/!d | |
123 \!/egg/!d | |
124 \!/its/!d | |
125 \!/mule/!d | |
126 \!/quail/!d | |
127 ' | xargs -t -n$NUMTOCOMPILE $REAL -batch -q -no-site-file -f batch-byte-compile | |
128 | |
129 rm -f $tmp1 $tmp2 | |
130 echo Done. | |
131 | |
132 # vm is hard... | |
133 # | |
134 echon "Compiling VM... " | |
135 ( cd lisp/vm ; make EMACS=$REAL ) | |
136 echo done. | |
137 | |
138 if [ -d lisp/ediff ]; then | |
139 echo Compiling EDIFF... | |
140 ( cd lisp/ediff ; make EMACS=$REAL elc ) | |
141 echo EDIFF done. | |
142 fi | |
143 | |
144 if [ -d lisp/viper ]; then | |
145 echo Compiling Viper... | |
146 ( cd lisp/viper ; make EMACS=$REAL elc ) | |
147 echo Viper done. | |
148 fi | |
149 | |
150 # Gnus now has a makefile... | |
151 echo Compiling Gnus... | |
152 ( cd lisp/gnus ; make EMACS=$REAL some ) | |
153 echo Gnus done. | |
154 | |
155 # This is really part of w3. | |
156 echo Compiling URL... | |
157 ( cd lisp/url ; make EMACS=$REAL ) | |
158 echo URL done. | |
159 | |
160 # and gee w3 has its own makefile as well | |
161 # (no especial need to use it, though) | |
162 echo Compiling W3... | |
163 ( cd lisp/w3 ; make EMACS=$REAL ) | |
164 echo W3 done. | |
165 | |
166 # Hyperbole has to be different as well. What is it with these big packages? | |
167 echo Compiling Hyperbole... | |
168 ( cd lisp/hyperbole ; make EMACS=$REAL elc ) | |
169 echo Hyperbole done. | |
170 | |
171 # OO-Browser too | |
172 echo Compiling OO-Browser... | |
173 ( cd lisp/oobr ; make EMACS=$REAL HYPB_ELC= elc ) | |
174 echo OO-Browser done. | |
175 | |
176 # this is not strictly necessary but there are some special dependencies | |
177 echo Compiling EOS... | |
178 ( cd lisp/eos ; make -k EMACS=$REAL ) | |
179 echo EOS done. | |
180 | |
181 # ilisp would seem to take a little extra now as well | |
182 # previously this was up top, but it requires that comint.elc exists. | |
183 | |
184 echo Compiling Ilisp... | |
185 ( cd lisp/ilisp ; make compile -f Makefile EMACS=$REAL ) | |
186 echo Ilisp done. | |
187 | |
188 # | |
189 # Now get the files whose .el is newer than .elc | |
190 # | |
191 echo Compiling files with out-of-date .elc... | |
192 $REAL -batch -q -no-site-file -f batch-byte-recompile-directory lisp |