annotate lisp/update-elc.el @ 510:5bdbc721d46a

[xemacs-hg @ 2001-05-06 08:33:35 by ben] implement printing the selection when it's selected. force redisplay when set-charset-ccl-program called. if bytecomp or byte-optimize need recompiling, then load the .el version of them first, recompile them, and reload the .elc versions to recompile everything else (so we won't be waiting until the cows come home).
author ben
date Sun, 06 May 2001 08:33:41 +0000
parents abe6d1db359e
children ef4d2466a29c
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.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
6 ;; Author: Ben Wing <ben@xemacs.org>, Steven L Baur <steve@xemacs.org>
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 ;; Maintainer: XEmacs Development Team
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; Keywords: internal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
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 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ;; Free Software Foundation, 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; Boston, MA 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 ;;; Synched up with: Not in FSF.
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 ;;; Commentary:
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 ;; Byte compile the .EL files necessary to dump out xemacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 ;; Use this file like this:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 ;; temacs -batch -l ../lisp/update-elc.el $lisp
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 ;; where $lisp comes from the Makefile. .elc files listed in $lisp will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 ;; cause the corresponding .el file to be compiled. .el files listed in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 ;; $lisp will be ignored.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 ;; (the idea here is that you can bootstrap if your .ELC files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 ;; are missing or badly out-of-date)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
43 ;; See also update-elc-2.el
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 ;;; Code:
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 (defvar processed nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 (defvar update-elc-files-to-compile nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 ;(setq update-elc-files-to-compile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 ; (delq nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 ; (mapcar (function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 ; (lambda (x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 ; (if (string-match "\.elc$" x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 ; (let ((src (substring x 0 -1)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 ; (if (file-newer-than-file-p src x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 ; (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 ; (and (file-exists-p x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 ; (null (file-writable-p x))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 ; (set-file-modes x (logior (file-modes x) 128)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 ; src))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 ; ;; -batch gets filtered out.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 ; (nthcdr 3 command-line-args))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
65 (let ((build-root (expand-file-name ".." invocation-directory)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
66 (setq load-path (list (expand-file-name "lisp" build-root))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 (load "very-early-lisp" nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 (load "find-paths.el")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 (load "packages.el")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 (load "setup-paths.el")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 (load "dump-paths.el")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 (let ((autol (packages-list-autoloads (concat default-directory "../lisp"))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 ;; (print (prin1-to-string autol))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 (while autol
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 (let ((src (car autol)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 (if (and (file-exists-p src)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 (file-newer-than-file-p src (concat src "c")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 (setq update-elc-files-to-compile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 (cons src update-elc-files-to-compile))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 (setq autol (cdr autol))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 ;; (print (prin1-to-string update-elc-files-to-compile))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
87 (let (preloaded-file-list site-load-packages need-to-dump dumped-exe)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 (load (expand-file-name "../lisp/dumped-lisp.el"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
90 (setq dumped-exe
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
91 (cond ((file-exists-p "../src/xemacs.exe") "../src/xemacs.exe")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
92 ((file-exists-p "../src/xemacs") "../src/xemacs")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
93 (t nil)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
94
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 ;; Path setup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 (let ((package-preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 (packages-collect-package-dumped-lisps late-package-load-path)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 (setq preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 (append package-preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 preloaded-file-list
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
102 '("bytecomp" "byte-optimize")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 packages-hardcoded-lisp)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 (load (concat default-directory "../site-packages") t t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 (setq preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 (append packages-hardcoded-lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 packages-useful-lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 site-load-packages))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 (while preloaded-file-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 (let ((arg (car preloaded-file-list)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 ;; (print (prin1-to-string arg))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
114
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
115 ;; 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
116 ;; if so, need to redump.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
117 (let ((frob
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
118 (if (string-match "\\.elc?\\'" arg)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
119 (substring arg 0 (match-beginning 0))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
120 arg)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
121 (when (and dumped-exe
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
122 (or (and (file-exists-p
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
123 (concat "../lisp/" frob ".el"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
124 (file-newer-than-file-p
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
125 (concat "../lisp/" frob ".el")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
126 dumped-exe))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
127 (and (file-exists-p
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
128 (concat "../lisp/" frob ".elc"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
129 (file-newer-than-file-p
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
130 (concat "../lisp/" frob ".elc")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
131 dumped-exe))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
132 (setq need-to-dump t)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
133
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 (if (null (member (file-name-nondirectory arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 packages-unbytecompiled-lisp))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 (setq arg (locate-library arg))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 (if (null arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 (print (format "Error: Library file %s not found"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 (car preloaded-file-list)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 ;; Uncomment in case of trouble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 ;;(print (format "late-packages: %S" late-packages))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 (kill-emacs)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 (if (string-match "\\.elc?\\'" arg)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 (setq arg (substring arg 0 (match-beginning 0))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 (if (and (null (member arg processed))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 (file-exists-p (concat arg ".el"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 (file-newer-than-file-p (concat arg ".el")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 (concat arg ".elc")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 (setq processed (cons (concat arg ".el") processed)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
153 (setq preloaded-file-list (cdr preloaded-file-list))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
154
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
155 (if need-to-dump
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
156 (condition-case nil
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
157 (write-region-internal "foo" nil "../src/NEEDTODUMP")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
158 (file-error nil)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
159
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
160 )
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 (setq update-elc-files-to-compile (append update-elc-files-to-compile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 processed))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 ;; (print (prin1-to-string update-elc-files-to-compile))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 (if update-elc-files-to-compile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 (progn
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
169 (let ((bytecomp-arg (locate-library "bytecomp"))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
170 (byte-opt-arg (locate-library "byte-optimize")))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
171 (if (string-match "\\.elc?\\'" bytecomp-arg)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
172 (setq bytecomp-arg (substring bytecomp-arg 0
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
173 (match-beginning 0))))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
174 (setq bytecomp-arg (concat bytecomp-arg ".el"))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
175 (if (string-match "\\.elc?\\'" byte-opt-arg)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
176 (setq byte-opt-arg (substring byte-opt-arg 0
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
177 (match-beginning 0))))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
178 (setq byte-opt-arg (concat byte-opt-arg ".el"))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
179 ;; if bytecomp or byte-optimize need recompiling, then load
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
180 ;; the .el version of them first, recompile them, and reload
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
181 ;; the .elc versions to recompile everything else (so we won't
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
182 ;; be waiting until the cows come home).
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
183 (setq command-line-args
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
184 (append '("-l" "loadup-el.el" "run-temacs"
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
185 "-batch" "-q" "-no-site-file")
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
186 (if (or
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
187 (member bytecomp-arg update-elc-files-to-compile)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
188 (member byte-opt-arg update-elc-files-to-compile))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
189 (append
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
190 '("-eval" "(setq load-ignore-elc-files t)"
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
191 "-l" "bytecomp")
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
192 (if (member bytecomp-arg
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
193 update-elc-files-to-compile)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
194 (append '("-f" "batch-byte-compile-one-file")
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
195 (list bytecomp-arg)))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
196 (if (member byte-opt-arg
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
197 update-elc-files-to-compile)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
198 (append '("-f" "batch-byte-compile-one-file")
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
199 (list byte-opt-arg)))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
200 '("-eval" "(setq load-ignore-elc-files nil)")))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
201 '("-l" "bytecomp" "-f" "batch-byte-compile")
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
202 (delete byte-opt-arg
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
203 (delete bytecomp-arg
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 442
diff changeset
204 update-elc-files-to-compile)))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 (load "loadup-el.el"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 (condition-case nil
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
207 (delete-file "../src/NOBYTECOMPILE")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 (file-error nil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 (kill-emacs)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 ;;; update-elc.el ends here