home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.004 / xemacs-1 / xemacs-19.13 / lisp / prim / update-elc.el < prev    next >
Encoding:
Text File  |  1995-03-25  |  1.8 KB  |  55 lines

  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. ;; Byte compile the .EL files necessary to dump out xemacs.
  18. ;; Use this file like this:
  19. ;;
  20. ;; temacs -batch -l ../lisp/prim/update-elc.el $lisp
  21. ;;
  22. ;; where $lisp comes from the Makefile.  .elc files listed in $lisp will
  23. ;; cause the corresponding .el file to be compiled.  .el files listed in
  24. ;; $lisp will be ignored.
  25. ;;
  26. ;; (the idea here is that you can bootstrap if your .ELC files
  27. ;; are missing or badly out-of-date)
  28.  
  29. (setq update-elc-files-to-compile
  30.       (delq nil
  31.         (mapcar (function
  32.              (lambda (x)
  33.                (if (string-match "\.elc$" x)
  34.                (let ((src (substring x 0 -1)))
  35.                  (if (file-newer-than-file-p src x)
  36.                  (progn
  37.                    (and (file-exists-p x)
  38.                     (null (file-writable-p x))
  39.                     (set-file-modes x (logior (file-modes x) 128)))
  40.                    src))))))
  41.             ;; -batch gets filtered out.
  42.             (nthcdr 3 command-line-args))))
  43.  
  44. (if update-elc-files-to-compile
  45.     (progn
  46.       (setq command-line-args
  47.         (cons (car command-line-args)
  48.           (append '("-l" "loadup-el.el" "run-temacs"
  49.                 "-batch" "-q" "-no-site-file" "-f"
  50.                 "batch-byte-compile")
  51.               update-elc-files-to-compile)))
  52.       (load "loadup-el.el")))
  53.  
  54. (kill-emacs)
  55.