tm 7.89.
[elisp/tm.git] / inst-tm
1 ;;; -*-Emacs-Lisp-*-
2 ;;;
3 ;;; $Id: inst-tm,v 7.39 1996/09/06 16:18:21 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:" 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     (insert
65      (format "\n(defvar mime-viewer/external-progs \"%s\")" METHOD_DIR))
66     (write-file "mime-setup.el")
67     ))
68
69 (defun compile-tm ()
70   (config-tm)
71   (print load-path)
72   (require 'mel-u)
73   (require 'tm-edit)
74   (load "rmailsum")
75   (require 'tm-mh-e)
76   (make-mime-setup TL_DIR TL_RELATIVE_DIR MU_RELATIVE_DIR
77                    MEL_RELATIVE_DIR TM_KERNEL_RELATIVE_DIR)
78   (compile-elisp-modules tl-modules             "../tl")
79   (compile-elisp-modules mu-modules-to-compile  "../mu")
80   (compile-elisp-modules mel-modules            "../mel")
81   (compile-elisp-modules tm-modules-to-compile  ".")
82   (compile-elisp-modules tm-mh-e-modules        "../tm-mh-e")
83   (compile-elisp-module  'mime-setup            ".")
84   (require 'gnus)
85   (cond ((featurep 'gnus-ems)
86          (load "../gnus-mime/Gnus-MIME-ELS")
87          (compile-elisp-modules gnus-mime-modules-to-compile "../gnus-mime")
88          )
89         (t
90          (load "../tm-gnus/TGNUS-ELS")
91          (compile-elisp-modules tm-gnus-modules-to-compile "../tm-gnus")
92          ))
93   (compile-elisp-modules tm-mail-modules        "../tm-mail")
94   (compile-elisp-modules tm-vm-modules-to-compile "../tm-vm")
95   )
96
97 (defun install-tm ()
98   (config-tm)
99   (princ (format "%s\n" emacs-version))
100   (print TL_DIR)
101   (install-elisp-modules tl-modules      "../tl"        TL_DIR)
102   (install-elisp-modules mu-modules      "../mu"        MU_DIR)
103   (install-elisp-modules mel-modules     "../mel"       MEL_DIR)
104   (install-elisp-modules tm-modules      "."            TM_KERNEL_DIR)
105   (install-elisp-modules tm-mh-e-modules "../tm-mh-e"   TM_MHE_DIR)
106   ;;(install-tm-gnus)
107   (require 'gnus)
108   (cond ((featurep 'gnus-ems)
109          (load "../gnus-mime/Gnus-MIME-ELS")
110          (install-elisp-modules gnus-mime-modules
111                                 "../gnus-mime" Gnus_MIME_DIR)
112          )
113         (t
114          (load "../tm-gnus/TGNUS-ELS")
115          (install-elisp-modules tm-gnus-modules "../tm-gnus" TM_GNUS_DIR)
116          ))
117   (install-elisp-modules tm-mail-modules "../tm-mail"   TM_MAIL_DIR)
118   (install-elisp-modules tm-vm-modules   "../tm-vm"     TM_VM_DIR)
119   (install-elisp-modules '(mime-setup)   "."    SETUP_FILE_DIR)
120   )
121
122 (defun install-execs ()
123   (config-tm)
124   (install-files BINS       BIN_SRC_DIR    BIN_DIR)
125   (install-files METHODS METHOD_SRC_DIR METHOD_DIR nil t)
126   )
127
128 ;;; inst-tm ends here