annotate lib-src/update-elc.sh @ 13:13c6d0aaafe5

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