1 ;;; APEL-MK --- installer for APEL. -*-Emacs-Lisp-*-
5 ;; DON'T EDIT THIS FILE; edit APEL-CFG instead.
9 ;;; Configuration variables.
11 ;; Set these four variables in "APEL-CFG" or in "Makefile".
13 ;; This variable will be detected automatically.
16 ;; This variable will be detected automatically using PREFIX.
17 ;; v18: (no standard site-lisp directory)
18 ;; Emacs 19.28 and earlier: "PREFIX/lib/emacs/site-lisp"
19 ;; Emacs 19.29 and later: "PREFIX/share/emacs/site-lisp"
22 ;; This variable will be detected automatically using PREFIX.
23 ;; Emacs 19.31 and later: "PREFIX/share/emacs/VERSION/site-lisp"
24 (defvar VERSION_SPECIFIC_LISPDIR nil)
26 ;; This variable will be detected automatically.
27 ;; XEmacs 21.0 and later: "/usr/local/lib/xemacs/xemacs-packages"
28 (defvar PACKAGEDIR nil)
30 ;; Install APEL modules to "apel" subdirectory.
31 (defvar APEL_PREFIX "apel")
33 ;; Install EMU modules to "emu" subdirectory if emacs supports some features.
34 ;; If your emacs does not have `normal-top-level-add-subdirs-to-load-path'
35 ;; but have `normal-top-level-add-to-load-path' and you want to use it in
36 ;; "subdirs.el", put the following line to "APEL-CFG".
37 ;; (setq EMU_PREFIX "emu")
39 (if (or (featurep 'xemacs)
40 (fboundp 'normal-top-level-add-subdirs-to-load-path))
41 ;; Make "emu" subdirectory.
43 ;; Don't make "emu" subdirectory.
46 ;; The directories where APEL and EMU modules will be installed.
47 ;; These two variables will be generated from other variables above.
48 (defvar APEL_DIR nil) ; LISPDIR/APEL_PREFIX
49 (defvar EMU_DIR nil) ; VERSION_SPECIFIC_LISPDIR/EMU_PREFIX
52 ;;; Configure, Compile, and Install.
55 ;; Override everything you want.
56 (load-file "APEL-CFG")
57 ;; Override PREFIX, LISPDIR, and VERSION_SPECIFIC_LISPDIR with
58 ;; command-line options.
59 (let (prefix lisp-dir version-specific-lisp-dir)
62 ;; (pop command-line-args-left)
64 (car command-line-args-left)
65 (setq command-line-args-left
66 (cdr command-line-args-left))))
67 (or (string-equal "NONE" prefix)
68 (setq PREFIX prefix)))
71 ;; (pop command-line-args-left)
73 (car command-line-args-left)
74 (setq command-line-args-left
75 (cdr command-line-args-left))))
76 (or (string-equal "NONE" lisp-dir)
77 (setq LISPDIR lisp-dir)))
78 (and (setq version-specific-lisp-dir
80 ;; (pop command-line-args-left)
82 (car command-line-args-left)
83 (setq command-line-args-left
84 (cdr command-line-args-left))))
85 (or (string-equal "NONE" version-specific-lisp-dir)
86 (setq VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir))))
87 ;; Load some APEL modules from this directory.
88 (defvar default-load-path load-path)
89 (setq load-path (cons (expand-file-name ".") load-path))
94 ;; Import `apel-modules'.
95 (load-file "APEL-ELS")
96 ;; Import `emu-modules' and `emu-modules-to-compile'.
99 ;; Set PREFIX, LISPDIR, and VERSION_SPECIFIC_LISPDIR if not set yet.
101 (setq PREFIX install-prefix))
103 (setq LISPDIR (install-detect-elisp-directory PREFIX)))
104 (or VERSION_SPECIFIC_LISPDIR
105 (setq VERSION_SPECIFIC_LISPDIR
106 (install-detect-elisp-directory PREFIX nil 'version-specific)))
107 ;; The directories where APEL and EMU will be installed.
109 (setq APEL_DIR (expand-file-name APEL_PREFIX LISPDIR)))
111 (setq EMU_DIR (expand-file-name EMU_PREFIX VERSION_SPECIFIC_LISPDIR)))
112 (princ (format "\nLISPDIR=%s\n" LISPDIR))
113 (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n" VERSION_SPECIFIC_LISPDIR)))
115 (defun compile-apel ()
117 ;; Compile emu modules first.
118 (compile-elisp-modules emu-modules-to-compile ".")
119 (compile-elisp-modules apel-modules "."))
121 (defun install-apel (&optional just-print)
124 (setq just-print (install-just-print-p)))
125 (install-elisp-modules emu-modules "." EMU_DIR just-print)
126 (install-elisp-modules apel-modules "." APEL_DIR just-print))
128 ;; For XEmacs package system.
129 (defun config-apel-package ()
130 ;; Override everything you want.
131 (load-file "APEL-CFG")
132 ;; Override PACKAGEDIR with command-line option.
134 (and (setq package-dir
135 ;; Avoid using `pop'.
136 ;; (pop command-line-args-left)
138 (car command-line-args-left)
139 (setq command-line-args-left
140 (cdr command-line-args-left))))
141 (or (string= "NONE" package-dir)
142 (setq PACKAGEDIR package-dir))))
143 ;; Load some APEL modules from this directory.
144 (defvar default-load-path load-path)
145 (setq load-path (cons (expand-file-name ".") load-path))
150 ;; Import `apel-modules'.
151 (load-file "APEL-ELS")
152 ;; Import `emu-modules' and `emu-modules-to-compile'.
153 (load-file "EMU-ELS")
155 ;; Set PACKAGEDIR if not set yet.
158 (if (boundp 'early-packages)
159 (let ((dirs (append (if early-package-load-path
161 (if late-package-load-path
163 (if last-package-load-path
166 (while (not (file-exists-p (setq dir (car dirs))))
167 (setq dirs (cdr dirs)))
170 (princ (format "\nPACKAGEDIR=%s\n" PACKAGEDIR))
171 (error "XEmacs package system is not available")))
173 (defun compile-apel-package ()
174 (config-apel-package)
175 ;; Compile emu modules first.
176 (compile-elisp-modules emu-modules-to-compile ".")
177 (compile-elisp-modules apel-modules "."))
179 (defun install-apel-package ()
180 (config-apel-package)
181 (let ((just-print (install-just-print-p))
182 (dir (expand-file-name APEL_PREFIX
183 (expand-file-name "lisp" PACKAGEDIR))))
184 (install-elisp-modules emu-modules "." dir just-print)
185 (install-elisp-modules apel-modules "." dir just-print)
186 (install-update-package-files "apel" dir just-print)))
188 (defun what-where-apel ()
189 (install-apel 'just-print)
192 ;;; The files that belong to the EMU modules:
196 ;;; The files that belong to the APEL modules:
200 ;;; Do `make elc', `make install', `make package', or `make install-package'.
202 ;;; (mapconcat (function symbol-name) emu-modules ", ")
204 ;;; (mapconcat (function symbol-name) apel-modules ", ")
208 ;;; APEL-MK ends here