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