diff options
| author | Glenn Morris | 2011-04-05 19:13:16 -0700 |
|---|---|---|
| committer | Glenn Morris | 2011-04-05 19:13:16 -0700 |
| commit | c0274801eeb2f5307f4f695b7ed0c521d466f726 (patch) | |
| tree | 27a9861dc307f60478c184651c405806c07ecf05 | |
| parent | 3f0f17000d1e4f5adca285ab28c67c1de86589f3 (diff) | |
| download | emacs-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-- | ChangeLog | 10 | ||||
| -rwxr-xr-x | autogen/update_autogen | 144 | ||||
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/Makefile.in | 20 |
4 files changed, 154 insertions, 23 deletions
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-03-28 Glenn Morris <rgm@gnu.org> | 11 | 2011-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 ../ | |||
| 48 | usage () | 51 | usage () |
| 49 | { | 52 | { |
| 50 | cat 1>&2 <<EOF | 53 | cat 1>&2 <<EOF |
| 51 | Usage: ${PN} [-f] [-c] [-q] | 54 | Usage: ${PN} [-f] [-c] [-q] [-l] [-C] [-- make-flags] |
| 52 | Update the generated files in the Emacs autogen/ directory. | 55 | Update the generated files in the Emacs autogen/ directory. |
| 53 | Options: | 56 | Options: |
| 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/. | ||
| 62 | This requires a build. Passes any non-option args to make (eg -- -j2). | ||
| 63 | -C: start from a clean state. Slower, but more correct. | ||
| 58 | EOF | 64 | EOF |
| 59 | exit 1 | 65 | exit 1 |
| 60 | } | 66 | } |
| @@ -65,8 +71,12 @@ EOF | |||
| 65 | force= | 71 | force= |
| 66 | commit= | 72 | commit= |
| 67 | quiet= | 73 | quiet= |
| 74 | clean= | ||
| 75 | ldefs_flag= | ||
| 68 | 76 | ||
| 69 | ## Parameters. | 77 | ## Parameters. |
| 78 | ldefs_in=lisp/loaddefs.el | ||
| 79 | ldefs_out=lisp/ldefs-boot.el | ||
| 70 | sources="configure.in lib/Makefile.am" | 80 | sources="configure.in lib/Makefile.am" |
| 71 | genfiles="configure aclocal.m4 src/config.in lib/Makefile.in compile config.guess config.sub depcomp install-sh missing" | 81 | genfiles="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.$$ | |||
| 81 | trap "rm -f $tempfile 2> /dev/null" EXIT | 91 | trap "rm -f $tempfile 2> /dev/null" EXIT |
| 82 | 92 | ||
| 83 | 93 | ||
| 84 | while getopts ":hcfq" option ; do | 94 | while 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 | |||
| 101 | shift $(( --OPTIND )) | 115 | shift $(( --OPTIND )) |
| 102 | OPTIND=1 | 116 | OPTIND=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 | ||
| 110 | echo "Running bzr status..." | 123 | echo "Running bzr status..." |
| 111 | 124 | ||
| 112 | bzr status -S $sources >| $tempfile || die "bzr status error for sources" | 125 | bzr 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. | ||
| 114 | while read stat file; do | 129 | while read stat file; do |
| 115 | 130 | ||
| 116 | case $stat in | 131 | case $stat in |
| @@ -124,9 +139,21 @@ while read stat file; do | |||
| 124 | done < $tempfile | 139 | done < $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 | |||
| 127 | echo "Running autoreconf..." | 154 | echo "Running autoreconf..." |
| 128 | 155 | ||
| 129 | autoreconf -f -i -I m4 2>| $tempfile | 156 | autoreconf ${clean:+-f} -i -I m4 2>| $tempfile |
| 130 | 157 | ||
| 131 | retval=$? | 158 | retval=$? |
| 132 | 159 | ||
| @@ -162,27 +189,110 @@ while read stat file; do | |||
| 162 | done < $tempfile | 189 | done < $tempfile |
| 163 | 190 | ||
| 164 | 191 | ||
| 165 | [ "$modified" ] || { | 192 | cd ../ |
| 166 | echo "No files were modified" | 193 | |
| 167 | exit 0 | 194 | |
| 195 | ## Uses global $commit. | ||
| 196 | commit () | ||
| 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 | |||
| 219 | commit "generated" $modified || die "bzr commit error" | ||
| 220 | |||
| 221 | |||
| 222 | [ "$ldefs_flag" ] || exit 0 | ||
| 223 | |||
| 224 | |||
| 225 | echo "Finding loaddef targets..." | ||
| 226 | |||
| 227 | sed -n -e '/^AUTOGEN_VCS/,/^$/ s/\\//p' lisp/Makefile.in | \ | ||
| 228 | sed '/AUTOGEN_VCS/d' >| $tempfile || die "sed error" | ||
| 229 | |||
| 230 | genfiles= | ||
| 231 | |||
| 232 | while read genfile; do | ||
| 233 | |||
| 234 | [ -r lisp/$genfile ] || die "Unable to read $genfile" | ||
| 235 | |||
| 236 | genfiles="$genfiles $genfile" | ||
| 237 | done < $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 | ||
| 170 | echo "Modified file(s): $modified" | ||
| 171 | 249 | ||
| 172 | [ "$commit" ] || exit 0 | 250 | ## Build the minimum needed to get the autoloads. |
| 251 | echo "Running lib/ make..." | ||
| 252 | |||
| 253 | make -C lib "$@" all || die "make lib error" | ||
| 254 | |||
| 255 | |||
| 256 | echo "Running src/ make..." | ||
| 257 | |||
| 258 | make -C src "$@" bootstrap-emacs || die "make src error" | ||
| 259 | |||
| 260 | |||
| 261 | echo "Running lisp/ make..." | ||
| 262 | |||
| 263 | make -C lisp "$@" autoloads EMACS=../src/bootstrap-emacs || die "make src error" | ||
| 264 | |||
| 265 | |||
| 266 | cp $ldefs_in $ldefs_out || die "cp ldefs_boot error" | ||
| 173 | 267 | ||
| 174 | 268 | ||
| 175 | echo "Committing..." | 269 | cd lisp |
| 270 | |||
| 271 | echo "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. | ||
| 276 | bzr status -S $genfiles ${ldefs_out#lisp/} >| $tempfile || \ | ||
| 277 | die "bzr status error for generated files" | ||
| 278 | |||
| 279 | |||
| 280 | modified= | ||
| 281 | |||
| 282 | while read stat file; do | ||
| 283 | |||
| 284 | [ "$stat" != "M" ] && die "Unexpected status ($stat) for generated $file" | ||
| 285 | modified="$modified $file" | ||
| 286 | |||
| 287 | done < $tempfile | ||
| 288 | |||
| 176 | 289 | ||
| 177 | ## bzr status output is annoyingly always relative to top-level, not PWD. | ||
| 178 | cd ../ | 290 | cd ../ |
| 179 | 291 | ||
| 180 | bzr commit -m "Auto-commit of generated files." $modified || \ | ||
| 181 | die "bzr commit error" | ||
| 182 | 292 | ||
| 293 | commit "loaddefs" $modified || die "bzr commit error" | ||
| 183 | 294 | ||
| 184 | echo "Committed files: $modified" | ||
| 185 | 295 | ||
| 186 | exit | 296 | exit 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 @@ | |||
| 1 | 2011-04-06 Glenn Morris <rgm@gnu.org> | 1 | 2011-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. | ||
| 75 | AUTOGEN_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'. | ||
| 158 | autoloads: $(LOADDEFS) doit | 169 | autoloads: $(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 |