diff lisp/update-elc.el @ 1330:4542b72c005e

[xemacs-hg @ 2003-03-01 07:25:26 by ben] build patch Makefile.in.in: Move src deletions to src/Makefile.in.in. dump-paths.el, dumped-lisp.el: Delete. Combine stuff into setup-paths.el. find-paths.el: Removed. Make this file contain generic routines only. Move stuff to compute Emacs roots to setup-paths.el. startup.el: Removed. Move these variables into setup-paths.el. setup-paths.el, startup.el: Removed. Combine all high-level code for computing the paths into setup-paths.el. Create new function startup-find-load-path to encapsulate all logic for computing `load-path'. Eliminate invocation-directory and invocation-name parameters since there is no point (false generality) -- the code references other globals, which cannot be specified. Eliminate some code duplicated between setup-paths.el and startup.el. Clean up the debug-paths code and output load-path in addition. Add logic to paths-emacs-root-p to support separated source and build trees. loadup.el, make-docfile.el, update-elc-2.el, update-elc.el: Rewrite to allow for separated source and build trees, as may occur in MS Windows. NOTE TO BUILD HACKERS: loadup.el, make-docfile.el, update-elc.el and update-elc-2.el made two assumptions that are no longer correct: (1) The source and build trees are in the same place. (2) They can make assumptions about where `.' is. These files now compute the locations of the source and build roots at the top of the file. *ALL* constant file names or path snippets must now be made absolute using expand-file-name and one of these roots. dumped-lisp.el, packages.el: Removed. Remove some unused lists of Lisp files. packages-hardcoded-lisp (empty, in any case) moved to dumped-lisp.el. startup.el: When a compiled init file is out-of-date wrt the uncompiled version, load the uncompiled version and issue a nasty warning. update-elc-2.el: Force touching of auto-autoloads files when REBUILD_AUTOLOADS was set. update-elc.el: Fix code that checks whether dumping is necessary to check against xemacs.dmp, not xemacs.exe, when Unix and pdump. lwlib-Xm.c: Fix compile warning. README, config.inc.samp, xemacs.mak: -- Major reorganization and cleanup. -- Add support for separated build tree and source tree. -- Delete all support for X Windows building, since it's totally bit-rotten and will never be fixed up. Instruct people to use Cygwin if they want such support. make-build-dir: New script to create a skeleton build tree for use with separated build and source tree compilation. m/acorn.h, m/alliant-2800.h, m/alliant.h, m/altos.h, m/amdahl.h, m/arm.h, m/att3b.h, m/aviion.h, m/clipper.h, m/cnvrgnt.h, m/convex.h, m/cydra5.h, m/delta.h, m/delta88k.h, m/dpx2.h, m/elxsi.h, m/ews4800r.h, m/gould.h, m/hp800.h, m/hp9000s300.h, m/i860.h, m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/ibmrt.h, m/intel386.h, m/iris4d.h, m/iris5d.h, m/iris6d.h, m/irist.h, m/m68k.h, m/masscomp.h, m/mg1.h, m/mips-nec.h, m/mips-siemens.h, m/mips.h, m/nh3000.h, m/nh4000.h, m/ns32000.h, m/plexus.h, m/powerpc.h, m/sequent-ptx.h, m/sequent.h, m/sgi-challenge.h, m/stride.h, m/tad68k.h, m/targon31.h, m/tekxd88.h, m/template.h, m/tower32.h, m/tower32v3.h, m/ustation.h, m/wicat.h, m/xps100.h, data.c, doc.c, editfns.c, emacs.c, lrecord.h, ntheap.c, process-unix.c, sysdep.c, unexec.c: Delete all support for bit-rotten CANNOT_DUMP. Just use pdump. Makefile.in.in: Lots o' cleanup. Use names like LISP, SRC instead of lispdir, srcdir, for consistency with xemacs.mak and the conventions in the rest of the file. Eliminate use of ${...} in favor of $(...), to make it easier to move code between this file and xemacs.mak. Fix dependency handling wrt NEEDTODUMP to eliminate problems some people (e.g. Vin) have been seeing with non-GNU makes. Write a long section about the subtle but oh-so-important differences in dependency processing between nmake, make, and GNU make. Add unicode-encapsulate target, from xemacs.mak. chartab.c, lrecord.h: Fix crash due to attempt to free objects across dump/undump.
author ben
date Sat, 01 Mar 2003 07:25:56 +0000
parents 70921960b980
children ecf1ebac70d8
line wrap: on
line diff
--- a/lisp/update-elc.el	Fri Feb 28 22:52:30 2003 +0000
+++ b/lisp/update-elc.el	Sat Mar 01 07:25:56 2003 +0000
@@ -58,10 +58,10 @@
 (defvar need-to-rebuild-mule-autoloads nil)
 (defvar need-to-recompile-autoloads nil)
 (defvar need-to-recompile-mule-autoloads nil)
