From d732461ee6e3c83ec447c122f1e97560851a952c Mon Sep 17 00:00:00 2001 From: shuhei Date: Sat, 13 Nov 1999 09:25:39 +0000 Subject: [PATCH] Revised. --- APEL-CFG | 59 ++++++++++++++----- APEL-ELS | 2 +- APEL-MK | 189 ++++++++++++++++++++++++++++++++++++------------------------- ChangeLog | 4 ++ EMU-ELS | 2 +- Makefile | 26 ++++----- 6 files changed, 178 insertions(+), 104 deletions(-) diff --git a/APEL-CFG b/APEL-CFG index 4eb425d..dc56510 100644 --- a/APEL-CFG +++ b/APEL-CFG @@ -3,21 +3,54 @@ ;;; Commentary: ;; Use this file to override variables defined in APEL-MK. +;; +;; The following variables are used in APEL-MK. +;; Note that you cannot use them in this file. +;; +;; For Emacs, or XEmacs without package system: +;; +;; PREFIX: Normally, "/usr/local". +;; Installer will try to detect it automatically. +;; LISPDIR: "PREFIX/share/emacs/site-lisp" if Emacs 19.29 and later. +;; "PREFIX/lib/emacs/site-lisp" if Emacs 19.28 and earlier. +;; Installer will try to detect it from PREFIX. +;; VERSION_SPECIFIC_LISPDIR: "PREFIX/share/emacs/VERSION/site-lisp" +;; if Emacs 19.31 and later, otherwise, same as LISPDIR. +;; +;; APEL_PREFIX: subdirectory of LISPDIR where APEL modules will be +;; installed, or "" if you don't want to make subdirectory. +;; EMU_PREFIX: subdirectory of VERSION_SPECIFIC_LISPDIR where EMU +;; modules will be installed, or "" if you don't want to +;; make subdirectory. +;; +;; APEL_DIR: The directory where APEL modules will be installed. +;; Generated from LISPDIR and APEL_DIR if it is not set. +;; EMU_DIR: The directory where EMU modules will be installed. +;; Generated from VERSION_SPECIFIC_LISPDIR and EMU_DIR if +;; it is not set. +;; +;; For XEmacs with package system: +;; +;; PACKAGEDIR: "/usr/local/lib/xemacs/xemacs-packages" +;; Installer will try to detect it automatically. +;; +;; APEL_PREFIX: subdirectory of PACKAGEDIR where both APEL and EMU +;; modules will be installed. ;;; Code: ;;; "custom" library. -;; If you use "new custom" but do not use "subdirs.el" to add "custom" -;; to your load-path, uncomment and edit this. +;; If you want to use "new custom" but do not use "subdirs.el" to add +;; "custom" directory to your load-path, uncomment and edit this. ;; (setq load-path ;; (cons "/usr/local/share/emacs/19.34/site-lisp/custom" load-path)) ;;; Install to home directory. -;; If you want to install APEL to home directory and you already have -;; the standard hierarchy such as "~/share/emacs/site-lisp" and +;; If you want to install APEL to your home directory and you already +;; have the standard hierarchy such as "~/share/emacs/site-lisp" and ;; "~/share/emacs/VERSION/site-lisp", uncomment and edit this. ;; (setq PREFIX "~/") @@ -28,9 +61,6 @@ ;;; Install to site-lisp directories. -;; (setq APEL_PREFIX "apel") -;; (setq EMU_PREFIX "emu") - ;; (setq PREFIX "/usr/local") ;; Mule based on Emacs 19.28 and eariler. @@ -44,12 +74,15 @@ ;; XEmacs 21.0 and later. ;; (setq PACKAGEDIR "/usr/local/lib/xemacs/xemacs-packages") -;; If you want to install all of APEL files to VERSION_SPECIFIC_LISPDIR, -;; uncomment this. -;; (setq APEL_DIR (expand-file-name APEL_PREFIX VERSION_SPECIFIC_LISPDIR)) +;; (setq APEL_PREFIX "apel") +;; (setq EMU_PREFIX "emu") + +;; If you want to install all of APEL modules to VERSION_SPECIFIC_LISPDIR, +;; uncomment and edit this. +;; (setq APEL_DIR "/usr/local/share/emacs/19.34/site-lisp/apel") -;; You can specify APEL_DIR and EMU_DIR directly. -;; (setq APEL_DIR (expand-file-name APEL_PREFIX LISPDIR)) -;; (setq EMU_DIR (expand-file-name EMU_PREFIX VERSION_SPECIFIC_LISPDIR)) +;; You can specify APEL_DIR and EMU_DIR directly. Uncomment and edit this. +;; (setq APEL_DIR "/usr/local/share/emacs/site-lisp/apel") +;; (setq EMU_DIR "/usr/local/share/emacs/19.34/site-lisp/emu") ;;; APEL-CFG ends here diff --git a/APEL-ELS b/APEL-ELS index afa95a5..98de7e6 100644 --- a/APEL-ELS +++ b/APEL-ELS @@ -1,4 +1,4 @@ -;;; APEL-ELS --- list of APEL modules to install -*-Emacs-Lisp-*- +;;; APEL-ELS --- list of APEL modules to install. -*-Emacs-Lisp-*- ;;; Commentary: diff --git a/APEL-MK b/APEL-MK index b2a0758..1a1b48a 100644 --- a/APEL-MK +++ b/APEL-MK @@ -8,57 +8,45 @@ ;;; Configuration variables. -;; These two variables will be generated from other variables below. -(defvar APEL_DIR nil) -(defvar EMU_DIR nil) +;; Set these four variables in "APEL-CFG" or in "Makefile". -;; Install to "apel" subdirectory. +;; This variable will be detected automatically. +(defvar PREFIX nil) + +;; This variable will be detected automatically using PREFIX. +;; v18: (no standard site-lisp directory) +;; Emacs 19.28 and earlier: "PREFIX/lib/emacs/site-lisp" +;; Emacs 19.29 and later: "PREFIX/share/emacs/site-lisp" +(defvar LISPDIR nil) + +;; This variable will be detected automatically using PREFIX. +;; Emacs 19.31 and later: "PREFIX/share/emacs/VERSION/site-lisp" +(defvar VERSION_SPECIFIC_LISPDIR nil) + +;; This variable will be detected automatically. +;; XEmacs 21.0 and later: "/usr/local/lib/xemacs/xemacs-packages" +(defvar PACKAGEDIR nil) + +;; Install APEL modules to "apel" subdirectory. (defvar APEL_PREFIX "apel") -;; Install to "emu" subdirectory if emacs supports some features. + +;; Install EMU modules to "emu" subdirectory if emacs supports some features. +;; If your emacs does not have `normal-top-level-add-subdirs-to-load-path' +;; but have `normal-top-level-add-to-load-path' and you want to use it in +;; "subdirs.el", put the following line to "APEL-CFG". +;; (setq EMU_PREFIX "emu") (defvar EMU_PREFIX (if (or (featurep 'xemacs) (fboundp 'normal-top-level-add-subdirs-to-load-path)) - ;; Install to "emu" subdirectory. + ;; Make "emu" subdirectory. "emu" - ;; If your emacs does not have `normal-top-level-add-subdirs-to-load-path' - ;; but have `normal-top-level-add-to-load-path' and you want to use it in - ;; "subdirs.el", put the following line to "APEL-CFG". - ;; (setq EMU_PREFIX "emu") + ;; Don't make "emu" subdirectory. "")) -;; We can load APEL modules safely;-) -(defvar default-load-path load-path) -(setq load-path (cons (expand-file-name ".") load-path)) -(require 'poe) -(require 'path-util) -(require 'install) - -;; Override everything you want. -(load-file "APEL-CFG") - -;; The following four variables will be overrided by command line options. -(defvar PREFIX install-prefix) -;; v18: (no standard site-lisp directory) -;; Emacs 19.28 and earlier: "PREFIX/lib/emacs/site-lisp" -;; Emacs 19.29 and later: "PREFIX/share/emacs/site-lisp" -(defvar LISPDIR - (install-detect-elisp-directory PREFIX)) -;; Emacs 19.31 and later: "PREFIX/share/emacs/VERSION/site-lisp". -(defvar VERSION_SPECIFIC_LISPDIR - (install-detect-elisp-directory PREFIX nil 'version-specific)) -;; for XEmacs package system. -(defvar PACKAGEDIR - (if (boundp 'early-packages) - (let ((dirs (append (if early-package-load-path - early-packages) - (if late-package-load-path - late-packages) - (if last-package-load-path - last-packages))) - dir) - (while (not (file-exists-p (setq dir (car dirs)))) - (setq dirs (cdr dirs))) - dir))) +;; The directories where APEL and EMU modules will be installed. +;; These two variables will be generated from other variables above. +(defvar APEL_DIR nil) ; LISPDIR/APEL_PREFIX +(defvar EMU_DIR nil) ; VERSION_SPECIFIC_LISPDIR/EMU_PREFIX ;;; Utilities. (XXX: should be moved to install.el ?) @@ -89,11 +77,12 @@ (expand-file-name "custom-load.elc" dir)))) (t (setq autoload-package-name package) - (add-to-list 'command-line-args-left dir) - (batch-update-directory) - (add-to-list 'command-line-args-left dir) - (Custom-make-dependencies) + (let ((command-line-args-left (list dir))) + (batch-update-directory)) + + (let ((command-line-args-left (list dir))) + (Custom-make-dependencies)) (byte-compile-file (expand-file-name "auto-autoloads.el" dir)) (byte-compile-file (expand-file-name "custom-load.el" dir))))) @@ -102,11 +91,14 @@ ;;; Configure, Compile, and Install. (defun config-apel () + ;; 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) - ;; override standard PREFIX, LISPDIR, and VERSION_SPECIFIC_LISPDIR - ;; with command-line options. (and (setq prefix (prog1 - ;; avoid using `pop'. + ;; Avoid using `pop'. + ;; (pop command-line-args-left) (car command-line-args-left) (setq command-line-args-left (cdr command-line-args-left)))) @@ -124,51 +116,94 @@ (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))) - ;; directories we actually use. - (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))) - ;; import `apel-modules'. - (load-file "APEL-ELS") - ;; import `emu-modules' and `emu-modules-to-compile'. - (load-file "EMU-ELS") - (princ (format "\nLISPDIR=%s\n" LISPDIR)) - (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n" VERSION_SPECIFIC_LISPDIR)))) + (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) + + ;; We use `module-installed-p' in "EMU-ELS". + ;; 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))) (defun compile-apel () (config-apel) - ;; compile emu modules first. + ;; Compile emu modules first. (compile-elisp-modules emu-modules-to-compile ".") (compile-elisp-modules apel-modules ".")) (defun install-apel () - (compile-apel) + (config-apel) (let ((just-print (install-just-print-p))) - (install-elisp-modules emu-modules "." EMU_DIR just-print) - (install-elisp-modules apel-modules "." APEL_DIR just-print))) + (install-elisp-modules emu-modules "." EMU_DIR just-print) + (install-elisp-modules apel-modules "." APEL_DIR just-print))) -;; for XEmacs package system. +;; For XEmacs package system. (defun config-apel-package () + ;; Override everything you want. + (load-file "APEL-CFG") + ;; Override PACKAGEDIR with command-line option. (let (package-dir) - ;; override standard PACKAGEDIR with command-line option. (and (setq package-dir (prog1 - ;; avoid using `pop'. (car command-line-args-left) (setq command-line-args-left (cdr command-line-args-left)))) (or (string= "NONE" package-dir) - (defvar PACKAGEDIR package-dir))) - ;; import `apel-modules'. - (load-file "APEL-ELS") - ;; import `emu-modules' and `emu-modules-to-compile'. - (load-file "EMU-ELS") - (princ (format "\nPACKAGEDIR=%s\n" PACKAGEDIR)))) + (setq PACKAGEDIR package-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) + + ;; We use `module-installed-p' in "EMU-ELS". + ;; Import `apel-modules'. + (load-file "APEL-ELS") + ;; Import `emu-modules' and `emu-modules-to-compile'. + (load-file "EMU-ELS") + + ;; Set PACKAGEDIR if not set yet. + (or PACKAGEDIR + (setq PACKAGEDIR + (if (boundp 'early-packages) + (let ((dirs (append (if early-package-load-path + early-packages) + (if late-package-load-path + late-packages) + (if last-package-load-path + last-packages))) + dir) + (while (not (file-exists-p (setq dir (car dirs)))) + (setq dirs (cdr dirs))) + dir)))) + (if PACKAGEDIR + (princ (format "\nPACKAGEDIR=%s\n" PACKAGEDIR)) + (error "XEmacs package system is not available"))) (defun compile-apel-package () (config-apel-package) - ;; compile emu modules first. + ;; Compile emu modules first. (compile-elisp-modules emu-modules-to-compile ".") (compile-elisp-modules apel-modules ".")) @@ -191,6 +226,8 @@ The files that belong to the EMU modules: The files that belong to the APEL modules: %s -> %s + +Do `make elc', `make install', `make package', or `make install-package'. " (mapconcat (function symbol-name) emu-modules ", ") EMU_DIR diff --git a/ChangeLog b/ChangeLog index 9426b1a..b29cc8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1999-11-13 Shuhei KOBAYASHI + + * APEL-MK, APEL-CFG, APEL-ELS, EMU-ELS, Makefile: Revised. + 1999-11-12 Shuhei KOBAYASHI * inv-18.el, inv-19.el, inv-xemacs.el: diff --git a/EMU-ELS b/EMU-ELS index 92060ad..0fc15d9 100644 --- a/EMU-ELS +++ b/EMU-ELS @@ -1,4 +1,4 @@ -;;; EMU-ELS --- list of EMU modules to install -*-Emacs-Lisp-*- +;;; EMU-ELS --- list of EMU modules to install. -*-Emacs-Lisp-*- ;;; Commentary: diff --git a/Makefile b/Makefile index 040b05c..350c845 100644 --- a/Makefile +++ b/Makefile @@ -21,25 +21,25 @@ GOMI = *.elc ARCHIVE_DIR_PREFIX = /pub/mule -elc: - $(EMACS) $(FLAGS) -f compile-apel +what-where: + $(EMACS) $(FLAGS) -f what-where-apel \ + $(PREFIX) $(LISPDIR) $(VERSION_SPECIFIC_LISPDIR) -install: - $(EMACS) $(FLAGS) -f install-apel $(PREFIX) $(LISPDIR) \ - $(VERSION_SPECIFIC_LISPDIR) # $(MAKE) +elc: + $(EMACS) $(FLAGS) -f compile-apel \ + $(PREFIX) $(LISPDIR) $(VERSION_SPECIFIC_LISPDIR) +install: elc + $(EMACS) $(FLAGS) -f install-apel \ + $(PREFIX) $(LISPDIR) $(VERSION_SPECIFIC_LISPDIR) # $(MAKE) package: - $(XEMACS) $(FLAGS) -f compile-apel-package $(PACKAGEDIR) + $(XEMACS) $(FLAGS) -f compile-apel-package \ + $(PACKAGEDIR) install-package: package - $(XEMACS) $(FLAGS) -f install-apel-package $(PACKAGEDIR) \ - # $(MAKE) - - -what-where: - $(EMACS) $(FLAGS) -f what-where-apel $(PREFIX) $(LISPDIR) \ - $(VERSION_SPECIFIC_LISPDIR) + $(XEMACS) $(FLAGS) -f install-apel-package \ + $(PACKAGEDIR) # $(MAKE) clean: -- 1.7.10.4