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