-(defvar undumped-exe nil)
-;(defvar dumped-exe nil)
-(defvar dumped-exe-out-of-date-wrt-dump-files nil)
-;(defvar dumped-exe-out-of-date-wrt-undumped-exe nil)
+(defvar exe-target nil)
+(defvar dump-target nil)
+(defvar dump-target-out-of-date-wrt-dump-files nil)
+;(defvar dump-target-out-of-date-wrt-exe-target nil)
 
 ;(setq update-elc-files-to-compile
 ;      (delq nil
@@ -78,13 +78,22 @@
 ;		    ;; -batch gets filtered out.
 ;		    (nthcdr 3 command-line-args))))
 
-(let ((build-root (expand-file-name ".." invocation-directory)))
-  (setq load-path (list (expand-file-name "lisp" build-root))))
+
+(defvar build-root (expand-file-name ".." invocation-directory))
+(defvar source-lisp (file-name-directory (expand-file-name
+					  (nth 2 command-line-args))))
+(defvar source-lisp-mule (expand-file-name "mule" source-lisp))
+(defvar source-root (expand-file-name ".." source-lisp))
+(defvar aa-lisp (expand-file-name "auto-autoloads.el" source-lisp))
+(defvar aac-lisp (expand-file-name "auto-autoloads.elc" source-lisp))
+(defvar aa-lisp-mule (expand-file-name "auto-autoloads.el" source-lisp-mule))
+(defvar aac-lisp-mule (expand-file-name "auto-autoloads.elc" source-lisp-mule))
+
+(setq load-path (list source-lisp))
 
 (load "find-paths.el")
 (load "packages.el")
 (load "setup-paths.el")
-(load "dump-paths.el") ;; #### take out in my fixup ws
 
 ;; Lisp files loaded in order to byte compile anything.  If any are out of
 ;; date, we need to load them as .el's, byte compile them, and reload as
