428
|
1 ;; dump-paths.el --- set up XEmacs paths for dumping
|
|
2
|
|
3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc.
|
776
|
4 ;; Copyright (C) 2002 Ben Wing.
|
428
|
5
|
|
6 ;; Maintainer: XEmacs Development Team
|
|
7 ;; Keywords: internal, dumped
|
|
8
|
|
9 ;; This file is part of XEmacs.
|
|
10
|
|
11 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
12 ;; under the terms of the GNU General Public License as published by
|
|
13 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
14 ;; any later version.
|
|
15
|
|
16 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
19 ;; General Public License for more details.
|
|
20
|
|
21 ;; You should have received a copy of the GNU General Public License
|
|
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
24 ;; 02111-1307, USA.
|
|
25
|
|
26 ;;; Synched up with: Not in FSF
|
|
27
|
|
28 ;;; Commentary:
|
|
29
|
776
|
30 ;; This sets up the various paths for continuing loading files for dumping.
|
|
31 ;; This is the only file of the basic path/package files (find-paths.el,
|
|
32 ;; package.el, setup-paths.el, dump-paths.el) that actually does stuff.
|
428
|
33
|
776
|
34 (defun startup-setup-paths (roots user-init-directory
|
|
35 &optional
|
|
36 inhibit-packages inhibit-site-lisp
|
|
37 debug-paths called-early)
|
|
38 "Setup all the various paths.
|
|
39 ROOTS is a list of plausible roots of the XEmacs directory hierarchy.
|
|
40 If INHIBIT-PACKAGES is non-NIL, don't do packages.
|
|
41 If INHIBIT-SITE-LISP is non-NIL, don't do site-lisp.
|
|
42 If DEBUG-PATHS is non-NIL, print paths as they are detected.
|
|
43 It's idempotent, so call this as often as you like!"
|
428
|
44
|
776
|
45 (if (eq inhibit-packages t)
|
|
46 (setq inhibit-packages '(early late last)))
|
|
47 (if (not (listp inhibit-packages))
|
|
48 (setq inhibit-packages (list inhibit-packages)))
|
428
|
49
|
776
|
50 (apply #'(lambda (early late last)
|
|
51 (setq early-packages (and (not (memq 'early inhibit-packages))
|
|
52 early))
|
|
53 (setq late-packages (and (not (memq 'late inhibit-packages))
|
|
54 late))
|
|
55 (setq last-packages (and (not (memq 'last inhibit-packages))
|
|
56 last))
|
|
57 )
|
|
58 (packages-find-packages
|
|
59 roots
|
|
60 (packages-compute-package-locations user-init-directory)))
|
428
|
61
|
776
|
62 (setq early-package-load-path (packages-find-package-load-path
|
|
63 early-packages))
|
428
|
64 (setq late-package-load-path (packages-find-package-load-path late-packages))
|
776
|
65 (setq last-package-load-path (packages-find-package-load-path last-packages))
|
428
|
66
|
|
67 (if debug-paths
|
|
68 (progn
|
776
|
69 (princ (format "arguments:\nroots: %S\nuser-init-directory: %S\n"
|
|
70 roots user-init-directory)
|
|
71 'external-debugging-output)
|
|
72 (princ (format "inhibit-packages: %S\ninhibit-site-lisp: %S\n"
|
|
73 inhibit-packages inhibit-site-lisp)
|
|
74 'external-debugging-output)
|
|
75 (princ (format "debug-paths: %S\ncalled-early: %S\n\n"
|
|
76 debug-paths called-early)
|
|
77 'external-debugging-output)
|
428
|
78 (princ (format "configure-package-path:\n%S\n" configure-package-path)
|
|
79 'external-debugging-output)
|
776
|
80 (princ (format "early-packages and early-package-load-path:\n%S\n%S\n"
|
|
81 early-packages early-package-load-path)
|
|
82 'external-debugging-output)
|
428
|
83 (princ (format "late-packages and late-package-load-path:\n%S\n%S\n"
|
|
84 late-packages late-package-load-path)
|
776
|
85 'external-debugging-output)
|
|
86 (princ (format "last-packages and last-package-load-path:\n%S\n%S\n"
|
|
87 last-packages last-package-load-path)
|
428
|
88 'external-debugging-output)))
|
|
89
|
|
90 (setq lisp-directory (paths-find-lisp-directory roots))
|
776
|
91
|
428
|
92 (if debug-paths
|
|
93 (princ (format "lisp-directory:\n%S\n" lisp-directory)
|
|
94 'external-debugging-output))
|
776
|
95
|
460
|
96 (if (featurep 'mule)
|
|
97 (progn
|
|
98 (setq mule-lisp-directory
|
|
99 (paths-find-mule-lisp-directory roots
|
|
100 lisp-directory))
|
|
101 (if debug-paths
|
|
102 (princ (format "mule-lisp-directory:\n%S\n"
|
|
103 mule-lisp-directory)
|
|
104 'external-debugging-output)))
|
|
105 (setq mule-lisp-directory '()))
|
776
|
106
|
428
|
107 (setq site-directory (and (null inhibit-site-lisp)
|
|
108 (paths-find-site-lisp-directory roots)))
|
776
|
109
|
428
|
110 (if (and debug-paths (null inhibit-site-lisp))
|
|
111 (princ (format "site-directory:\n%S\n" site-directory)
|
|
112 'external-debugging-output))
|
|
113
|
|
114 (setq load-path (paths-construct-load-path roots
|
776
|
115 early-package-load-path
|
428
|
116 late-package-load-path
|
776
|
117 last-package-load-path
|
428
|
118 lisp-directory
|
460
|
119 site-directory
|
|
120 mule-lisp-directory))
|
428
|
121
|
776
|
122 (if called-early
|
|
123 (progn
|
|
124 (setq module-directory (paths-find-module-directory roots))
|
|
125 (if debug-paths
|
|
126 (princ (format "module-directory:\n%S\n" module-directory)
|
|
127 'external-debugging-output))
|
|
128 (setq site-module-directory (and (null inhibit-site-modules)
|
|
129 (paths-find-site-module-directory
|
|
130 roots)))
|
|
131 (if (and debug-paths (null inhibit-site-modules))
|
|
132 (princ (format "site-module-directory:\n%S\n"
|
|
133 site-module-directory)
|
|
134 'external-debugging-output))
|
|
135
|
|
136 (setq module-load-path (paths-construct-module-load-path
|
|
137 roots
|
|
138 module-directory
|
|
139 site-module-directory)))
|
|
140 (setq Info-directory-list
|
|
141 (paths-construct-info-path
|
|
142 roots early-packages late-packages last-packages))
|
|
143
|
|
144 (if debug-paths
|
|
145 (princ (format "Info-directory-list:\n%S\n" Info-directory-list)
|
|
146 'external-debugging-output))
|
|
147
|
|
148 (setq exec-directory (paths-find-exec-directory roots))
|
|
149
|
|
150 (if debug-paths
|
|
151 (princ (format "exec-directory:\n%s\n" exec-directory)
|
|
152 'external-debugging-output))
|
|
153
|
|
154 (setq exec-path
|
|
155 (paths-construct-exec-path roots exec-directory
|
|
156 early-packages late-packages
|
|
157 last-packages))
|
|
158
|
|
159 (if debug-paths
|
|
160 (princ (format "exec-path:\n%S\n" exec-path)
|
|
161 'external-debugging-output))
|
|
162
|
|
163 (setq doc-directory (paths-find-doc-directory roots))
|
|
164
|
|
165 (if debug-paths
|
|
166 (princ (format "doc-directory:\n%S\n" doc-directory)
|
|
167 'external-debugging-output))
|
|
168
|
|
169 (setq data-directory (paths-find-data-directory roots))
|
|
170
|
|
171 (if debug-paths
|
|
172 (princ (format "data-directory:\n%S\n" data-directory)
|
|
173 'external-debugging-output))
|
|
174
|
|
175 (setq data-directory-list (paths-construct-data-directory-list
|
|
176 data-directory early-packages
|
|
177 late-packages last-packages))
|
|
178 (if debug-paths
|
|
179 (princ (format "data-directory-list:\n%S\n" data-directory-list)
|
|
180 'external-debugging-output))))
|
|
181
|
|
182 ;;; Now actually do something.
|
|
183
|
|
184 (let ((debug-paths (or debug-paths
|
|
185 (and (getenv "EMACSDEBUGPATHS")
|
|
186 t)))
|
|
187 (roots (paths-find-emacs-roots invocation-directory
|
|
188 invocation-name)))
|
|
189
|
428
|
190 (if debug-paths
|
776
|
191 (princ (format "XEmacs thinks the roots of its hierarchy are:\n%S\n"
|
|
192 roots)
|
428
|
193 'external-debugging-output))
|
776
|
194 (startup-setup-paths roots
|
|
195 (paths-construct-path '("~" ".xemacs"))
|
|
196 (if inhibit-all-packages t
|
|
197 '(early last))
|
|
198 inhibit-site-lisp
|
|
199 debug-paths
|
|
200 t))
|
428
|
201
|
|
202 ;;; dump-paths.el ends here
|