annotate lib-src/update-autoloads.sh @ 195:a2f645c6b9f8 r20-3b24

Import from CVS: tag r20-3b24
author cvs
date Mon, 13 Aug 2007 09:59:05 +0200
parents bfd6434d15b3
children eb5470882647
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
181
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
8 # This file is part of XEmacs.
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
9
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
10 # XEmacs is free software; you can redistribute it and/or modify it
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
11 # under the terms of the GNU General Public License as published by
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
12 # the Free Software Foundation; either version 2, or (at your option)
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
13 # any later version.
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
14
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
15 # XEmacs is distributed in the hope that it will be useful, but
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
18 # General Public License for more details.
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
19
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
20 # You should have received a copy of the GNU General Public License
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
21 # along with XEmacs; see the file COPYING. If not, write to
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
22 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
23 # Boston, MA 02111-1307, USA.
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
24
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
25 ### Commentary:
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
26
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
27 ### Code:
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
28
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 set -eu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 # This means we're running in a Sun workspace
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
32 test -d ../era-specific && cd ../editor
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 # get to the right directory
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
35 test ! -d ./lisp -a -d ../lisp && cd ..
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
36 if test ! -d ./lisp ; then
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
37 echo $0: neither ./lisp/ nor ../lisp/ exist
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
38 exit 1
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
41 EMACS="./src/xemacs"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 echo " (using $EMACS)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 export EMACS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS`
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 181
diff changeset
48 echo "Rebuilding autoloads in `pwd|sed 's|^/tmp_mnt||'`"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 echo " with $REAL..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
51 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
52 echon()
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
53 {
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
54 /bin/echo $* '\c'
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
55 }
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
56 else
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
57 echon()
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
58 {
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
59 echo -n $*
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
60 }
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
61 fi
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
62
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
63 # Compute patterns to ignore when searching for files
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 181
diff changeset
64 # These directories don't have autoloads or are partially broken.
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 181
diff changeset
65 ignore_dirs="egg eos ilisp its language locale mel mu sunpro term tooltalk"
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
66
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
67 # Prepare for autoloading directories with directory-specific instructions
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
68 make_special_commands=''
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
69 make_special () {
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
70 dir="$1"; shift;
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
71 ignore_dirs="$ignore_dirs $dir"
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
72 make_special_commands="$make_special_commands \
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
73 (cd \"lisp/$dir\" && ${MAKE:-make} EMACS=$REAL ${1+$*});"
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
74 }
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
75
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
76 # Only use Mule XEmacs to build Mule-specific autoloads & custom-loads.
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
77 echon "Checking for Mule support..."
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
78 lisp_prog='(princ (featurep (quote mule)))'
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
79 mule_p="`$EMACS -batch -no-site-file -eval \"$lisp_prog\"`"
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
80 if test "$mule_p" = nil ; then
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
81 echo No
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
82 ignore_dirs="$ignore_dirs mule leim"
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
83 else
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
84 echo Yes
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
85 fi
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
86
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
87 ## AUCTeX is a Package now
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
88 # if test "$mule_p" = nil ; then
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
89 # make_special auctex autoloads
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
90 # else
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
91 # make_special auctex autoloads MULE_EL=tex-jp.elc
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 171
diff changeset
92 # fi
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 169
diff changeset
93 #make_special cc-mode autoloads
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
94 make_special efs autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
95 #make_special eos autoloads # EOS doesn't have custom or autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
96 make_special hyperbole autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
97 # make_special ilisp autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
98 make_special oobr HYPB_ELC='' autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
99 make_special w3 autoloads
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
100
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 74
diff changeset
101 dirs=
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 151
diff changeset
102 for dir in lisp/*; do
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
103 if test -d $dir \
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
104 -a $dir != lisp/CVS \
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
105 -a $dir != lisp/SCCS; then
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
106 for ignore in $ignore_dirs; do
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
107 if test $dir = lisp/$ignore; then
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
108 continue 2
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
109 fi
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
110 done
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
111 dirs="$dirs $dir"
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
112 fi
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 74
diff changeset
113 done
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 165
diff changeset
114
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
115 # set -x
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 151
diff changeset
116 for dir in $dirs; do
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 151
diff changeset
117 $EMACS -batch -q -l autoload -f batch-update-directory $dir
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 151
diff changeset
118 done
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
119
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
120 eval "$make_special_commands"