@@ -126,38 +135,39 @@
 
 (let (preloaded-file-list site-load-packages files-to-process)
   
-  (load (expand-file-name "../lisp/dumped-lisp.el"))
-
-  (setq dumped-exe
-	(cond ((file-exists-p "../src/xemacs.exe") "../src/xemacs.exe")
-	      ((file-exists-p "../src/xemacs") "../src/xemacs")
-	      (t nil)))
+  (load (expand-file-name "dumped-lisp.el" source-lisp))
 
-  ;; Not currently used but might be at some point.
-;   (let ((temacs-exe
-; 	 (cond ((file-exists-p "../src/temacs.exe") "../src/temacs.exe")
-; 	       ((file-exists-p "../src/temacs") "../src/temacs")
-; 	       (t nil)))
-; 	(data-file
-; 	 (cond ((file-exists-p "../src/xemacs.dmp") "../src/xemacs.dmp")
-; 	       (t nil))))
+  ;; two setups here:
+  ;; (1) temacs.exe is undumped, dumped into xemacs.exe.  Happens with
+  ;;     unexec, but also with pdump under MS Windows native, since
+  ;;     the dumped data is stored as a resource in the xemacs.exe
+  ;;     executable.
+  ;; (2) xemacs.exe is dumped or undumped.  Running `xemacs -nd' gets
+  ;;     you the equivalent of `temacs'.  Dumping creates a file
+  ;;     `xemacs.dmp'.
 
-;     ;; two setups here:
-;     ;; (1) temacs.exe is undumped, dumped into xemacs.exe.  Happens with
-;     ;;     unexec, but also with pdump under MS Windows native, since
-;     ;;     the dumped data is stored as a resource in the xemacs.exe
-;     ;;     executable.
-;     ;; (2) xemacs.exe is dumped or undumped.  Running `xemacs -nd' gets
-;     ;;     you the equivalent of `temacs'.  Dumping creates a file
-;     ;;     `xemacs.dmp'.
+  (cond ((eq system-type 'windows-nt)
+	 (setq exe-target "src/temacs.exe"
+	       dump-target "src/xemacs.exe"))
+	;; #### need better ways of getting config params
+	((not (memq 'pdump (emacs-run-status)))
+	 (setq exe-target "src/temacs"
+	       dump-target "src/xemacs"))
+	(t
+	 (setq exe-target "src/xemacs"
+	       dump-target "src/xemacs.dmp")))
 
-;     (setq dumped-exe-out-of-date-wrt-undumped-exe
-; 	  (cond ((not dumped-exe) t)
-; 		(temacs-exe (file-newer-than-file-p temacs-exe dumped-exe))
-; 		((not data-file) t)
-; 		(t (file-newer-than-file-p dumped-exe data-file))))
-;     (setq dumped-exe-exists (or (and temacs-exe dumped-exe)
-; 				(and data-file dumped-exe))))
+  (setq exe-target (expand-file-name exe-target build-root))
+  (setq dump-target (expand-file-name dump-target build-root))
+
+  ;; Not currently used.
+;   (setq dump-target-out-of-date-wrt-exe-target
+; 	(cond ((not dump-target) t)
+; 	      (temacs-exe (file-newer-than-file-p temacs-exe dump-target))
+; 	      ((not data-file) t)
+; 	      (t (file-newer-than-file-p dump-target data-file))))
+;   (setq dump-target-exists (or (and temacs-exe dump-target)
+; 			       (and data-file dump-target))))
 
   ;; Path setup
   (let ((package-preloaded-file-list
@@ -168,7 +178,7 @@
  		  preloaded-file-list
  		  packages-hardcoded-lisp)))
 
-  (load (concat default-directory "../site-packages") t t)
+  (load (expand-file-name "site-packages" source-root) t t)
   (setq preloaded-file-list
 	(append packages-hardcoded-lisp
 		preloaded-file-list
@@ -203,12 +213,12 @@
 
       ;; now check if .el or .elc is newer than the dumped exe.
       ;; if so, need to redump.
-      (when (and dumped-exe arg-is-preloaded
+      (when (and dump-target arg-is-preloaded
 		 ;; no need to check for existence of either of the files
 		 ;; because of the definition of file-newer-than-file-p.
-		 (or (file-newer-than-file-p full-arg-el dumped-exe)
-		     (file-newer-than-file-p full-arg-elc dumped-exe)))
-	(setq dumped-exe-out-of-date-wrt-dump-files t))
+		 (or (file-newer-than-file-p full-arg-el dump-target)
+		     (file-newer-than-file-p full-arg-elc dump-target)))
+	(setq dump-target-out-of-date-wrt-dump-files t))
 
       (if (and (not (member (file-name-nondirectory arg)
 			    unbytecompiled-lisp-files))
@@ -222,14 +232,14 @@
 
   ;; Check if we need to rebuild the auto-autoloads.el files -- that is,
   ;; if ANY .el files have changed.
-  (let ((dirs-to-check '("../lisp" "../lisp/mule")))
+  (let ((dirs-to-check (list source-lisp source-lisp-mule)))
     (while dirs-to-check
       (let* ((dir (car dirs-to-check))
 	     (full-dir (expand-file-name dir))
 	     (all-files-in-dir (directory-files full-dir t "\\.el$" nil t))
 	     (autoload-file
 	      (expand-file-name "auto-autoloads.el" full-dir))
-	     (autoload-is-mule (equal dir "../lisp/mule")))
+	     (autoload-is-mule (equal dir source-lisp-mule)))
 	(while all-files-in-dir
 	  (let* ((full-arg (car all-files-in-dir)))
 	    ;; custom-load.el always gets regenerated so don't let that
@@ -246,9 +256,10 @@
 	  (setq all-files-in-dir (cdr all-files-in-dir))))
       (setq dirs-to-check (cdr dirs-to-check))))
 
-  (if dumped-exe-out-of-date-wrt-dump-files
+  (if dump-target-out-of-date-wrt-dump-files
       (condition-case nil
-	  (write-region-internal "foo" nil "../src/NEEDTODUMP")
+	  (write-region-internal
+	   "foo" nil (expand-file-name "src/NEEDTODUMP" build-root))
 	(file-error nil)))
 
   )
@@ -258,20 +269,18 @@
 	  ;; doesn't exist, need-to-rebuild-autoloads gets set above.  but
 	  ;; it's only one call, so it won't slow things down much and it keeps
 	  ;; the logic cleaner.
-	  (not (file-exists-p "../lisp/auto-autoloads.el"))
+	  (not (file-exists-p aa-lisp))
 	  ;; no need to check for file-exists of .elc due to definition
 	  ;; of file-newer-than-file-p
-	  (file-newer-than-file-p "../lisp/auto-autoloads.el"
-				  "../lisp/auto-autoloads.elc"))
+	  (file-newer-than-file-p aa-lisp aac-lisp))
   (setq need-to-recompile-autoloads t))
 
 (when (or need-to-rebuild-mule-autoloads
 	  ;; not necessary but ...  see comment above.
-	  (not (file-exists-p "../lisp/mule/auto-autoloads.el"))
+	  (not (file-exists-p aa-lisp-mule))
 	  ;; no need to check for file-exists of .elc due to definition
 	  ;; of file-newer-than-file-p
-	  (file-newer-than-file-p "../lisp/mule/auto-autoloads.el"
-				  "../lisp/mule/auto-autoloads.elc"))
+	  (file-newer-than-file-p aa-lisp-mule aac-lisp-mule))
   (setq need-to-recompile-mule-autoloads t))
 
 (when (not (featurep 'mule))
@@ -288,21 +297,21 @@
        (append
 	(if (or need-to-rebuild-autoloads
 		need-to-rebuild-mule-autoloads)
-	    '("-l" "autoload"))
+	    (list "-l" "autoload"))
 	(if need-to-rebuild-autoloads
-	    '("-f" "autoload-update-directory-autoloads"
-	      "auto" "../lisp"))
+	    (list "-f" "autoload-update-directory-autoloads"
+		  "auto" source-lisp))
 	(if need-to-rebuild-mule-autoloads
-	    '("-f" "autoload-update-directory-autoloads"
-	      "mule" "../lisp/mule"))
+	    (list "-f" "autoload-update-directory-autoloads"
+		  "mule" source-lisp-mule))
 	(if need-to-recompile-autoloads
-	    '("-f" "batch-byte-compile-one-file"
-	      "../lisp/auto-autoloads.el"))
+	    (list "-f" "batch-byte-compile-one-file"
+		  aa-lisp))
 	(if need-to-recompile-mule-autoloads
-	    '("-f" "batch-byte-compile-one-file"
-		   "../lisp/mule/auto-autoloads.el")))))
+	    (list "-f" "batch-byte-compile-one-file"
+		  aa-lisp-mule)))))
   (condition-case nil
-      (delete-file "../src/REBUILD_AUTOLOADS")
+      (delete-file (expand-file-name "src/REBUILD_AUTOLOADS" build-root))
     (file-error nil))
   (cond ((and (not update-elc-files-to-compile)
 	      (not need-to-rebuild-autoloads)
@@ -319,7 +328,8 @@
 	 ;;     the autoloads here when we have files to compile, since
 	 ;;     they may depend on the updated autoloads.)
 	 (condition-case nil
-	     (write-region-internal "foo" nil "../src/REBUILD_AUTOLOADS")
+	     (write-region-internal
+	      "foo" nil (expand-file-name "src/REBUILD_AUTOLOADS" build-root))
 	   (file-error nil))
 	 )
 	(t