1 ;;; setup-paths.el --- setup various XEmacs paths
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
7 ;; Author: Mike Sperber <sperber@informatik.uni-tuebingen.de>
8 ;; Maintainer: XEmacs Development Team
9 ;; Keywords: internal, dumped
11 ;; This file is part of XEmacs.
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)
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.
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.
28 ;;; Synched up with: Not in FSF.
32 ;; This file is dumped with XEmacs.
34 ;; This file describes and constructs the various paths into the
35 ;; XEmacs hierarchy from a global viewpoint.
37 ;; It requires find-paths.el and packages.el.
41 (defvar paths-load-path-depth 1
42 "Depth of load-path searches in core Lisp paths.")
44 (defvar paths-default-info-directories
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)))
49 "Directories appended to the end of the info path by default.")
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"
55 configure-site-directory))
57 (defun paths-find-lisp-directory (roots)
58 "Find the main Lisp directory of the XEmacs hierarchy."
59 (paths-find-version-directory roots "lisp"
61 configure-lisp-directory))
63 (defun paths-construct-load-path
64 (roots early-package-load-path late-package-load-path last-package-load-path
66 &optional site-lisp-directory)
67 "Construct the load path."
68 (let* ((envvar-value (getenv "EMACSLOADPATH"))
71 (paths-decode-directory-path envvar-value 'drop-empties)))
73 (and site-lisp-directory
74 (paths-find-recursive-load-path (list site-lisp-directory)
75 paths-load-path-depth)))
78 (paths-find-recursive-load-path (list lisp-directory)
79 paths-load-path-depth))))
81 early-package-load-path
83 late-package-load-path
85 last-package-load-path)))
87 (defun paths-construct-info-path (roots early-packages late-packages last-packages)
88 "Construct the info path."
89 (let ((info-path-envval (getenv "INFOPATH")))
93 (paths-find-version-directory roots "info"
95 configure-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
102 (paths-decode-directory-path info-path-envval 'drop-empties)))
103 (and (null info-path-envval)
105 (paths-directories-which-exist configure-info-path)
106 (paths-directories-which-exist paths-default-info-directories))))))
108 (defun paths-find-doc-directory (roots)
109 "Find the documentation directory."
110 (paths-find-architecture-directory roots "lib-src"))
112 (defun paths-find-lock-directory (roots)
113 "Find the lock directory."
114 (paths-find-site-directory roots "lock" "EMACSLOCKDIR" configure-lock-directory))
116 (defun paths-find-superlock-file (lock-directory)
117 "Find the superlock file."
119 ((null lock-directory)
121 ((and configure-superlock-file
122 (file-directory-p (file-name-directory configure-superlock-file)))
123 configure-superlock-file)
125 (expand-file-name "!!!SuperLock!!!" lock-directory))))
127 (defun paths-find-exec-directory (roots)
128 "Find the binary directory."
129 (paths-find-architecture-directory roots "lib-src" configure-exec-directory))
131 (defun paths-construct-exec-path (roots exec-directory
132 early-packages late-packages last-packages)
133 "Find the binary path."
135 (let ((path-envval (getenv "PATH")))
137 (paths-decode-directory-path path-envval 'drop-empties)))
138 (packages-find-package-exec-path early-packages)
139 (packages-find-package-exec-path late-packages)
140 (packages-find-package-exec-path last-packages)
141 (let ((emacspath-envval (getenv "EMACSPATH")))
142 (and emacspath-envval
143 (split-path emacspath-envval)))
145 (list exec-directory))))
147 (defun paths-find-data-directory (roots)
148 "Find the data directory."
149 (paths-find-version-directory roots "etc" "EMACSDATA" configure-data-directory))
151 (defun paths-construct-data-directory-list (data-directory
152 early-packages late-packages last-packages)
153 "Find the data path."
155 (packages-find-package-data-path early-packages)
156 (packages-find-package-data-path late-packages)
157 (packages-find-package-data-path last-packages)
158 (list data-directory)))
160 ;;; setup-paths.el ends here