annotate lisp/prim/update-elc.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents bcdc7deadc19
children 131b0175ea99
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
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 12
diff changeset
14 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 12
diff changeset
15 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 12
diff changeset
16 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; Synched up with: Not in FSF.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; Byte compile the .EL files necessary to dump out xemacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; Use this file like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; temacs -batch -l ../lisp/prim/update-elc.el $lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; where $lisp comes from the Makefile. .elc files listed in $lisp will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; cause the corresponding .el file to be compiled. .el files listed in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; $lisp will be ignored.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; (the idea here is that you can bootstrap if your .ELC files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; are missing or badly out-of-date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (setq update-elc-files-to-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (delq nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (if (string-match "\.elc$" x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (let ((src (substring x 0 -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (if (file-newer-than-file-p src x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (and (file-exists-p x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (null (file-writable-p x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (set-file-modes x (logior (file-modes x) 128)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 src))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; -batch gets filtered out.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (nthcdr 3 command-line-args))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (if update-elc-files-to-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (setq command-line-args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (cons (car command-line-args)
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 0
diff changeset
51 (append
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 0
diff changeset
52 '("-l" "loadup-el.el" "run-temacs"
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 0
diff changeset
53 "-batch" "-q" "-no-site-file"
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 0
diff changeset
54 "-l" "bytecomp" "-f" "batch-byte-compile")
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 0
diff changeset
55 update-elc-files-to-compile)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (load "loadup-el.el")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (kill-emacs)