Disable "in-tree" builds.
[sxemacs] / lisp / dump-paths.el
1 ;; dump-paths.el --- set up SXEmacs paths for dumping
2
3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc.
4
5 ;; Maintainer: SXEmacs Development Team
6 ;; Keywords: internal, dumped
7
8 ;; This file is part of SXEmacs.
9
10 ;; SXEmacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
14
15 ;; SXEmacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
23 ;;; Synched up with: Not in FSF
24
25 ;;; Commentary:
26
27 ;; This sets up the various paths for continuing loading files for
28 ;; dumping.
29 ;; #### This code is duplicated in startup.el (startup-setup-paths).
30
31 (let ((debug-paths (or debug-paths
32                       (and (getenv "EMACSDEBUGPATHS")
33                            t)))
34       (roots (paths-find-emacs-roots invocation-directory
35                                      invocation-name t)))
36
37   (when debug-paths
38     (princ (format "SXEmacs thinks the roots of its hierarchy are:\n%S\n"
39                    roots)))
40
41   (let* ((package-locations
42           (packages-compute-package-locations
43            ;; temporary kludge:
44            ;; this should be synched with startup.el
45            (paths-construct-path '("~" ".sxemacs"))))
46          (stuff (packages-find-packages roots package-locations)))
47     (setq late-packages (car (cdr stuff))))
48
49   (setq late-package-load-path (packages-find-package-load-path late-packages))
50
51   (if debug-paths
52       (progn
53         (princ (format "configure-package-path:\n%S\n" configure-package-path)
54                'external-debugging-output)
55         (princ (format "late-packages and late-package-load-path:\n%S\n%S\n"
56                        late-packages late-package-load-path)
57                'external-debugging-output)))
58
59   (setq lisp-directory (paths-find-lisp-directory roots))
60   (if debug-paths
61       (princ (format "lisp-directory:\n%S\n" lisp-directory)
62              'external-debugging-output))
63   (if (featurep 'mule)
64       (progn
65         (setq mule-lisp-directory
66               (paths-find-mule-lisp-directory roots
67                                               lisp-directory))
68         (if debug-paths
69             (princ (format "mule-lisp-directory:\n%S\n"
70                            mule-lisp-directory)
71                    'external-debugging-output)))
72     (setq mule-lisp-directory '()))
73
74   (setq ffi-lisp-directory
75         (when (fboundp #'ffi-defun)
76           (paths-find-ffi-lisp-directory roots
77                                          lisp-directory)))
78
79   (setq load-path (paths-construct-load-path roots
80                                              '()
81                                              late-package-load-path
82                                              '()
83                                              lisp-directory
84                                              nil
85                                              mule-lisp-directory
86                                              ffi-lisp-directory))
87
88   (setq exec-directory (paths-find-exec-directory roots))
89   (if debug-paths
90       (princ (format "exec-directory:\n%S\n" exec-directory)
91              'external-debugging-output))
92
93   (setq module-directory (paths-find-module-directory roots))
94   (if debug-paths
95       (princ (format "module-directory:\n%S\n" module-directory)
96              'external-debugging-output))
97   (setq site-module-directory (and (null inhibit-site-modules)
98                             (paths-find-site-module-directory roots)))
99   (if (and debug-paths (null inhibit-site-modules))
100       (princ (format "site-module-directory:\n%S\n" site-module-directory)
101              'external-debugging-output))
102
103   (when debug-paths
104     (princ (format "load-path:\n%S\n" load-path))))
105
106 ;;; dump-paths.el ends here