aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-04-05 19:13:16 -0700
committerGlenn Morris2011-04-05 19:13:16 -0700
commitc0274801eeb2f5307f4f695b7ed0c521d466f726 (patch)
tree27a9861dc307f60478c184651c405806c07ecf05
parent3f0f17000d1e4f5adca285ab28c67c1de86589f3 (diff)
downloademacs-c0274801eeb2f5307f4f695b7ed0c521d466f726.tar.gz
emacs-c0274801eeb2f5307f4f695b7ed0c521d466f726.zip
Make update_autogen handle loaddefs-like files as well.
* autogen/update_autogen: (usage): Add -l, -C. (clean, ldefs_flag, ldefs_in, ldefs_out): New variables. With -l, check status of lisp/ as well. With -C, clean before building. (autoreconf): Only pass -f in the `clean' case. (commit): New function. * lisp/Makefile.in (AUTOGEN_VCS): New variable. (autoloads): Use $AUTOGEN_VCS. * .bzrignore: Tighten up ignore patterns (for autogen/).
-rw-r--r--ChangeLog10
-rwxr-xr-xautogen/update_autogen144
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/Makefile.in20
4 files changed, 154 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index bf7a6af63b6..26fcb77121b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
12011-04-06 Glenn Morris <rgm@gnu.org>
2
3 * autogen/update_autogen: Handle loaddefs-like files as well.
4 (usage): Add -l, -C.
5 (clean, ldefs_flag, ldefs_in, ldefs_out): New variables.
6 With -l, check status of lisp/ as well.
7 With -C, clean before building.
8 (autoreconf): Only pass -f in the `clean' case.
9 (commit): New function.
10
12011-03-28 Glenn Morris <rgm@gnu.org> 112011-03-28 Glenn Morris <rgm@gnu.org>
2 12
3 * autogen/update_autogen: Pass -f to autoreconf. 13 * autogen/update_autogen: Pass -f to autoreconf.
diff --git a/autogen/update_autogen b/autogen/update_autogen
index b2a6d0b42a4..7497f33f30c 100755
--- a/autogen/update_autogen
+++ b/autogen/update_autogen
@@ -25,6 +25,9 @@
25## This is a helper script to update the pre-built generated files in 25## This is a helper script to update the pre-built generated files in
26## the autogen/ directory. This is suitable for running from cron. 26## the autogen/ directory. This is suitable for running from cron.
27## Only Emacs maintainers need use this, so it uses bash features. 27## Only Emacs maintainers need use this, so it uses bash features.
28##
29## With the -l option, it also updates the versioned loaddefs-like
30## files in lisp/. These include ldefs-boot, cl-loaddefs, rmail, etc.
28 31
29### Code: 32### Code:
30 33
@@ -48,13 +51,16 @@ cd ../
48usage () 51usage ()
49{ 52{
50 cat 1>&2 <<EOF 53 cat 1>&2 <<EOF
51Usage: ${PN} [-f] [-c] [-q] 54Usage: ${PN} [-f] [-c] [-q] [-l] [-C] [-- make-flags]
52Update the generated files in the Emacs autogen/ directory. 55Update the generated files in the Emacs autogen/ directory.
53Options: 56Options:
54-f: force an update even if the source files are locally modified. 57-f: force an update even if the source files are locally modified.
55-c: if the update succeeds and the generated files are modified, 58-c: if the update succeeds and the generated files are modified,
56 commit them (caution). 59 commit them (caution).
57-q: be quiet; only give error messages, not status messages. 60-q: be quiet; only give error messages, not status messages.
61-l: also update the versioned loaddefs-like files in lisp/.
62This requires a build. Passes any non-option args to make (eg -- -j2).
63-C: start from a clean state. Slower, but more correct.
58EOF 64EOF
59 exit 1 65 exit 1
60} 66}
@@ -65,8 +71,12 @@ EOF
65force= 71force=
66commit= 72commit=
67quiet= 73quiet=
74clean=
75ldefs_flag=
68 76
69## Parameters. 77## Parameters.
78ldefs_in=lisp/loaddefs.el
79ldefs_out=lisp/ldefs-boot.el
70sources="configure.in lib/Makefile.am" 80sources="configure.in lib/Makefile.am"
71genfiles="configure aclocal.m4 src/config.in lib/Makefile.in compile config.guess config.sub depcomp install-sh missing" 81genfiles="configure aclocal.m4 src/config.in lib/Makefile.in compile config.guess config.sub depcomp install-sh missing"
72 82
@@ -81,7 +91,7 @@ tempfile=/tmp/$PN.$$
81trap "rm -f $tempfile 2> /dev/null" EXIT 91trap "rm -f $tempfile 2> /dev/null" EXIT
82 92
83 93
84while getopts ":hcfq" option ; do 94while getopts ":hcflqC" option ; do
85 case $option in 95 case $option in
86 (h) usage ;; 96 (h) usage ;;
87 97
@@ -89,8 +99,12 @@ while getopts ":hcfq" option ; do
89 99
90 (f) force=1 ;; 100 (f) force=1 ;;
91 101
102 (l) ldefs_flag=1 ;;
103
92 (q) quiet=1 ;; 104 (q) quiet=1 ;;
93 105
106 (C) clean=1 ;;
107
94 (\?) die "Bad option -$OPTARG" ;; 108 (\?) die "Bad option -$OPTARG" ;;
95 109
96 (:) die "Option -$OPTARG requires an argument" ;; 110 (:) die "Option -$OPTARG requires an argument" ;;
@@ -101,16 +115,17 @@ done
101shift $(( --OPTIND )) 115shift $(( --OPTIND ))
102OPTIND=1 116OPTIND=1
103 117
104[ $# -eq 0 ] || die "Wrong number of arguments"
105
106 118
119## Does not work 100% because a lot of Emacs batch output comes on stderr (?).
107[ "$quiet" ] && exec 1> /dev/null 120[ "$quiet" ] && exec 1> /dev/null
108 121
109 122
110echo "Running bzr status..." 123echo "Running bzr status..."
111 124
112bzr status -S $sources >| $tempfile || die "bzr status error for sources" 125bzr status -S $sources ${ldefs_flag:+lisp} >| $tempfile || \
126 die "bzr status error for sources"
113 127
128## The lisp portion could be more permissive, eg only care about .el files.
114while read stat file; do 129while read stat file; do
115 130
116 case $stat in 131 case $stat in
@@ -124,9 +139,21 @@ while read stat file; do
124done < $tempfile 139done < $tempfile
125 140
126 141
142## Probably this is overkill, and there's no need to "bootstrap" just
143## for making autoloads.
144[ "$clean" ] && {
145
146 echo "Running 'make maintainer-clean'..."
147
148 make maintainer-clean #|| die "Cleaning error"
149
150 rm -f $ldefs_in
151}
152
153
127echo "Running autoreconf..." 154echo "Running autoreconf..."
128 155
129autoreconf -f -i -I m4 2>| $tempfile 156autoreconf ${clean:+-f} -i -I m4 2>| $tempfile
130 157
131retval=$? 158retval=$?
132 159
@@ -162,27 +189,110 @@ while read stat file; do
162done < $tempfile 189done < $tempfile
163 190
164 191
165[ "$modified" ] || { 192cd ../
166 echo "No files were modified" 193
167 exit 0 194
195## Uses global $commit.
196commit ()
197{
198 local type=$1
199 shift
200
201 [ $# -gt 0 ] || {
202 echo "No files were modified"
203 return 0
204 }
205
206 echo "Modified file(s): $@"
207
208 [ "$commit" ] || return 0
209
210 echo "Committing..."
211
212 ## bzr status output is always relative to top-level, not PWD.
213 bzr commit -m "Auto-commit of $type files." "$@" || return $?
214
215 echo "Committed files: $@"
216} # function commit
217
218
219commit "generated" $modified || die "bzr commit error"
220
221
222[ "$ldefs_flag" ] || exit 0
223
224
225echo "Finding loaddef targets..."
226
227sed -n -e '/^AUTOGEN_VCS/,/^$/ s/\\//p' lisp/Makefile.in | \
228 sed '/AUTOGEN_VCS/d' >| $tempfile || die "sed error"
229
230genfiles=
231
232while read genfile; do
233
234 [ -r lisp/$genfile ] || die "Unable to read $genfile"
235
236 genfiles="$genfiles $genfile"
237done < $tempfile
238
239
240[ "$genfiles" ] || die "Error setting genfiles"
241
242
243[ -e Makefile ] || {
244 echo "Running ./configure..."
245
246 ./configure || die "configure error"
168} 247}
169 248
170echo "Modified file(s): $modified"
171 249
172[ "$commit" ] || exit 0 250## Build the minimum needed to get the autoloads.
251echo "Running lib/ make..."
252
253make -C lib "$@" all || die "make lib error"
254
255
256echo "Running src/ make..."
257
258make -C src "$@" bootstrap-emacs || die "make src error"
259
260
261echo "Running lisp/ make..."
262
263make -C lisp "$@" autoloads EMACS=../src/bootstrap-emacs || die "make src error"
264
265
266cp $ldefs_in $ldefs_out || die "cp ldefs_boot error"
173 267
174 268
175echo "Committing..." 269cd lisp
270
271echo "Checking status of loaddef files..."
272
273## It probably would be fine to just check+commit lisp/, since
274## making autoloads should not effect any other files. But better
275## safe than sorry.
276bzr status -S $genfiles ${ldefs_out#lisp/} >| $tempfile || \
277 die "bzr status error for generated files"
278
279
280modified=
281
282while read stat file; do
283
284 [ "$stat" != "M" ] && die "Unexpected status ($stat) for generated $file"
285 modified="$modified $file"
286
287done < $tempfile
288
176 289
177## bzr status output is annoyingly always relative to top-level, not PWD.
178cd ../ 290cd ../
179 291
180bzr commit -m "Auto-commit of generated files." $modified || \
181 die "bzr commit error"
182 292
293commit "loaddefs" $modified || die "bzr commit error"
183 294
184echo "Committed files: $modified"
185 295
186exit 296exit 0
187 297
188### update_autogen ends here 298### update_autogen ends here
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 072f35e528a..856cb05cb8c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12011-04-06 Glenn Morris <rgm@gnu.org> 12011-04-06 Glenn Morris <rgm@gnu.org>
2 2
3 * Makefile.in (AUTOGEN_VCS): New variable.
4 (autoloads): Use $AUTOGEN_VCS.
5
3 * calendar/cal-move.el (calendar-scroll-toolkit-scroll): New function. 6 * calendar/cal-move.el (calendar-scroll-toolkit-scroll): New function.
4 * calendar/calendar.el (calendar-mode-map): 7 * calendar/calendar.el (calendar-mode-map):
5 Check for toolkit scroll bars. (Bug#8305) 8 Check for toolkit scroll bars. (Bug#8305)
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 083f312d613..d4ff6a4384b 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -70,6 +70,18 @@ AUTOGENEL = loaddefs.el \
70 cedet/ede/loaddefs.el \ 70 cedet/ede/loaddefs.el \
71 cedet/srecode/loaddefs.el 71 cedet/srecode/loaddefs.el
72 72
73# Versioned files that are the value of someone's `generated-autoload-file'.
74# Note that update_loaddefs parses this.
75AUTOGEN_VCS = \
76 ps-print.el \
77 emulation/tpu-edt.el \
78 emacs-lisp/cl-loaddefs.el \
79 mail/rmail.el \
80 dired.el \
81 ibuffer.el \
82 htmlfontify.el \
83 emacs-lisp/eieio.el
84
73# Value of max-lisp-eval-depth when compiling initially. 85# Value of max-lisp-eval-depth when compiling initially.
74# During bootstrapping the byte-compiler is run interpreted when compiling 86# During bootstrapping the byte-compiler is run interpreted when compiling
75# itself, and uses more stack than usual. 87# itself, and uses more stack than usual.
@@ -153,13 +165,9 @@ finder-data: doit
153 echo Directories: $$wins; \ 165 echo Directories: $$wins; \
154 $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins 166 $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins
155 167
156# The chmod +w is to handle env var CVSREAD=1. Files named 168# The chmod +w is to handle env var CVSREAD=1.
157# are identified by being the value of `generated-autoload-file'.
158autoloads: $(LOADDEFS) doit 169autoloads: $(LOADDEFS) doit
159 chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \ 170 cd $(lisp) && chmod +w $(AUTOGEN_VCS)
160 $(lisp)/emacs-lisp/cl-loaddefs.el $(lisp)/mail/rmail.el \
161 $(lisp)/dired.el $(lisp)/ibuffer.el $(lisp)/htmlfontify.el \
162 $(lisp)/emacs-lisp/eieio.el
163 cd $(lisp); $(setwins_almost); \ 171 cd $(lisp); $(setwins_almost); \
164 echo Directories: $$wins; \ 172 echo Directories: $$wins; \
165 $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins 173 $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins