265
|
1 ;;; setup-paths.el --- setup various XEmacs paths
|
|
2
|
|
3 ;; Copyright (C) 1985-1986, 1990, 1992-1997 Free Software Foundation, Inc.
|
|
4 ;; Copyright (c) 1993, 1994 Sun Microsystems, Inc.
|
|
5 ;; Copyright (C) 1995 Board of Trustees, University of Illinois
|
|
6
|
|
7 ;; Author: Mike Sperber <sperber@informatik.uni-tuebingen.de>
|
|
8 ;; Maintainer: XEmacs Development Team
|
|
9 ;; Keywords: internal, dumped
|
|
10
|
|
11 ;; This file is part of XEmacs.
|
|
12
|
|
13 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
14 ;; under the terms of the GNU General Public License as published by
|
|
15 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
16 ;; any later version.
|
|
17
|
|
18 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
21 ;; General Public License for more details.
|
|
22
|
|
23 ;; You should have received a copy of the GNU General Public License
|
|
24 ;; along with XEmacs; see the file COPYING. If not, write to the
|
|
25 ;; Free Software Foundation, 59 Temple Place - Suite 330,
|
|
26 ;; Boston, MA 02111-1307, USA.
|
|
27
|
|
28 ;;; Synched up with: Not in FSF.
|
|
29
|
|
30 ;;; Commentary:
|
|
31
|
|
32 ;; This file is dumped with XEmacs.
|
|
33
|
267
|
34 ;; This file describes and constructs the various paths into the
|
|
35 ;; XEmacs hierarchy from a global viewpoint.
|
265
|
36
|
267
|
37 ;; It requires find-paths.el and packages.el.
|
|
38
|
|
39 ;;; Code:
|
265
|
40
|
276
|
41 (defvar paths-load-path-depth 1
|
|
42 "Depth of load-path searches in core Lisp paths.")
|
|
43
|
|
44 (defvar paths-default-info-directories
|
284
|
45 (list (paths-construct-path '("usr" "local" "info")
|
|
46 (char-to-string directory-sep-char))
|
|
47 (paths-construct-path '("usr" "info")
|
|
48 (char-to-string directory-sep-char)))
|
276
|
49 "Directories appended to the end of the info path by default.")
|
|
50
|
267
|
51 (defun paths-find-site-lisp-directory (roots)
|
|
52 "Find the site Lisp directory of the XEmacs hierarchy."
|
|
53 (paths-find-site-directory roots "site-lisp"
|
|
54 nil
|
|
55 configure-site-directory))
|
265
|
56
|
267
|
57 (defun paths-find-lisp-directory (roots)
|
|
58 "Find the main Lisp directory of the XEmacs hierarchy."
|
|
59 (paths-find-version-directory roots "lisp"
|
|
60 nil
|
|
61 configure-lisp-directory))
|
265
|
62
|
267
|
63 (defun paths-construct-load-path
|
272
|
64 (roots early-package-load-path late-package-load-path last-package-load-path
|
276
|
65 lisp-directory
|
|
66 &optional site-lisp-directory)
|
265
|
67 "Construct the load path."
|
269
|
68 (let* ((envvar-value (getenv "EMACSLOADPATH"))
|
276
|
69 (env-load-path
|
|
70 (and envvar-value
|
|
71 (paths-decode-directory-path envvar-value 'drop-empties)))
|
269
|
72 (site-lisp-load-path
|
|
73 (and site-lisp-directory
|
276
|
74 (paths-find-recursive-load-path (list site-lisp-directory)
|
|
75 paths-load-path-depth)))
|
269
|
76 (lisp-load-path
|
278
|
77 (and lisp-directory
|
|
78 (paths-find-recursive-load-path (list lisp-directory)
|
|
79 paths-load-path-depth))))
|
269
|
80 (append env-load-path
|
|
81 early-package-load-path
|
|
82 site-lisp-load-path
|
|
83 late-package-load-path
|
272
|
84 lisp-load-path
|
|
85 last-package-load-path)))
|
265
|
86
|
272
|
87 (defun paths-construct-info-path (roots early-packages late-packages last-packages)
|
265
|
88 "Construct the info path."
|
274
|
89 (let ((info-path-envval (getenv "INFOPATH")))
|
|
90 (paths-uniq-append
|
|
91 (append
|
|
92 (let ((info-directory
|
|
93 (paths-find-version-directory roots "info"
|
|
94 nil
|
|
95 configure-info-directory)))
|
|
96 (and info-directory
|
|
97 (list info-directory)))
|
|
98 (packages-find-package-info-path early-packages)
|
|
99 (packages-find-package-info-path late-packages)
|
|
100 (packages-find-package-info-path last-packages)
|
|
101 (and info-path-envval
|
276
|
102 (paths-decode-directory-path info-path-envval 'drop-empties)))
|
278
|
103 (and (null info-path-envval)
|
274
|
104 (paths-uniq-append
|
|
105 (paths-directories-which-exist configure-info-path)
|
276
|
106 (paths-directories-which-exist paths-default-info-directories))))))
|
265
|
107
|
|
108 (defun paths-find-doc-directory (roots)
|
|
109 "Find the documentation directory."
|
371
|
110 (paths-find-architecture-directory roots "lib-src"))
|
265
|
111
|
|
112 (defun paths-find-lock-directory (roots)
|
|
113 "Find the lock directory."
|
380
|
114 (defvar configure-lock-directory)
|
274
|
115 (paths-find-site-directory roots "lock" "EMACSLOCKDIR" configure-lock-directory))
|
265
|
116
|
|
117 (defun paths-find-superlock-file (lock-directory)
|
|
118 "Find the superlock file."
|
380
|
119 ;; #### There is no such variable configure-superlock-file!
|
265
|
120 (cond
|
|
121 ((null lock-directory)
|
|
122 nil)
|
|
123 ((and configure-superlock-file
|
|
124 (file-directory-p (file-name-directory configure-superlock-file)))
|
|
125 configure-superlock-file)
|
|
126 (t
|
|
127 (expand-file-name "!!!SuperLock!!!" lock-directory))))
|
|
128
|
|
129 (defun paths-find-exec-directory (roots)
|
|
130 "Find the binary directory."
|
371
|
131 (paths-find-architecture-directory roots "lib-src" configure-exec-directory))
|
265
|
132
|
272
|
133 (defun paths-construct-exec-path (roots exec-directory
|
|
134 early-packages late-packages last-packages)
|
265
|
135 "Find the binary path."
|
|
136 (append
|
|
137 (let ((path-envval (getenv "PATH")))
|
267
|
138 (if path-envval
|
276
|
139 (paths-decode-directory-path path-envval 'drop-empties)))
|
267
|
140 (packages-find-package-exec-path early-packages)
|
|
141 (packages-find-package-exec-path late-packages)
|
265
|
142 (let ((emacspath-envval (getenv "EMACSPATH")))
|
276
|
143 (and emacspath-envval
|
284
|
144 (split-path emacspath-envval)))
|
265
|
145 (and exec-directory
|
373
|
146 (list exec-directory))
|
|
147 (packages-find-package-exec-path last-packages)))
|
265
|
148
|
|
149 (defun paths-find-data-directory (roots)
|
|
150 "Find the data directory."
|
|
151 (paths-find-version-directory roots "etc" "EMACSDATA" configure-data-directory))
|
|
152
|
272
|
153 (defun paths-construct-data-directory-list (data-directory
|
|
154 early-packages late-packages last-packages)
|
265
|
155 "Find the data path."
|
|
156 (append
|
267
|
157 (packages-find-package-data-path early-packages)
|
|
158 (packages-find-package-data-path late-packages)
|
373
|
159 (list data-directory)
|
|
160 (packages-find-package-data-path last-packages)))
|
265
|
161
|
|
162 ;;; setup-paths.el ends here
|