annotate lib-src/update-elc.sh @ 32:e04119814345 r19-15b99

Import from CVS: tag r19-15b99
author cvs
date Mon, 13 Aug 2007 08:52:56 +0200
parents ec9a17fef872
children d620409f5eb8
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>
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
5 # Maintainer: Steve Baur <steve@altair.xemacs.org>
0
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 # Keywords: recompile .el .elc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ### Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ## Recompile all .elc files that need recompilation. Requires a working
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ## version of 'xemacs'. Correctly handles the case where the .elc files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ## are missing; thus you can execute 'rm lisp/*/*.elc' before running
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ## this script. Run this from the parent directory of 'src', 'lisp',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ## and 'etc'. (If this is a Sun workspace, you can run it from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ## 'era-specific' instead.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 set -eu
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
19 unset MAKEFLAGS # GNU make sets MAKEFLAGS to -w; confuses non-GNU make
0
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`
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
56 BYTECOMP="$REAL -batch -q -no-site-file "
0
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
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
60 $EMACS -batch -q -no-site-file -l cleantree -f batch-remove-old-elc lisp
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
61
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
62 prune_vc="( -name SCCS -o -name RCS -o -name CVS ) -prune -o"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 tmp1=/tmp/rcl1.$$
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 tmp2=/tmp/rcl2.$$
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 rm -f $tmp1 $tmp2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 # tmp1 is a list of all .el files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 # tmp2 is a list of all .elc files
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
70 find lisp/. $prune_vc -name '*.el' -print | sort > $tmp1
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
71 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
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 echon "Deleting .elc files without .el files... "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 # (except for vm/vm.elc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 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
76 echo done.
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
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
85 # vm is hard, and must be done first ...
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
86 #
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
87 echon "Compiling VM... "
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
88 ( cd lisp/vm ; ${MAKE:-make} EMACS=$REAL autoload)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
89 echo done.
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
90
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 echo Compiling files without .elc...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 # Isn't it wonderful the number of different ways you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 # iterate over a list of files?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 #
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
97 # Second compile all files which don't have a .elc version, except for these:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 #
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 NUMTOCOMPILE=20 # compile up to 20 files with each invocation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 comm -23 $tmp1 $tmp2 | sed '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 \!/,!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 \!/edebug/edebug-test.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 \!/energize/energize-load.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 \!/energize/write-file.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 \!/eos/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 \!/gnus/!d
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
109 \!/efs/!d
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 \!/ilisp/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 \!/paths.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 \!/prim/loadup.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 \!/prim/loadup-el.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 \!/prim/update-elc.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 \!/site-start.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 \!/site-load.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 \!/site-init.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 \!/version.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 \!/sunpro/sunpro-load.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 \!/vm/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 \!/w3/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 \!/hyperbole/!d
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
123 \!/auctex/!d
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 \!/oobr/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 \!/egg/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 \!/its/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 \!/mule/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 \!/quail/!d
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
129 ' | xargs -t -n$NUMTOCOMPILE $BYTECOMP -f batch-byte-compile
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 rm -f $tmp1 $tmp2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 echo Done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 if [ -d lisp/ediff ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 echo Compiling EDIFF...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
136 ( cd lisp/ediff ; ${MAKE:-make} EMACS=$REAL elc )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 echo EDIFF done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 if [ -d lisp/viper ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 echo Compiling Viper...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
142 ( cd lisp/viper ; ${MAKE:-make} EMACS=$REAL elc )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 echo Viper done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
146 if [ -d lisp/efs ]; then
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
147 echo Compiling efs...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
148 ( cd lisp/efs ; ${MAKE:-make} EMACS=$REAL )
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
149 echo efs done.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
150 fi
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
151
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 # Gnus now has a makefile...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 echo Compiling Gnus...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
154 ( cd lisp/gnus ; ${MAKE:-make} EMACS=$REAL some )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 echo Gnus done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 # and gee w3 has its own makefile as well
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 # (no especial need to use it, though)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 echo Compiling W3...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
160 ( cd lisp/w3 ; ${MAKE:-make} EMACS=$REAL )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 echo W3 done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 # 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
164 echo Compiling Hyperbole...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
165 ( cd lisp/hyperbole ; ${MAKE:-make} EMACS=$REAL elc )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 echo Hyperbole done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 # OO-Browser too
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 echo Compiling OO-Browser...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
170 ( cd lisp/oobr ; ${MAKE:-make} EMACS=$REAL HYPB_ELC='' elc )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 echo OO-Browser done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 # this is not strictly necessary but there are some special dependencies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 echo Compiling EOS...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
175 ( cd lisp/eos ; ${MAKE:-make} -k EMACS=$REAL )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 echo EOS done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 # ilisp would seem to take a little extra now as well
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 # previously this was up top, but it requires that comint.elc exists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 echo Compiling Ilisp...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
182 ( cd lisp/ilisp ; ${MAKE:-make} elc -f Makefile EMACS=$REAL )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 echo Ilisp done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
185 # AUC TeX requires special treatment
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
186 echo Compiling AUC TeX...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
187 ( cd lisp/auctex ; ${MAKE:-make} some -f Makefile EMACS=$REAL )
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
188 echo AUC TeX done.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
189
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 #
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 # Now get the files whose .el is newer than .elc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 #
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 echo Compiling files with out-of-date .elc...
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
194 $BYTECOMP -f batch-byte-recompile-directory lisp