annotate lisp/update-elc.el @ 528:ef4d2466a29c

[xemacs-hg @ 2001-05-10 09:59:45 by ben] implement user-name-all-completions under Windows. xemacs.mak: need another lib (netapi32.lib) for user-name-all-completions. emacs.c: create new function force-debugging-signal (only when DEBUG_XEMACS) to breakpoint or abort to the debugger. mule\mule-coding.el, file-coding.c, file-coding.h, lisp.h: move coding-system-charset to lisp to avoid doc warning. autoload.el, packages.el, startup.el, update-elc-2.el, update-elc.el: Rewrite much of the bootstrapping process to be more robust, and in particular to rebuild the auto-autoloads and custom-loads files no matter what state (including missing) they're currently in. xemacs.mak: remove autoload-building target. Makefile.in.in: remove autoload targets.
author ben
date Thu, 10 May 2001 09:59:57 +0000
parents 5bdbc721d46a
children 11502791fc1c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;;; update-elc.el --- Bytecompile out-of-date dumped files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
4 ;; Copyright (C) 1996 Sun Microsystems, Inc.
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
5 ;; Copyright (C) 2001 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
7 ;; Author: Ben Wing <ben@xemacs.org>
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
8 ;; Based On: Original by Steven L Baur <steve@xemacs.org>
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 ;; Maintainer: XEmacs Development Team
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 ;; Keywords: internal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; along with XEmacs; see the file COPYING. If not, write to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 ;; Free Software Foundation, 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 ;; Boston, MA 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 ;;; Synched up with: Not in FSF.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 ;; Byte compile the .EL files necessary to dump out xemacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 ;; Use this file like this:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 ;; temacs -batch -l ../lisp/update-elc.el $lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 ;; where $lisp comes from the Makefile. .elc files listed in $lisp will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 ;; cause the corresponding .el file to be compiled. .el files listed in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 ;; $lisp will be ignored.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 ;; (the idea here is that you can bootstrap if your .ELC files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 ;; are missing or badly out-of-date)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
45 ;; See also update-elc-2.el
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 ;;; Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 (defvar processed nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 (defvar update-elc-files-to-compile nil)
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
51 (defvar need-to-rebuild-autoloads nil)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
52 (defvar need-to-rebuild-mule-autoloads nil)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
53 (defvar need-to-recompile-autoloads nil)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
54 (defvar need-to-recompile-mule-autoloads nil)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 ;(setq update-elc-files-to-compile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 ; (delq nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 ; (mapcar (function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 ; (lambda (x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 ; (if (string-match "\.elc$" x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 ; (let ((src (substring x 0 -1)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 ; (if (file-newer-than-file-p src x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 ; (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 ; (and (file-exists-p x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 ; (null (file-writable-p x))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 ; (set-file-modes x (logior (file-modes x) 128)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 ; src))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 ; ;; -batch gets filtered out.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 ; (nthcdr 3 command-line-args))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
71 (let ((build-root (expand-file-name ".." invocation-directory)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
72 (setq load-path (list (expand-file-name "lisp" build-root))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 (load "very-early-lisp" nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 (load "find-paths.el")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 (load "packages.el")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 (load "setup-paths.el")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 (load "dump-paths.el")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
81 (defun update-elc-chop-extension (file)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
82 (if (string-match "\\.elc?$" file)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
83 (substring file 0 (match-beginning 0))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
84 file))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
86 ;; we used to call packages-list-autoloads here, but it's false generality.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
87 ;; we need to handle each autoload file differently and there are only
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
88 ;; two of them.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
90 (let (preloaded-file-list site-load-packages need-to-dump dumped-exe
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
91 files-to-process)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
92
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 (load (expand-file-name "../lisp/dumped-lisp.el"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
95 (setq dumped-exe
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
96 (cond ((file-exists-p "../src/xemacs.exe") "../src/xemacs.exe")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
97 ((file-exists-p "../src/xemacs") "../src/xemacs")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
98 (t nil)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
99
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 ;; Path setup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 (let ((package-preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 (packages-collect-package-dumped-lisps late-package-load-path)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 (setq preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 (append package-preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 packages-hardcoded-lisp)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 (load (concat default-directory "../site-packages") t t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 (setq preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 (append packages-hardcoded-lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 site-load-packages))
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
114 ;; bytecomp, byte-optimize, and autoload are mentioned in
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
115 ;; packages-useful-lisp.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
116 (setq files-to-process (append packages-useful-lisp preloaded-file-list))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
117 (while files-to-process
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
118 (let* ((arg (car files-to-process))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
119 (arg-is-preloaded (member arg preloaded-file-list))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
120 (arg-sans-extension (update-elc-chop-extension arg))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
121 (full-arg (locate-library arg-sans-extension))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
122 (full-arg-sans-extension
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
123 (if (null full-arg)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
124 (progn
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
125 (print (format "Error: Library file %s not found" arg))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
126 ;; Uncomment in case of trouble
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
127 ;;(print (format "late-packages: %S" late-packages))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
128 ;;(print (format "guessed-roots: %S"
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
129 ;; (paths-find-emacs-roots
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
130 ;; invocation-directory invocation-name)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
131 (kill-emacs))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
132 (update-elc-chop-extension full-arg)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
133 (full-arg-el (concat full-arg-sans-extension ".el"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
134 (full-arg-elc (concat full-arg-sans-extension ".elc"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
135 (full-arg-dir (file-name-directory full-arg-el))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
136 (autoload-file (expand-file-name "auto-autoloads.el" full-arg-dir))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
137 (autoload-is-mule (string-match "[/\\]mule[/\\]$" full-arg-dir)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
138
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
139 ;; (print full-arg-el)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
140
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
141 ;; now check if .el or .elc is newer than the dumped exe.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
142 ;; if so, need to redump.
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
143 (when (and dumped-exe arg-is-preloaded
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
144 (or (and (file-exists-p full-arg-el)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
145 (file-newer-than-file-p full-arg-el dumped-exe))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
146 (and (file-exists-p full-arg-elc)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
147 (file-newer-than-file-p full-arg-elc dumped-exe))))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
148 (setq need-to-dump t))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
149
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
150 (when (or (not (file-exists-p autoload-file))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
151 (and (file-exists-p full-arg-el)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
152 (file-newer-than-file-p full-arg-el autoload-file)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
153 (if autoload-is-mule
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
154 (setq need-to-rebuild-mule-autoloads t)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
155 (setq need-to-rebuild-autoloads t)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
156
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
157 (if (and (not (member (file-name-nondirectory arg)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
158 packages-unbytecompiled-lisp))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
159 (not (member full-arg-el processed))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
160 (file-exists-p full-arg-el)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
161 (or (not (file-exists-p full-arg-elc))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
162 (file-newer-than-file-p full-arg-el full-arg-elc)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
163 (setq processed (cons full-arg-el processed)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
164
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
165 (setq files-to-process (cdr files-to-process))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
166
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
167 (if need-to-dump
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
168 (condition-case nil
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
169 (write-region-internal "foo" nil "../src/NEEDTODUMP")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
170 (file-error nil)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
171
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
172 )
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
174 (when (or need-to-rebuild-autoloads
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
175 (not (file-exists-p "../lisp/auto-autoloads.el"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
176 (not (file-exists-p "../lisp/auto-autoloads.elc"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
177 (file-newer-than-file-p "../lisp/auto-autoloads.el"
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
178 "../lisp/auto-autoloads.elc"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
179 (setq need-to-recompile-autoloads t))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
180
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
181 (when (or need-to-rebuild-mule-autoloads
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
182 (not (file-exists-p "../lisp/mule/auto-autoloads.el"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
183 (not (file-exists-p "../lisp/mule/auto-autoloads.elc"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
184 (file-newer-than-file-p "../lisp/mule/auto-autoloads.el"
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
185 "../lisp/mule/auto-autoloads.elc"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
186 (setq need-to-recompile-mule-autoloads t))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
187
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
188 (when (not (featurep 'mule))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
189 ;; sorry charlie.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
190 (setq need-to-rebuild-mule-autoloads nil
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
191 need-to-recompile-mule-autoloads nil))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
192
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 (setq update-elc-files-to-compile (append update-elc-files-to-compile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 processed))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
196 ;; (print update-elc-files-to-compile)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
198 (if (and (not update-elc-files-to-compile)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
199 (not need-to-rebuild-autoloads)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
200 (not need-to-rebuild-mule-autoloads)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
201 (not need-to-recompile-autoloads)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
202 (not need-to-recompile-mule-autoloads))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
203 (condition-case nil
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
204 (delete-file "../src/NOBYTECOMPILE")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
205 (file-error nil))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
206 (let* (
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
207 (bytecomp-arg (concat (update-elc-chop-extension
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
208 (locate-library "bytecomp")) ".el"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
209 (byte-opt-arg (concat (update-elc-chop-extension
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
210 (locate-library "byte-optimize")) ".el"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
211 (autoload-arg (concat (update-elc-chop-extension
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
212 (locate-library "autoload")) ".el"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
213 )
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
214 (setq inhibit-autoloads t)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
215 (setq command-line-args
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
216 (append
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
217 '("-l" "loadup-el.el" "run-temacs" "-batch" "-q" "-no-site-file")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
218 ;; if bytecomp or byte-optimize need recompiling, then load
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
219 ;; the .el version of them first, recompile them, and reload
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
220 ;; the .elc versions to recompile everything else (so we won't
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
221 ;; be waiting until the cows come home). we need to set
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
222 ;; load-ignore-elc-files because byte-optimize gets autoloaded
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
223 ;; from bytecomp.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
224 (if (or (member bytecomp-arg update-elc-files-to-compile)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
225 (member byte-opt-arg update-elc-files-to-compile))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
226 (append
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
227 '("-eval" "(setq load-ignore-elc-files t)" "-l" "bytecomp")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
228 (if (member bytecomp-arg update-elc-files-to-compile)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
229 (append '("-f" "batch-byte-compile-one-file")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
230 (list bytecomp-arg)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
231 (if (member byte-opt-arg update-elc-files-to-compile)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
232 (append '("-f" "batch-byte-compile-one-file")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
233 (list byte-opt-arg)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
234 '("-eval" "(setq load-ignore-elc-files nil)")))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
235 '("-l" "bytecomp")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
236 ;; likewise, recompile autoload.el if out-of-date.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
237 (if (member autoload-arg update-elc-files-to-compile)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
238 (append '("-f" "batch-byte-compile-one-file")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
239 (list autoload-arg)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
240 ;; then generate autoloads for lisp and maybe lisp/mule.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
241 (if (or need-to-rebuild-autoloads
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
242 need-to-rebuild-mule-autoloads)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
243 '("-l" "autoload"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
244 (if need-to-rebuild-autoloads
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
245 '("-f" "batch-force-update-one-directory" "../lisp"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
246 (if need-to-rebuild-mule-autoloads
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
247 '("-f" "batch-force-update-one-directory" "../lisp/mule"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
248 (if need-to-recompile-autoloads
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
249 '("-f" "batch-byte-compile-one-file"
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
250 "../lisp/auto-autoloads.el"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
251 (if need-to-recompile-mule-autoloads
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
252 '("-f" "batch-byte-compile-one-file"
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
253 "../lisp/mule/auto-autoloads.el"))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
254 ;; now load the autoloads and compile alles anderes.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
255 '("-eval" "(setq inhibit-autoloads nil)"
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
256 "-f" "startup-load-autoloads"
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
257 "-f" "batch-byte-compile")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
258 (delete autoload-arg
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
259 (delete byte-opt-arg
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
260 (delete bytecomp-arg
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
261 update-elc-files-to-compile))))))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 510
diff changeset
262 (load "loadup-el.el"))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 (kill-emacs)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 ;;; update-elc.el ends here