annotate lib-src/update-elc.sh @ 54:05472e90ae02 r19-16-pre2

Import from CVS: tag r19-16-pre2
author cvs
date Mon, 13 Aug 2007 08:57:55 +0200
parents 1a767b41a199
children 131b0175ea99
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
34
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
18 set -e
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 # This means we're running in a Sun workspace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 if [ -d ../era-specific ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 cd ../editor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 # get to the right directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 if [ ! -d ./lisp ]; then
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 cd ..
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 echo $0: neither ./lisp/ nor ../lisp/ exist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 exit 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 fi
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
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 34
diff changeset
35 EMACS="./src/xemacs"
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 34
diff changeset
36 export EMACS
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 34
diff changeset
37
0
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 # fuckin' sysv, man...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 echon()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 /bin/echo $* '\c'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 echon()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 echo -n $*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
54 BYTECOMP="$REAL -batch -q -no-site-file "
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 echo " with $REAL..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
34
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
58 $EMACS -batch -q -l `pwd`/lisp/prim/cleantree -f batch-remove-old-elc lisp
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
59
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
60 prune_vc="( -name SCCS -o -name RCS -o -name CVS ) -prune -o"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 tmp1=/tmp/rcl1.$$
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 tmp2=/tmp/rcl2.$$
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 rm -f $tmp1 $tmp2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 # tmp1 is a list of all .el files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 # tmp2 is a list of all .elc files
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
68 find lisp/. $prune_vc -name '*.el' -print | sort > $tmp1
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
69 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
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 # first recompile the byte-compiler, so that the other compiles take place
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 # 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
78 # we're running, which might not be the case, but often is.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 #
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 echon "Checking the byte compiler... "
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
81 $BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
83 # vm is hard, and must be done first ...
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
84 #
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
85 echon "Compiling VM... "
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
86 ( cd lisp/vm ; ${MAKE:-make} EMACS=$REAL autoload)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
87 echo done.
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
88
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 echo Compiling files without .elc...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 # Isn't it wonderful the number of different ways you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 # iterate over a list of files?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 #
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 26
diff changeset
95 # 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
96 #
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 NUMTOCOMPILE=20 # compile up to 20 files with each invocation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 comm -23 $tmp1 $tmp2 | sed '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 \!/,!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 \!/edebug/edebug-test.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 \!/energize/energize-load.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 \!/energize/write-file.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 \!/eos/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 \!/gnus/!d
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
107 \!/efs/!d
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 \!/ilisp/!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 \!/paths.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 \!/prim/loadup.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 \!/prim/loadup-el.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 \!/prim/update-elc.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 \!/site-start.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 \!/site-load.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 \!/site-init.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 \!/version.el$!d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 \!/sunpro/sunpro-load.el$!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
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
121 \!/auctex/!d
0
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 \!/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
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
127 ' | xargs -t -n$NUMTOCOMPILE $BYTECOMP -f batch-byte-compile
0
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 if [ -d lisp/ediff ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 echo Compiling EDIFF...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
134 ( cd lisp/ediff ; ${MAKE:-make} EMACS=$REAL elc )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 echo EDIFF done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 fi
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/viper ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 echo Compiling Viper...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
140 ( cd lisp/viper ; ${MAKE:-make} EMACS=$REAL elc )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 echo Viper 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
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
144 if [ -d lisp/efs ]; then
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
145 echo Compiling efs...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
146 ( cd lisp/efs ; ${MAKE:-make} EMACS=$REAL )
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
147 echo efs done.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
148 fi
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
149
0
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...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
152 ( cd lisp/gnus ; ${MAKE:-make} EMACS=$REAL some )
0
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 # and gee w3 has its own makefile as well
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 # (no especial need to use it, though)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 echo Compiling W3...
38
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
158 ( cd lisp/w3 ; ${MAKE:-make} EMACS=$REAL xemacs-w3 )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 echo W3 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 # 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
162 echo Compiling Hyperbole...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
163 ( cd lisp/hyperbole ; ${MAKE:-make} EMACS=$REAL elc )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 echo Hyperbole 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 # OO-Browser too
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 echo Compiling OO-Browser...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
168 ( cd lisp/oobr ; ${MAKE:-make} EMACS=$REAL HYPB_ELC='' elc )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 echo OO-Browser 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 # this is not strictly necessary but there are some special dependencies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 echo Compiling EOS...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
173 ( cd lisp/eos ; ${MAKE:-make} -k EMACS=$REAL )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 echo EOS 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 # ilisp would seem to take a little extra now as well
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 # previously this was up top, but it requires that comint.elc exists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 echo Compiling Ilisp...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
180 ( cd lisp/ilisp ; ${MAKE:-make} elc -f Makefile EMACS=$REAL )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 echo Ilisp done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
183 # AUC TeX requires special treatment
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
184 echo Compiling AUC TeX...
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
185 ( cd lisp/auctex ; ${MAKE:-make} some -f Makefile EMACS=$REAL )
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
186 echo AUC TeX done.