annotate lib-src/update-autoloads.sh @ 179:9ad43877534d r20-3b16

Import from CVS: tag r20-3b16
author cvs
date Mon, 13 Aug 2007 09:52:19 +0200
parents 6075d714658b
children bfd6434d15b3
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
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
2 ### update-autoloads.sh --- update auto-autoloads.el as necessary
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
4 # Author: Jamie Zawinski, Ben Wing, Martin Buchholz, Steve Baur
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
5 # Maintainer: Steve Baur
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
6 # Keywords: internal
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
7
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
8 ### This file is part of XEmacs
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
9
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
10 ### Commentary:
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
11
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
12 ### Code:
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
13
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 set -eu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 # This means we're running in a Sun workspace
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
17 test -d ../era-specific && cd ../editor
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 # get to the right directory
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
20 test ! -d ./lisp -a -d ../lisp && cd ..
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
21 if test ! -d ./lisp ; then
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
22 echo $0: neither ./lisp/ nor ../lisp/ exist
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
23 exit 1
0
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
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
26 EMACS="./src/xemacs"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 echo " (using $EMACS)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 export EMACS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
33 echo "Rebuilding autoloads/custom-loads in `pwd|sed 's|^/tmp_mnt||'`"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 echo " with $REAL..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
36 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
37 echon()
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
38 {
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
39 /bin/echo $* '\c'
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
40 }
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
41 else
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
42 echon()
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
43 {
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
44 echo -n $*
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
45 }
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
46 fi
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
47
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
48 # Compute patterns to ignore when searching for files
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
49 # These directories don't have autoloads and customizations, or are partially
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
50 # broken.
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
51 ignore_dirs="cl egg eos ilisp its language locale mel mu sunpro term tooltalk"
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
52
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
53 # Prepare for autoloading directories with directory-specific instructions
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
54 make_special_commands=''
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
55 make_special () {
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
56 dir="$1"; shift;
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
57 ignore_dirs="$ignore_dirs $dir"
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
58 make_special_commands="$make_special_commands \
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
59 (cd \"lisp/$dir\" && ${MAKE:-make} EMACS=$REAL ${1+$*});"
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
60 }
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
61
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
62 # Only use Mule XEmacs to build Mule-specific autoloads & custom-loads.
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
63 echon "Checking for Mule support..."
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
64 lisp_prog='(princ (featurep (quote mule)))'
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
65 mule_p="`$EMACS -batch -no-site-file -eval \"$lisp_prog\"`"
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
66 if test "$mule_p" = nil ; then
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
67 echo No
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
68 ignore_dirs="$ignore_dirs mule leim"
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
69 else
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
70 echo Yes
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
71 fi
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
72
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
73 ## AUCTeX is a Package now
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
74 # if test "$mule_p" = nil ; then
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
75 # make_special auctex autoloads
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
76 # else
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
77 # make_special auctex autoloads MULE_EL=tex-jp.elc
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
78 # fi
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 169
diff changeset
79 #make_special cc-mode autoloads
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
80 make_special efs autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
81 #make_special eos autoloads # EOS doesn't have custom or autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
82 make_special hyperbole autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
83 # make_special ilisp autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
84 make_special oobr HYPB_ELC='' autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
85 make_special w3 autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
86
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 74
diff changeset
87 dirs=
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 151
diff changeset
88 for dir in lisp/*; do
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
89 if test -d $dir \
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
90 -a $dir != lisp/CVS \
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
91 -a $dir != lisp/SCCS; then
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
92 for ignore in $ignore_dirs; do
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
93 if test $dir = lisp/$ignore; then
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
94 continue 2
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
95 fi
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
96 done
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
97 dirs="$dirs $dir"
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
98 fi
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 74
diff changeset
99 done
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
100
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
101 # set -x
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 151
diff changeset
102 for dir in $dirs; do
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 151
diff changeset
103 $EMACS -batch -q -l autoload -f batch-update-directory $dir
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 151
diff changeset
104 done
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
105
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
106 eval "$make_special_commands"