X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=lisp%2Fupdate-elc.el;h=13524f6e084ca334f3fa9f7f0ff9f1fdd8303703;hp=bddaf12adda58330677f575d94377edff2d8e2df;hb=8ba3626da629f1b4ecafae24c85f3d0cb3bf8b8e;hpb=72a705551741d6f85a40eea486c222bac482d8dc diff --git a/lisp/update-elc.el b/lisp/update-elc.el index bddaf12..13524f6 100644 --- a/lisp/update-elc.el +++ b/lisp/update-elc.el @@ -1,8 +1,9 @@ ;;; update-elc.el --- Bytecompile out-of-date dumped files ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Copyright (C) 1996 Unknown +;; Copyright (C) 1996 Sun Microsystems, Inc. +;; Author: Ben Wing , Steven L Baur ;; Maintainer: XEmacs Development Team ;; Keywords: internal @@ -39,8 +40,7 @@ ;; (the idea here is that you can bootstrap if your .ELC files ;; are missing or badly out-of-date) -;; Currently this code gets the list of files to check passed to it from -;; src/Makefile. This must be fixed. -slb +;; See also update-elc-2.el ;;; Code: @@ -62,7 +62,8 @@ ; ;; -batch gets filtered out. ; (nthcdr 3 command-line-args)))) -(setq load-path (split-path (getenv "EMACSBOOTSTRAPLOADPATH"))) +(let ((build-root (expand-file-name ".." invocation-directory))) + (setq load-path (list (expand-file-name "lisp" build-root)))) (load "very-early-lisp" nil t) @@ -83,8 +84,16 @@ ;; (print (prin1-to-string update-elc-files-to-compile)) -(let (preloaded-file-list site-load-packages) - (load (concat default-directory "../lisp/dumped-lisp.el")) +(let (preloaded-file-list site-load-packages need-to-dump dumped-exe) + (load (expand-file-name "../lisp/dumped-lisp.el")) + + (when (featurep 'utf-2000) + (load (expand-file-name "../lisp/utf-2000/dumped-chars.el"))) + + (setq dumped-exe + (cond ((file-exists-p "../src/xemacs.exe") "../src/xemacs.exe") + ((file-exists-p "../src/xemacs") "../src/xemacs") + (t nil))) ;; Path setup (let ((package-preloaded-file-list @@ -93,40 +102,69 @@ (setq preloaded-file-list (append package-preloaded-file-list preloaded-file-list + '("bytecomp") packages-hardcoded-lisp))) (load (concat default-directory "../site-packages") t t) (setq preloaded-file-list (append packages-hardcoded-lisp preloaded-file-list - packages-useful-lisp + (if (featurep 'utf-2000) + system-char-db-source-file-list) site-load-packages)) (while preloaded-file-list (let ((arg (car preloaded-file-list))) ;; (print (prin1-to-string arg)) - (if (null (member (file-name-nondirectory arg) - packages-unbytecompiled-lisp)) + + ;; now check if .el or .elc is newer than the dumped exe. + ;; if so, need to redump. + (let ((frob + (if (string-match "\\.elc?\\'" arg) + (substring arg 0 (match-beginning 0)) + arg))) + (when (and dumped-exe + (or (and (file-exists-p + (concat "../lisp/" frob ".el")) + (file-newer-than-file-p + (concat "../lisp/" frob ".el") + dumped-exe)) + (and (file-exists-p + (concat "../lisp/" frob ".elc")) + (file-newer-than-file-p + (concat "../lisp/" frob ".elc") + dumped-exe)))) + (setq need-to-dump t))) + +; (if (null (member (file-name-nondirectory arg) +; packages-unbytecompiled-lisp)) +; (progn + (setq arg (locate-library arg)) + (if (null arg) (progn - (setq arg (locate-library arg)) - (if (null arg) - (progn - (print (format "Error: Library file %s not found" - (car preloaded-file-list))) - ;; Uncomment in case of trouble - ;;(print (format "late-packages: %S" late-packages)) - ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name))) - (kill-emacs))) - (if (string-match "\\.elc?\\'" arg) - (setq arg (substring arg 0 (match-beginning 0)))) - (if (and (null (member arg processed)) - (file-exists-p (concat arg ".el")) - (file-newer-than-file-p (concat arg ".el") - (concat arg ".elc"))) - (setq processed (cons (concat arg ".el") processed))))) - (setq preloaded-file-list (cdr preloaded-file-list))))) + (print (format "Error: Library file %s not found" + (car preloaded-file-list))) + ;; Uncomment in case of trouble + ;;(print (format "late-packages: %S" late-packages)) + ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name))) + (kill-emacs))) + (if (string-match "\\.elc?\\'" arg) + (setq arg (substring arg 0 (match-beginning 0)))) + (if (and (null (member arg processed)) + (file-exists-p (concat arg ".el")) + (file-newer-than-file-p (concat arg ".el") + (concat arg ".elc"))) + (setq processed (cons (concat arg ".el") processed))) + (setq preloaded-file-list (cdr preloaded-file-list)))) + + (if need-to-dump + (condition-case nil + (write-region-internal "foo" nil "../src/NEEDTODUMP") + (file-error nil))) + + ) (setq update-elc-files-to-compile (append update-elc-files-to-compile - processed)) + (nreverse processed))) ;; (print (prin1-to-string update-elc-files-to-compile)) @@ -139,7 +177,7 @@ update-elc-files-to-compile)) (load "loadup-el.el")) (condition-case nil - (delete-file "./NOBYTECOMPILE") + (delete-file "../src/NOBYTECOMPILE") (file-error nil))) (kill-emacs)