comparison lisp/prim/update-elc.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children bcdc7deadc19
comparison
equal deleted inserted replaced
-1:000000000000 0:376386a54a3c
1 ;; This file is part of XEmacs.
2
3 ;; XEmacs is free software; you can redistribute it and/or modify it
4 ;; under the terms of the GNU General Public License as published by
5 ;; the Free Software Foundation; either version 2, or (at your option)
6 ;; any later version.
7
8 ;; XEmacs is distributed in the hope that it will be useful, but
9 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
10 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ;; General Public License for more details.
12
13 ;; You should have received a copy of the GNU General Public License
14 ;; along with XEmacs; see the file COPYING. If not, write to the Free
15 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
16
17 ;;; Synched up with: Not in FSF.
18
19 ;; Byte compile the .EL files necessary to dump out xemacs.
20 ;; Use this file like this:
21 ;;
22 ;; temacs -batch -l ../lisp/prim/update-elc.el $lisp
23 ;;
24 ;; where $lisp comes from the Makefile. .elc files listed in $lisp will
25 ;; cause the corresponding .el file to be compiled. .el files listed in
26 ;; $lisp will be ignored.
27 ;;
28 ;; (the idea here is that you can bootstrap if your .ELC files
29 ;; are missing or badly out-of-date)
30
31 (setq update-elc-files-to-compile
32 (delq nil
33 (mapcar (function
34 (lambda (x)
35 (if (string-match "\.elc$" x)
36 (let ((src (substring x 0 -1)))
37 (if (file-newer-than-file-p src x)
38 (progn
39 (and (file-exists-p x)
40 (null (file-writable-p x))
41 (set-file-modes x (logior (file-modes x) 128)))
42 src))))))
43 ;; -batch gets filtered out.
44 (nthcdr 3 command-line-args))))
45
46 (if update-elc-files-to-compile
47 (progn
48 (setq command-line-args
49 (cons (car command-line-args)
50 (append '("-l" "loadup-el.el" "run-temacs"
51 "-batch" "-q" "-no-site-file" "-f"
52 "batch-byte-compile")
53 update-elc-files-to-compile)))
54 (load "loadup-el.el")))
55
56 (kill-emacs)