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
|
267
|
41 (defun paths-find-site-lisp-directory (roots)
|
|
42 "Find the site Lisp directory of the XEmacs hierarchy."
|
|
43 (paths-find-site-directory roots "site-lisp"
|
|
44 nil
|
|
45 configure-site-directory))
|
265
|
46
|
267
|
47 (defun paths-find-lisp-directory (roots)
|
|
48 "Find the main Lisp directory of the XEmacs hierarchy."
|
|
49 (paths-find-version-directory roots "lisp"
|
|
50 nil
|
|
51 configure-lisp-directory))
|
265
|
52
|
267
|
53 (defun paths-construct-load-path
|
272
|
54 (roots early-package-load-path late-package-load-path last-package-load-path
|
267
|
55 &optional inhibit-site-lisp)
|
265
|
56 "Construct the load path."
|
269
|
57 (let* ((envvar-value (getenv "EMACSLOADPATH"))
|
|
58 (env-load-path (and envvar-value
|
|
59 (decode-path-internal envvar-value)))
|
|
60 (site-lisp-directory
|
|
61 (and (null inhibit-site-lisp)
|
|
62 (paths-find-site-lisp-directory roots)))
|
|
63 (site-lisp-load-path
|
|
64 (and site-lisp-directory
|
|
65 (paths-find-recursive-load-path (list site-lisp-directory))))
|
|
66 (lisp-directory (paths-find-lisp-directory roots))
|
|
67 (lisp-load-path
|
272
|
68 (and lisp-directory
|
|
69 (paths-find-recursive-load-path (list lisp-directory)))))
|
269
|
70 (append env-load-path
|
|
71 early-package-load-path
|
|
72 site-lisp-load-path
|
|
73 late-package-load-path
|
272
|
74 lisp-load-path
|
|
75 last-package-load-path)))
|
265
|
76
|
272
|
77 (defun paths-construct-info-path (roots early-packages late-packages last-packages)
|
265
|
78 "Construct the info path."
|
|
79 (append
|
267
|
80 (packages-find-package-info-path early-packages)
|
|
81 (packages-find-package-info-path late-packages)
|
265
|
82 (let ((info-directory
|
|
83 (paths-find-version-directory roots "info"
|
|
84 nil
|
269
|
85 configure-info-directory)))
|
265
|
86 (and info-directory
|
|
87 (list info-directory)))
|
272
|
88 (packages-find-package-info-path last-packages)
|
265
|
89 (let ((info-path-envval (getenv "INFOPATH")))
|
267
|
90 (if info-path-envval
|
269
|
91 (decode-path-internal info-path-envval)
|
|
92 (paths-directories-which-exist configure-info-path)))))
|
265
|
93
|
|
94 (defun paths-find-doc-directory (roots)
|
|
95 "Find the documentation directory."
|
|
96 (paths-find-architecture-directory roots "lib-src"))
|
|
97
|
|
98 (defun paths-find-lock-directory (roots)
|
|
99 "Find the lock directory."
|
|
100 (paths-find-site-path roots "lock" "EMACSLOCKDIR" configure-lock-directory))
|
|
101
|
|
102 (defun paths-find-superlock-file (lock-directory)
|
|
103 "Find the superlock file."
|
|
104 (cond
|
|
105 ((null lock-directory)
|
|
106 nil)
|
|
107 ((and configure-superlock-file
|
|
108 (file-directory-p (file-name-directory configure-superlock-file)))
|
|
109 configure-superlock-file)
|
|
110 (t
|
|
111 (expand-file-name "!!!SuperLock!!!" lock-directory))))
|
|
112
|
|
113 (defun paths-find-exec-directory (roots)
|
|
114 "Find the binary directory."
|
|
115 (paths-find-architecture-directory roots "lib-src"))
|
|
116
|
272
|
117 (defun paths-construct-exec-path (roots exec-directory
|
|
118 early-packages late-packages last-packages)
|
265
|
119 "Find the binary path."
|
|
120 (append
|
|
121 (let ((path-envval (getenv "PATH")))
|
267
|
122 (if path-envval
|
|
123 (decode-path-internal path-envval)))
|
|
124 (packages-find-package-exec-path early-packages)
|
|
125 (packages-find-package-exec-path late-packages)
|
272
|
126 (packages-find-package-exec-path last-packages)
|
265
|
127 (let ((emacspath-envval (getenv "EMACSPATH")))
|
267
|
128 (if emacspath-envval
|
|
129 (decode-path-internal emacspath-envval)
|
265
|
130 (paths-directories-which-exist configure-exec-path)))
|
|
131 (and exec-directory
|
|
132 (list exec-directory))))
|
|
133
|
|
134 (defun paths-find-data-directory (roots)
|
|
135 "Find the data directory."
|
|
136 (paths-find-version-directory roots "etc" "EMACSDATA" configure-data-directory))
|
|
137
|
272
|
138 (defun paths-construct-data-directory-list (data-directory
|
|
139 early-packages late-packages last-packages)
|
265
|
140 "Find the data path."
|
|
141 (append
|
267
|
142 (packages-find-package-data-path early-packages)
|
|
143 (packages-find-package-data-path late-packages)
|
272
|
144 (packages-find-package-data-path last-packages)
|
265
|
145 (list data-directory)))
|
|
146
|
|
147 ;;; setup-paths.el ends here
|