Mercurial > hg > xemacs-beta
comparison lisp/loadup.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 |
comparison
equal
deleted
inserted
replaced
1329:389741884c65 | 1330:4542b72c005e |
---|---|
37 | 37 |
38 ;; Help debug problems. | 38 ;; Help debug problems. |
39 (setq stack-trace-on-error t | 39 (setq stack-trace-on-error t |
40 load-always-display-messages t) | 40 load-always-display-messages t) |
41 | 41 |
42 ;(princ (format "command-line-args: %s\n" command-line-args)) | |
43 ;(princ (format "configure-lisp-directory: %S\n" configure-lisp-directory)) | |
44 ;(princ (format "configure-data-directory: %S\n" configure-data-directory)) | |
45 ;(princ (format "lisp-directory: %S\n" lisp-directory)) | |
46 | |
42 (when (fboundp 'error) | 47 (when (fboundp 'error) |
43 (error "loadup.el already loaded!")) | 48 (error "loadup.el already loaded!")) |
44 | 49 |
45 (defvar running-xemacs t | 50 (defvar running-xemacs t |
46 "Non-nil when the current emacs is XEmacs.") | 51 "Non-nil when the current emacs is XEmacs.") |
47 (defvar preloaded-file-list nil | 52 (defvar preloaded-file-list nil |
48 "List of files preloaded into the XEmacs binary image.") | 53 "List of files preloaded into the XEmacs binary image.") |
49 | 54 |
50 (defvar Installation-string nil | 55 (defvar Installation-string nil |
51 "Description of XEmacs installation.") | 56 "Description of XEmacs installation.") |
57 | |
58 (defvar build-root (expand-file-name ".." invocation-directory)) | |
59 (defvar source-lisp (file-name-directory (expand-file-name | |
60 (nth 2 command-line-args)))) | |
61 (defvar source-root (expand-file-name ".." source-lisp)) | |
62 ;(defvar build-lib-src (expand-file-name "lib-src" build-root)) | |
52 | 63 |
53 ;(start-profiling) | 64 ;(start-profiling) |
54 | 65 |
55 (let ((gc-cons-threshold | 66 (let ((gc-cons-threshold |
56 ;; setting it low makes loadup incredibly fucking slow. | 67 ;; setting it low makes loadup incredibly fucking slow. |
74 (set-buffer (get-buffer-create (generate-new-buffer-name | 85 (set-buffer (get-buffer-create (generate-new-buffer-name |
75 " *temp*"))) | 86 " *temp*"))) |
76 ;; insert-file-contents-internal bogusly calls | 87 ;; insert-file-contents-internal bogusly calls |
77 ;; format-decode without checking if it's defined. | 88 ;; format-decode without checking if it's defined. |
78 (fset 'format-decode #'(lambda (f l &optional v) l)) | 89 (fset 'format-decode #'(lambda (f l &optional v) l)) |
79 (insert-file-contents-internal "../Installation") | 90 (insert-file-contents-internal |
91 (expand-file-name "Installation" build-root)) | |
80 (fmakunbound 'format-decode) | 92 (fmakunbound 'format-decode) |
81 (prog1 (buffer-substring) | 93 (prog1 (buffer-substring) |
82 (kill-buffer (current-buffer))))) | 94 (kill-buffer (current-buffer))))) |
83 | 95 |
84 (let ((build-root (expand-file-name ".." invocation-directory))) | 96 (setq load-path (list source-lisp)) |
85 (setq load-path (list (expand-file-name "lisp" build-root))) | 97 (setq module-load-path (list (expand-file-name "modules" build-root))) |
86 (setq module-load-path (list (expand-file-name "modules" build-root)))) | |
87 | 98 |
88 ;; message not defined yet ... | 99 ;; message not defined yet ... |
89 (external-debugging-output (format "\nUsing load-path %s" load-path)) | 100 (external-debugging-output (format "\nUsing load-path %s" load-path)) |
90 (external-debugging-output (format "\nUsing module-load-path %s" | 101 (external-debugging-output (format "\nUsing module-load-path %s" |
91 module-load-path)) | 102 module-load-path)) |
131 ;;(print (format "late-packages: %S" late-packages)) | 142 ;;(print (format "late-packages: %S" late-packages)) |
132 ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-root-p))) | 143 ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-root-p))) |
133 ;;(print (format "guessed-data-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-data-root-p))) | 144 ;;(print (format "guessed-data-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-data-root-p))) |
134 nil))) | 145 nil))) |
135 | 146 |
136 (load (expand-file-name "../lisp/dumped-lisp.el")) | 147 (load (expand-file-name "dumped-lisp.el" source-lisp)) |
137 | 148 |
138 (let ((files preloaded-file-list) | 149 (let ((files preloaded-file-list) |
139 file) | 150 file) |
140 (while (setq file (car files)) | 151 (while (setq file (car files)) |
141 (unless (pureload file) | 152 (unless (pureload file) |
209 (buffer-enable-undo "*scratch*") | 220 (buffer-enable-undo "*scratch*") |
210 | 221 |
211 ) ;; (let ((gc-cons-threshold [frequent garbage collection when dumping]))) | 222 ) ;; (let ((gc-cons-threshold [frequent garbage collection when dumping]))) |
212 | 223 |
213 ;(stop-profiling) | 224 ;(stop-profiling) |
214 | |
215 ;; yuck! need to insert the function def here, and rewrite the dolist | |
216 ;; loop below. | |
217 | |
218 ;(defun loadup-profile-results (&optional info stream) | |
219 ; "Print profiling info INFO to STREAM in a pretty format. | |
220 ;If INFO is omitted, the current profiling info is retrieved using | |
221 ; `get-profiling-info'. | |
222 ;If STREAM is omitted, either a *Profiling Results* buffer or standard | |
223 ; output are used, depending on whether the function was called | |
224 ; interactively or not." | |
225 ; (interactive) | |
226 ; (setq info (if info | |
227 ; (copy-alist info) | |
228 ; (get-profiling-info))) | |
229 ; (when (and (not stream) | |
230 ; (interactive-p)) | |
231 ; (pop-to-buffer (get-buffer-create "*Profiling Results*")) | |
232 ; (erase-buffer)) | |
233 ; (let ((standard-output (or stream (if (interactive-p) | |
234 ; (current-buffer) | |
235 ; standard-output))) | |
236 ; ;; Calculate the longest function | |
237 ; (maxfunlen (apply #'max | |
238 ; (length "Function Name") | |
239 ; (mapcar | |
240 ; (lambda (el) | |
241 ; ;; Functions longer than 50 characters (usually | |
242 ; ;; anonymous functions) don't qualify | |
243 ; (let ((l (length (format "%s" (car el))))) | |
244 ; (if (< l 50) | |
245 ; l 0))) | |
246 ; info)))) | |
247 ; (princ (format "%-*s Ticks %%/Total Call Count\n" | |
248 ; maxfunlen "Function Name")) | |
249 ; (princ (make-string maxfunlen ?=)) | |
250 ; (princ " ===== ======= ==========\n") | |
251 ; (let ((sum (float (apply #'+ (mapcar #'cdr info))))) | |
252 ; (let (entry | |
253 ; (entry-list (nreverse (sort info #'cdr-less-than-cdr)))) | |
254 ; (while entry-list | |
255 ; (setq entry (car entry-list)) | |
256 ; (princ (format "%-*s %-5d %-6.3f %s\n" | |
257 ; maxfunlen (car entry) (cdr entry) | |
258 ; (* 100 (/ (cdr entry) sum)) | |
259 ; (or (gethash (car entry) call-count-profile-table) | |
260 ; ""))) | |
261 ; (setq entry-list (cdr entry-list)))) | |
262 ; (princ (make-string maxfunlen ?-)) | |
263 ; (princ "---------------------------------\n") | |
264 ; (princ (format "%-*s %-5d %-6.2f\n" maxfunlen "Total" sum 100.0)) | |
265 ; (princ (format "\n\nOne tick = %g ms\n" | |
266 ; (/ default-profiling-interval 1000.0))) | |
267 ; (and (boundp 'internal-error-checking) | |
268 ; internal-error-checking | |
269 ; (princ " | |
270 ;WARNING: Error checking is turned on in this XEmacs. This might make | |
271 ; the measurements very unreliable.\n")))) | |
272 ; (when (and (not stream) | |
273 ; (interactive-p)) | |
274 ; (goto-char (point-min)))) | |
275 | |
276 ;(loadup-profile-results nil 'external-debugging-output) | |
277 | 225 |
278 ;; Dump into the name `xemacs' (only) | 226 ;; Dump into the name `xemacs' (only) |
279 (when (member "dump" command-line-args) | 227 (when (member "dump" command-line-args) |
280 (message "Dumping under the name xemacs") | 228 (message "Dumping under the name xemacs") |
281 ;; This is handled earlier in the build process. | 229 ;; This is handled earlier in the build process. |