155
|
1 ;;; update-elc.el --- Bytecompile out-of-date dumped files
|
|
2
|
|
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
|
|
4 ;; Copyright (C) 1996 Unknown
|
|
5
|
|
6 ;; Maintainer: XEmacs Development Team
|
|
7 ;; Keywords: internal
|
|
8
|
0
|
9 ;; This file is part of XEmacs.
|
|
10
|
|
11 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
12 ;; under the terms of the GNU General Public License as published by
|
|
13 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
14 ;; any later version.
|
|
15
|
|
16 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
19 ;; General Public License for more details.
|
|
20
|
|
21 ;; You should have received a copy of the GNU General Public License
|
16
|
22 ;; along with XEmacs; see the file COPYING. If not, write to the
|
70
|
23 ;; Free Software Foundation, 59 Temple Place - Suite 330,
|
16
|
24 ;; Boston, MA 02111-1307, USA.
|
0
|
25
|
|
26 ;;; Synched up with: Not in FSF.
|
|
27
|
155
|
28 ;;; Commentary:
|
|
29
|
0
|
30 ;; Byte compile the .EL files necessary to dump out xemacs.
|
|
31 ;; Use this file like this:
|
|
32 ;;
|
|
33 ;; temacs -batch -l ../lisp/prim/update-elc.el $lisp
|
|
34 ;;
|
|
35 ;; where $lisp comes from the Makefile. .elc files listed in $lisp will
|
|
36 ;; cause the corresponding .el file to be compiled. .el files listed in
|
|
37 ;; $lisp will be ignored.
|
|
38 ;;
|
|
39 ;; (the idea here is that you can bootstrap if your .ELC files
|
|
40 ;; are missing or badly out-of-date)
|
|
41
|
155
|
42 ;; Currently this code gets the list of files to check passed to it from
|
|
43 ;; src/Makefile. This must be fixed. -slb
|
|
44
|
|
45 ;;; Code:
|
|
46
|
0
|
47 (setq update-elc-files-to-compile
|
|
48 (delq nil
|
|
49 (mapcar (function
|
|
50 (lambda (x)
|
|
51 (if (string-match "\.elc$" x)
|
|
52 (let ((src (substring x 0 -1)))
|
|
53 (if (file-newer-than-file-p src x)
|
|
54 (progn
|
|
55 (and (file-exists-p x)
|
|
56 (null (file-writable-p x))
|
|
57 (set-file-modes x (logior (file-modes x) 128)))
|
|
58 src))))))
|
|
59 ;; -batch gets filtered out.
|
|
60 (nthcdr 3 command-line-args))))
|
|
61
|
|
62 (if update-elc-files-to-compile
|
|
63 (progn
|
|
64 (setq command-line-args
|
|
65 (cons (car command-line-args)
|
78
|
66 (append
|
|
67 '("-l" "loadup-el.el" "run-temacs"
|
|
68 "-batch" "-q" "-no-site-file"
|
|
69 "-l" "bytecomp" "-f" "batch-byte-compile")
|
|
70 update-elc-files-to-compile)))
|
0
|
71 (load "loadup-el.el")))
|
|
72
|
|
73 (kill-emacs)
|
155
|
74
|
|
75 ;;; update-elc.el ends here
|