annotate lisp/prim/update-elc.el @ 12:bcdc7deadc19 r19-15b7

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