tm 7.99.
[elisp/tm.git] / inst-tm
1 ;;; -*-Emacs-Lisp-*-
2 ;;;
3 ;;; $Id: inst-tm,v 7.41 1996/11/15 12:14:02 morioka Exp $
4 ;;;
5
6 (defun config-tm ()
7   (let (prefix exec-prefix)
8     (setq prefix (car command-line-args-left))
9     (and prefix
10          (not (string-equal "NONE" prefix))
11          (progn
12            (defvar PREFIX prefix)
13            (setq command-line-args-left (cdr command-line-args-left))
14            )
15          (setq exec-prefix (car command-line-args-left))
16          (progn
17            (defvar EXEC_PREFIX exec-prefix)
18            ;;(setq command-line-args-left (cdr command-line-args-left))
19            )))
20   (load-file "TM-CFG")
21   (load-file "../emu/EMU-ELS")
22   (load-file "../tl/TL-ELS")
23   (load-file "../mu/MU-ELS")
24   (load-file "../mel/MEL-ELS")
25   (load-file "TM-ELS")
26   (load-file "../tm-mh-e/TMH-ELS")
27   (load-file "../tm-mail/TMAIL-ELS")
28   (load-file "../tm-vm/TM-VM-ELS")
29   (princ (format "PREFIX=%s\tEXEC_PREFIX=%s\n" PREFIX EXEC_PREFIX))
30   )
31
32 (defun make-mime-setup (tl-absolute-path tl-path mu-path mel-path tm-path)
33   (let ((buf (find-file "mime-setup.el.in")))
34     (goto-char (point-min))
35     (re-search-forward "^;;; Code:\n" nil t)
36     (setq buffer-read-only nil)
37
38     ;; generate tl setting
39     (if (member tl-absolute-path default-load-path)
40         (insert "\n(require \'tl-misc)")
41       (insert
42        (format "
43
44 \(let ((load-path
45        (cons \"%s\"
46              load-path)))
47   (require \'tl-misc)
48   )
49 \(add-path \"%s\")" tl-absolute-path tl-path))
50       )
51     
52     ;; generate MU load-path setting
53     (or (member mu-path default-load-path)
54         (insert (format "\n(add-path \"%s\")" mu-path)))
55     
56     ;; generate MEL load-path setting
57     (or (member mel-path default-load-path)
58         (insert (format "\n(add-path \"%s\")" mel-path)))
59     
60     ;; generate tm load-path setting
61     (or (member tm-path default-load-path)
62         (insert (format "\n(add-path \"%s\")" tm-path)))
63     
64     ;; generate tm external-methods path setting
65     (or (string= METHOD_DIR exec-directory)
66         (insert
67          (format "\n(defvar mime-viewer/external-progs %s)"
68                  (let ((dir (file-relative-name METHOD_DIR data-directory)))
69                    (if (< (length dir) (length METHOD_DIR))
70                        (concat "\n  (expand-file-name \""
71                                dir "\" data-directory)")
72                      (setq dir (file-relative-name METHOD_DIR
73                                                    (expand-file-name "~/")))
74                      (if (< (length dir) (length METHOD_DIR))
75                          (concat "\n  (expand-file-name \"~/"
76                                  dir "\")")
77                        (concat "\"" METHOD_DIR "\"")
78                        )))
79                  ))
80         )
81     (write-file "mime-setup.el")
82     ))
83
84 (defun compile-tm ()
85   (config-tm)
86   (print load-path)
87   (require 'mel-u)
88   (require 'tm-edit)
89   (load "rmailsum")
90   (require 'tm-mh-e)
91   (make-mime-setup TL_DIR TL_RELATIVE_DIR MU_RELATIVE_DIR
92                    MEL_RELATIVE_DIR TM_KERNEL_RELATIVE_DIR)
93   (compile-elisp-modules emu-modules            "../emu")
94   (compile-elisp-modules tl-modules             "../tl")
95   (compile-elisp-modules mu-modules-to-compile  "../mu")
96   (compile-elisp-modules mel-modules            "../mel")
97   (compile-elisp-modules tm-modules-to-compile  ".")
98   (compile-elisp-modules tm-mh-e-modules        "../tm-mh-e")
99   (compile-elisp-module  'mime-setup            ".")
100   (require 'gnus)
101   (cond ((featurep 'gnus-ems)
102          (load "../gnus-mime/Gnus-MIME-ELS")
103          (compile-elisp-modules gnus-mime-modules-to-compile "../gnus-mime")
104          )
105         (t
106          (load "../tm-gnus/TGNUS-ELS")
107          (compile-elisp-modules tm-gnus-modules-to-compile "../tm-gnus")
108          ))
109   (compile-elisp-modules tm-mail-modules        "../tm-mail")
110   (compile-elisp-modules tm-vm-modules-to-compile "../tm-vm")
111   )
112
113 (defun install-tm ()
114   (config-tm)
115   (princ (format "%s\n" emacs-version))
116   (install-elisp-modules emu-modules     "../emu"       EMU_DIR)
117   (install-elisp-modules tl-modules      "../tl"        TL_DIR)
118   (install-elisp-modules mu-modules      "../mu"        MU_DIR)
119   (install-elisp-modules mel-modules     "../mel"       MEL_DIR)
120   (install-elisp-modules tm-modules      "."            TM_KERNEL_DIR)
121   (install-elisp-modules tm-mh-e-modules "../tm-mh-e"   TM_MHE_DIR)
122   ;;(install-tm-gnus)
123   (require 'gnus)
124   (cond ((featurep 'gnus-ems)
125          (load "../gnus-mime/Gnus-MIME-ELS")
126          (install-elisp-modules gnus-mime-modules
127                                 "../gnus-mime" Gnus_MIME_DIR)
128          )
129         (t
130          (load "../tm-gnus/TGNUS-ELS")
131          (install-elisp-modules tm-gnus-modules "../tm-gnus" TM_GNUS_DIR)
132          ))
133   (install-elisp-modules tm-mail-modules "../tm-mail"   TM_MAIL_DIR)
134   (install-elisp-modules tm-vm-modules   "../tm-vm"     TM_VM_DIR)
135   (install-elisp-modules '(mime-setup)   "."    SETUP_FILE_DIR)
136   )
137
138 (defun install-execs ()
139   (config-tm)
140   (install-files BINS       BIN_SRC_DIR    BIN_DIR)
141   (install-files METHODS METHOD_SRC_DIR METHOD_DIR nil t)
142   )
143
144 ;;; inst-tm ends here