annotate lisp/update-elc-2.el @ 1298:1b4bc72f433e

[xemacs-hg @ 2003-02-14 12:05:06 by ben] speedups to build process autoload.el: Factor out common code in generate-{c-,}file-autoloads-1 into new function generate-autoload-ish-1. \(I was originally going to use this for custom as well but ended up thinking better of it.) cus-dep.el: Cache the old computed values in custom-load.el and reuse them as necessary, to speed up running cus-dep (which would take 25-30 seconds to do all files in lisp/*, lisp/*/* on my Pentium III 700). Use `message' not `princ' to get correct newline behavior. Output messages showing each file we do actually process. update-elc-2.el: Rewrite algorithm to be much faster -- cache calls to directory-files and don't make needless calls to file-exists-p, file-directory-p because they're way way slow. Autoload early and only when update-elc has told us to. update-elc.el: If no files need byte compilation, signal to update-elc-2 to do any necessary autoload updating (using the file REBUILD_AUTOLOADS) rather than doing it ourselves, which would be way slow. Ignore updates to custom-load.el and auto-autoloads.el when checking to see whether autoloads need updating. Optimize out many unnecessary calls to file-exists-p to speed it up somewhat. (#### The remaining time is 50% or more in locate-file; this is presumably because, even though it has a cache, it's still statting each file to determine it's actually there. By calling directory-files ourselves, building a tree, and then looking in that tree, we could drastically shorten the time needed to do the locate operation.)
author ben
date Fri, 14 Feb 2003 12:05:07 +0000
parents 465bd3c7d932
children f99d3d25df86
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
1 ;;; update-elc-2.el --- Recompile remaining .el files, post-dumping
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
2
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 by Free Software Foundation, Inc.
1261
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
4 ;; Copyright (C) 2000, 2003 Ben Wing.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
5
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
6 ;; Author: Ben Wing <ben@xemacs.org>, based on cleantree.el by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
7 ;; Steven L Baur <steve@xemacs.org>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
8 ;; Maintainer: XEmacs Development Team
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
9 ;; Keywords: internal
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
10
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
12
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
16 ;; any later version.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
17
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
21 ;; General Public License for more details.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
22
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the Free
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
25 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
26 ;; 02111-1307, USA.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
27
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
28 ;;; Synched up with: Not in FSF
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
29
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
30 ;;; Commentary:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
31
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
32 ;; This file should be used after XEmacs has been dumped, to recompile
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
33 ;; all remaining out-of-date .els and clean up orphaned .elcs. It should
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
34 ;; be called as
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
35 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
36 ;; xemacs -batch -vanilla -l update-elc-2.el -f batch-update-elc-2 ${dirname}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
37 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
38 ;; where ${dirname} is the directory tree to recompile, usually `lisp'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
39 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
40 ;; Note that this is very different from update-elc.el, which is called
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
41 ;; BEFORE dumping, handles only the files needed to dump, and is called
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
42 ;; from temacs instead of xemacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
43 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
44 ;; The original cleantree.el had the comment: This code is derived
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
45 ;; from Gnus based on a suggestion by David Moore <dmoore@ucsd.edu>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
46
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
47 ;;; Code:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
48
1261
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
49 ;; Help debug problems.
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
50 (setq stack-trace-on-error t
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
51 load-always-display-messages t)
465bd3c7d932 [xemacs-hg @ 2003-02-06 06:35:47 by ben]
ben
parents: 1232
diff changeset
52
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
53 (defvar update-elc-ignored-dirs
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
54 `("." ".." "CVS" "SCCS" "RCS" ,@(unless (featurep 'mule) '("mule"))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
55
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
56 (defvar update-elc-ignored-files
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
57 ;; note: entries here are regexps
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
58 '("^," ;; #### huh?
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
59 "^paths\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
60 "^loadup\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
61 "^loadup-el\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
62 "^update-elc\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
63 "^update-elc-2\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
64 "^dumped-lisp\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
65 "^make-docfile\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
66 "^site-start\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
67 "^site-load\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
68 "^site-init\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
69 "^version\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
70 "^very-early-lisp\\.el$"))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
71
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
72 (defvar dirfiles-table (make-hash-table :test 'equal))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
73
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
74 ;; SEEN accumulates the list of already-handled dirs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
75 (defun do-update-elc-2 (dir compile-stage-p seen)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
76 (setq dir (file-name-as-directory dir))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
77 ;; Only scan this sub-tree if we haven't been here yet.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
78 (unless (member (file-truename dir) seen)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
79 (push (file-truename dir) seen)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
80
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
81 (let ((files (or (gethash dir dirfiles-table)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
82 (directory-files dir t nil t))))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
83
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
84 ;; Do this directory.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
85 (if compile-stage-p
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
86 ;; Stage 2: Recompile necessary .els
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
87 (dolist (file files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
88 (when (string-match "\\.el$" file)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
89 (let ((file-c (concat file "c")))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
90 (when (and (not (member file-c files))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
91 ;; no need to check for out-of-date-ness because
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
92 ;; that was already done, and .elc removed.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
93 (let (ignore)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
94 (mapcar
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
95 #'(lambda (regexp)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
96 (if (string-match
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
97 regexp
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
98 (file-name-nondirectory file))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
99 (setq ignore t)))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
100 update-elc-ignored-files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
101 (not ignore)))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
102 (byte-compile-file file)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
103
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
104 ;; Stage 1.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
105 ;; Remove out-of-date elcs
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
106 (let (deleted)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
107 (dolist (file files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
108 (when (string-match "\\.el$" file)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
109 (let ((file-c (concat file "c")))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
110 (when (and (member file-c files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
111 (file-newer-than-file-p file file-c))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
112 (message "Removing out-of-date %s" file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
113 (delete-file file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
114 (push file-c deleted)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
115
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
116 ;; Remove elcs without corresponding el
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
117 (dolist (file-c files)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
118 (when (string-match "\\.elc$" file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
119 (let ((file (replace-in-string file-c "c$" "")))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
120 (when (not (member file files))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
121 (message "Removing %s; no corresponding .el" file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
122 (delete-file file-c)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
123 (push file-c deleted)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
124
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
125 (setq files (set-difference files deleted))))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
126
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
127 (puthash dir files dirfiles-table)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
128
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
129 ;; We descend recursively. On my Windows machine, it is much faster
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
130 ;; to call directory-files again to recompute than to call
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
131 ;; file-directory-p on each member of the files list.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
132 (dolist (dir (directory-files dir t nil t 'dir))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
133 (when (not (member (file-name-nondirectory dir)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
134 update-elc-ignored-dirs))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
135 (do-update-elc-2 dir compile-stage-p seen))))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
136
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
137 (defun batch-update-elc-2 ()
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
138 (defvar command-line-args-left)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
139 (unless noninteractive
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
140 (error "`batch-update-elc-2' is to be used only with -batch"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
141 (let ((dir (car command-line-args-left)))
1298
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
142 ;; don't depend on being able to autoload `update-autoload-files'!
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
143 (load "autoload")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
144 (load "bytecomp")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
145 (load "byte-optimize")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
146 ;; #### the API used here is deprecated, convert to one with explicit
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
147 ;; arguments when it is available
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
148 ;; update-elc.el signals us to rebuild the autoloads when necessary.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
149 ;; in some cases it will rebuild the autoloads itself, but doing it this
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
150 ;; way is slow, so we avoid it when possible.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
151 (when (file-exists-p "../src/REBUILD_AUTOLOADS")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
152 (let ((generated-autoload-file (expand-file-name "auto-autoloads.el" dir))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
153 (autoload-package-name "auto")) ; feature prefix
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
154 (update-autoload-files (list dir))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
155 (byte-recompile-file generated-autoload-file 0))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
156 (when (featurep 'mule)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
157 (let* ((muledir (expand-file-name "../lisp/mule" (file-truename dir)))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
158 (generated-autoload-file
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
159 (expand-file-name "auto-autoloads.el" muledir))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
160 (autoload-package-name "mule")) ; feature prefix
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
161 (update-autoload-files (list muledir))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
162 (byte-recompile-file generated-autoload-file 0))))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
163 (when (featurep 'modules)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
164 (let* ((moddir (expand-file-name "../modules" (file-truename dir)))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
165 (generated-autoload-file
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
166 (expand-file-name "auto-autoloads.el" moddir))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
167 (autoload-package-name "modules")) ; feature prefix
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
168 (update-autoload-files
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
169 (delete (concat (file-name-as-directory moddir) ".")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
170 (delete (concat (file-name-as-directory moddir) "..")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
171 (directory-files moddir t nil nil 0)))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
172 t)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
173 (byte-recompile-file generated-autoload-file 0)))
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
174 ;; now load the (perhaps newly rebuilt) autoloads; we were called with
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
175 ;; -no-autoloads so they're not already loaded.
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
176 (load "../lisp/auto-autoloads")
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
177 (when (featurep 'mule)
1b4bc72f433e [xemacs-hg @ 2003-02-14 12:05:06 by ben]
ben
parents: 1261
diff changeset
178 (load "../lisp/mule/auto-autoloads"))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
179 ;; We remove all the bad .elcs before any byte-compilation, because
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
180 ;; there may be dependencies between one .el and another (even across
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
181 ;; directories), and we don't want to load an out-of-date .elc while
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
182 ;; byte-compiling a file.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
183 (message "Removing old or spurious .elcs in directory tree `%s'..." dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
184 (do-update-elc-2 dir nil nil)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
185 (message "Removing old or spurious .elcs in directory tree `%s'...done"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
186 dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
187 (message "Recompiling updated .els in directory tree `%s'..." dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
188 (do-update-elc-2 dir t nil)
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
189 (message "Recompiling updated .els in directory tree `%s'...done" dir)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
190 ;; likewise here.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
191 (load "cus-dep")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
192 (Custom-make-dependencies dir)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
193 (byte-recompile-file (expand-file-name "custom-load.el" dir) 0)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
194 (when (featurep 'mule)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
195 (Custom-make-dependencies (expand-file-name "mule" dir))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
196 (byte-recompile-file (expand-file-name "mule/custom-load.el" dir) 0))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
197 )
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
198 (setq command-line-args-left nil))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
199
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
200 ;;; update-elc-2.el ends here