+ ;; Override everything you want.
+ (load-file "APEL-CFG")
+ ;; Override PREFIX, LISPDIR, and VERSION_SPECIFIC_LISPDIR with
+ ;; command-line options.
+ (let (prefix lisp-dir version-specific-lisp-dir)
+ (and (setq prefix
+ ;; Avoid using `pop'.
+ ;; (pop command-line-args-left)
+ (prog1
+ (car command-line-args-left)
+ (setq command-line-args-left
+ (cdr command-line-args-left))))
+ (or (string-equal "NONE" prefix)
+ (setq PREFIX prefix)))
+ (and (setq lisp-dir
+ ;; Avoid using `pop'.
+ ;; (pop command-line-args-left)
+ (prog1
+ (car command-line-args-left)
+ (setq command-line-args-left
+ (cdr command-line-args-left))))
+ (or (string-equal "NONE" lisp-dir)
+ (setq LISPDIR lisp-dir)))
+ (and (setq version-specific-lisp-dir
+ ;; Avoid using `pop'.
+ ;; (pop command-line-args-left)
+ (prog1
+ (car command-line-args-left)
+ (setq command-line-args-left
+ (cdr command-line-args-left))))
+ (or (string-equal "NONE" version-specific-lisp-dir)
+ (setq VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir))))
+ ;; Load some APEL modules from this directory.
+ (defvar default-load-path load-path)
+ (setq load-path (cons (expand-file-name ".") load-path))
+ (require 'poe)
+ (require 'path-util)
+ (require 'install)
+
+ ;; Import `apel-modules'.
+ (load-file "APEL-ELS")
+ ;; Import `emu-modules' and `emu-modules-to-compile'.
+ (load-file "EMU-ELS")
+
+ ;; Set PREFIX, LISPDIR, and VERSION_SPECIFIC_LISPDIR if not set yet.
+ (or PREFIX
+ (setq PREFIX install-prefix))
+ (or LISPDIR
+ (setq LISPDIR (install-detect-elisp-directory PREFIX)))
+ (or VERSION_SPECIFIC_LISPDIR
+ (setq VERSION_SPECIFIC_LISPDIR
+ (install-detect-elisp-directory PREFIX nil 'version-specific)))
+ ;; The directories where APEL and EMU will be installed.
+ (or APEL_DIR
+ (setq APEL_DIR (expand-file-name APEL_PREFIX LISPDIR)))
+ (or EMU_DIR
+ (setq EMU_DIR (expand-file-name EMU_PREFIX VERSION_SPECIFIC_LISPDIR)))
+ (princ (format "\nLISPDIR=%s\n" LISPDIR))
+ (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n" VERSION_SPECIFIC_LISPDIR)))