(What's tm?): Don't use section number.
[elisp/tm.git] / TM-CFG
diff --git a/TM-CFG b/TM-CFG
index b434a38..2b7126b 100644 (file)
--- a/TM-CFG
+++ b/TM-CFG
 ;;; -*-Emacs-Lisp-*-
-;;;
-;;; $Id: TM-CFG,v 2.0 1996/03/11 14:54:25 morioka Exp $
-;;;
 
+;; TM-CFG: installation setting about tm-oomori.
+
+;;; Code:
+
+(defvar default-load-path load-path)
 (setq load-path (append
                 (mapcar (function
                          (lambda (path)
-                           (expand-file-name path (getenv "PWD"))
+                           (expand-file-name path default-directory)
                            ))
-                        '("." "../tl/" "../mel/" "mh-e/")
+                        '("." "../apel" "../tl" "../bitmap-mule"
+                          "../mu" "../flim"
+                          "../tm-mh-e" "../gnus-mime" "../tm-gnus"
+                          "../tm-mail" "../tm-vm")
                         )
                 load-path))
 
 (require 'tl-misc)
+(require 'install)
+
+
+;;; @ Please specify optional package directory if you use them.
+;;;
+
+;; It is only necessary to use `add-path' if these packages are not
+;; already on the standard load-path of Emacs.
+
+;; Function `get-latest-path' detect latest version of such package
+;; under load-path directories. If you want to use a version of a
+;; package instead of latest version, please specify by argument of
+;; function `add-path'.
+
+;; Function `add-path' finds path under load-path directories. If a
+;; package does not exist in load-path, please specify by absolutely
+;; (`~/' is available), for example
+;;     (add-path "~/lib/elisp/mailcrypt-3.4")
+;; or
+;;     (add-path "/opt/share/xmule/site-lisp/mailcrypt-3.4")
+
+;;; @@ Please specify VM path.
+;;;
 
+;; Use latest version installed in load-path.
 
-;; Please specify VM path.
-(add-path "vm-5.95beta/" 'all-paths)
+(let ((path (get-latest-path "vm" 'all-paths)))
+  (if path
+      (add-path path)
+    ))
 
-;; Please specify Mailcrypt path.
-(add-path "mailcrypt-3.4/" 'all-paths)
+;; Or please specify path.
+;; (add-path "vm-5.95beta" 'all-paths)
 
-;; Please specify BBDB path.
-(add-path "bbdb-1.50/" 'all-paths)
+
+;;; @@ Please specify Mailcrypt path.
+;;;
+
+;; Use latest version installed in load-path.
+
+(let ((path (get-latest-path "mailcrypt" 'all-paths)))
+  (if path
+      (add-path path)
+    ))
+
+;; Or please specify path.
+;; (add-path "mailcrypt-3.4" 'all-paths)
+
+
+;;; @@ Please specify BBDB path.
+;;;
+
+(let ((path (get-latest-path "bbdb" 'all-paths)))
+  (if path
+      (add-path path)
+    ))
+
+;; Or please specify path.
+;; (add-path "bbdb-1.50" 'all-paths)
+
+
+;;; @ shell
+;;;
 
 ;; Please specify shell command path.
-(setq SHELL "/bin/sh")
+(setq SHELL
+      (find-if (function file-exists-p)
+              '("/bin/sh" "/usr/bin/sh")
+              ))
 
 ;; Please specify shell command option.
 (setq SHELLOPTION "-c")
 
+
+;;; @ Please specify prefix of install directory.
+;;;
+
 ;; Please specify install path prefix.
-(setq PREFIX "~/")
-;;(setq PREFIX "/usr/local/")
+;; If it is omitted, shared directory (maybe /usr/local is used).
+(defvar PREFIX install-prefix)
+;;(setq PREFIX "~/")
 
-(setq EMACS_PREFIX
-      (cond ((boundp 'NEMACS) "nemacs/")
-           ((boundp 'MULE)   "mule/")
-           ((string-match "XEmacs" emacs-version) "xemacs/")
-           (t "emacs/")
-           ))
+;; Please specify install path prefix for binaries.
+(defvar EXEC_PREFIX
+  (if (or running-emacs-18 running-xemacs)
+      (expand-file-name "../../.." exec-directory)
+    (expand-file-name "../../../.." exec-directory)
+    ))
 
-(setq DATA_PREFIX
-      (if (or (< emacs-major-version 19)
-             (< emacs-minor-version 29)
-             )
-         "lib/"
-       "share/"))
+;; Please specify emu prefix [optional]
+(setq EMU_PREFIX
+      (if (string-match "XEmacs" emacs-version)
+         "emu"
+       ""))
 
-(setq DATADIR (expand-file-name DATA_PREFIX PREFIX))
+;; Please specify emu prefix [optional]
+(setq APEL_PREFIX
+      (if (string-match "XEmacs" emacs-version)
+         "apel"
+       ""))
 
-(setq LISP_PREFIX
-      (if (>= emacs-major-version 19)
-         "site-lisp/"
-       "local.lisp/"))
+;; Please specify tl prefix [optional]
+;;(setq TL_PREFIX "tl")
+(setq TL_PREFIX
+      (if (string-match "XEmacs" emacs-version)
+         "tl"
+       ""))
 
-(setq EMACS_DATADIR (expand-file-name EMACS_PREFIX DATADIR))
+;; Please specify prefix for ``bitmap-mule'' [optional]
+(setq BITMAP_PREFIX "bitmap")
 
-(defvar LISPDIR (expand-file-name LISP_PREFIX EMACS_DATADIR))
+;; Please specify MU prefix [optional]
+(setq MU_PREFIX "mu")
 
+;; Please specify FLIM prefix [optional]
+(setq FLIM_PREFIX "flim")
 
-;; Please specify mime-setup.{el|elc} install path.
-(setq SETUP_FILE_DIR LISPDIR)
+;; Please specify tm prefix [optional]
+(setq TM_PREFIX "tm")
 
+;; lisp files of tm are installed into following directory tree:
+;;
+;;     <LISPDIR> = <PREFIX>/DATA_PREFIX/<install-elisp-prefix>/
+;;     <LISPDIR>/mime-setup.{el|elc}
+;;     <LISPDIR>/<TL_PREFIX>/          --- tl lisp files
+;;     <LISPDIR>/<BITMAP_PREFIX>/      --- bitmap lisp files
+;;     <LISPDIR>/<MU_PREFIX>/          --- MU lisp files
+;;     <LISPDIR>/<MEL_PREFIX>/         --- MEL lisp files
+;;     <LISPDIR>/<TM_PREFIX>/          --- tm lisp files
+;;
+;; For example, if <PREFIX> = "/usr/local" and you use Emacs 19.34,
+;;
+;;     <LISPDIR> = /usr/local/share/emacs/site-lisp/
+;;     /usr/local/share/emacs/site-lisp/mime-setup.{el|elc}
+;;     /usr/local/share/emacs/site-lisp/       --- tl  lisp files
+;;     /usr/local/share/emacs/site-lisp/mu/    --- MU lisp files
+;;     /usr/local/share/emacs/site-lisp/mel/   --- MEL lisp files
+;;     /usr/local/share/emacs/site-lisp/tm/    --- tm  lisp files
+;;
+;; For example, if <PREFIX> = "~/" and you use XEmacs,
+;;
+;;     <LISPDIR> = ~/share/xemacs/site-lisp/
+;;     ~/lib/xemacs/site-lisp/mime-setup.{el|elc}
+;;     ~/lib/xemacs/site-lisp/tl/  --- tl  lisp files
+;;     ~/lib/xemacs/site-lisp/mu/  --- MU  lisp files
+;;     ~/lib/xemacs/site-lisp/mel/ --- MEL lisp files
+;;     ~/lib/xemacs/site-lisp/tm/  --- tm  lisp files
 
-(setq TM_PREFIX "")
 
-(setq TM_LISPDIR (expand-file-name TM_PREFIX LISPDIR))
+;;; @ executables
+;;;
 
-(setq TL_DIR (expand-file-name "tl/" TM_LISPDIR))
-(setq MEL_DIR (expand-file-name "mel/" TM_LISPDIR))
-(setq TM_KERNEL_DIR (expand-file-name "tm/" TM_LISPDIR))
-(setq TM_MHE_DIR TM_KERNEL_DIR)
-(setq TM_GNUS_DIR TM_KERNEL_DIR)
+;; Please specify binary path.
+(defvar BIN_DIR (expand-file-name "bin" EXEC_PREFIX))
 
-(setq TM_GNUS_COMPILE_FORMAT "cd gnus; PWD=`pwd` make %s EMACS=%s")
-(setq TM_GNUS_INSTALL_FORMAT "cd gnus; PWD=`pwd` make install-19 EMACS=%s TMDIR19=%s")
+;; Please specify binary path. (for external method scripts)
+(setq METHOD_DIR (expand-file-name "share/tm" PREFIX))
 
-(setq el-file-mode (+ (* 64 6)(* 8 4) 4))
 
+\f
 
-(setq BIN_SRC_DIR "src/")
-(setq BINS '("src/ol2" "src/decode-b"))
-(setq METHOD_SRC_DIR "methods/")
-(setq METHODS
-      '("tm-au" "tm-file" "tm-html" "tm-image" "tm-mpeg" "tm-plain"
-       "tmdecode"))
+;;; @ optional settings
+;;;
 
+;; It is generated by automatically. Please set variable `PREFIX'.
+;; If you don't like default directory tree, please set it.
+(defvar LISPDIR (install-detect-elisp-directory PREFIX))
+;; (setq install-default-elisp-directory "~/lib/emacs/lisp")
 
-;; Please specify binary path.
-(defvar BIN_DIR (expand-file-name "bin/" PREFIX))
+(setq EMU_DIR
+      (expand-file-name
+       EMU_PREFIX
+       (install-detect-elisp-directory PREFIX nil 'version-specific)))
 
-;; Please specify binary path.
-(setq METHOD_DIR BIN_DIR)
+;; Please specify mime-setup.{el|elc} install path.
+(setq SETUP_FILE_DIR LISPDIR)
+
+(setq APEL_DIR         (expand-file-name APEL_PREFIX   LISPDIR))
+(setq TL_DIR           (expand-file-name TL_PREFIX     LISPDIR))
+(setq BITMAP_DIR       (expand-file-name BITMAP_PREFIX LISPDIR))
+(setq MU_DIR           (expand-file-name MU_PREFIX     LISPDIR))
+(setq FLIM_DIR         (expand-file-name FLIM_PREFIX   LISPDIR))
+(setq TM_KERNEL_DIR    (expand-file-name TM_PREFIX     LISPDIR))
+(setq TM_MHE_DIR       TM_KERNEL_DIR)
+(setq TM_GNUS_DIR      TM_KERNEL_DIR)
+(setq Gnus_MIME_DIR    TM_KERNEL_DIR)
+(setq TM_MAIL_DIR      TM_KERNEL_DIR)
+(setq TM_VM_DIR                TM_KERNEL_DIR)
+
+(cond ((member LISPDIR default-load-path)
+       (setq APEL_RELATIVE_DIR         APEL_PREFIX)
+       (setq TL_RELATIVE_DIR           TL_PREFIX)
+       (setq BITMAP_RELATIVE_DIR       BITMAP_PREFIX)
+       (setq MU_RELATIVE_DIR           MU_PREFIX)
+       (setq FLIM_RELATIVE_DIR         FLIM_PREFIX)
+       (setq TM_KERNEL_RELATIVE_DIR    TM_PREFIX)
+       )
+      ((string-match (concat "^" (regexp-quote (expand-file-name "~/")))
+                    LISPDIR)
+       (setq APEL_RELATIVE_DIR
+            (concat "~/" (file-relative-name APEL_DIR "~/"))
+            )
+       (setq TL_RELATIVE_DIR
+            (concat "~/" (file-relative-name TL_DIR "~/"))
+            )
+       (setq BITMAP_RELATIVE_DIR
+            (concat "~/" (file-relative-name BITMAP_DIR "~/"))
+            )
+       (setq MU_RELATIVE_DIR
+            (concat "~/" (file-relative-name MU_DIR "~/"))
+            )
+       (setq FLIM_RELATIVE_DIR
+            (concat "~/" (file-relative-name FLIM_DIR "~/"))
+            )
+       (setq TM_KERNEL_RELATIVE_DIR
+            (concat "~/" (file-relative-name TM_KERNEL_DIR "~/"))
+            )
+       )
+      (t
+       (setq APEL_RELATIVE_DIR         APEL_DIR)
+       (setq TL_RELATIVE_DIR           TL_DIR)
+       (setq BITMAP_RELATIVE_DIR       BITMAP_DIR)
+       (setq MU_RELATIVE_DIR           MU_DIR)
+       (setq FLIM_RELATIVE_DIR         FLIM_DIR)
+       (setq TM_KERNEL_RELATIVE_DIR    TM_KERNEL_DIR)
+       ))
+(setq TM_MHE_RELATIVE_DIR      TM_KERNEL_RELATIVE_DIR)
+(setq TM_GNUS_RELATIVE_DIR     TM_KERNEL_RELATIVE_DIR)
+
+(setq TM_GNUS_INSTALL_FORMAT
+      "cd gnus; make install-19 EMACS=%s TMDIR19=%s")
+(setq TM_GNUS_COMPILE ".gnus-compile")
+(setq MAKE "make")
+
+
+(setq BIN_SRC_DIR "src")
+(setq BINS '("ol2" "decode-b"))
+(setq METHOD_SRC_DIR "methods")
+(setq METHODS
+      '("tm-au" "tm-file" "tm-html" "tm-image" "tm-mpeg"
+       "tm-plain" "tm-ps"
+       "tmdecode"))
+
+;;; TM-CFG ends here