* mu-register.el (mu-cite-save-registration-file): Use
[elisp/mu-cite.git] / MU-MK
1 ;;; -*-Emacs-Lisp-*-
2
3 ;; MU-MK: installer for mu-cite.
4
5 ;;; Code:
6
7 (defun config-mu ()
8   (let (prefix lisp-dir version-specific-lisp-dir)
9     (and (setq prefix (car command-line-args-left))
10          (or (string-equal "NONE" prefix)
11              (defvar PREFIX prefix)))
12     (setq command-line-args-left (cdr command-line-args-left))
13     (and (setq lisp-dir (car command-line-args-left))
14          (or (string-equal "NONE" lisp-dir)
15              (defvar LISPDIR lisp-dir)))
16     (setq command-line-args-left (cdr command-line-args-left))
17     (and (setq version-specific-lisp-dir (car command-line-args-left))
18          (or (string-equal "NONE" version-specific-lisp-dir)
19              (progn
20                (defvar VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir)
21                (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n"
22                               VERSION_SPECIFIC_LISPDIR)))))
23     (setq command-line-args-left (cdr command-line-args-left))
24     (load-file "MU-CFG")
25     (load-file "MU-ELS")
26     (princ (format "PREFIX=%s
27 LISPDIR=%s\n" PREFIX LISPDIR))))
28
29 (defun compile-mu ()
30   (config-mu)
31   (compile-elisp-modules mu-modules-to-compile "."))
32
33 (defun install-mu ()
34   (config-mu)
35   (install-elisp-modules mu-modules "./" MU_DIR))
36
37 (defun config-mu-package ()
38   (let (package-dir)
39     (and (setq package-dir (car command-line-args-left))
40          (or (string= "NONE" package-dir)
41              (defvar PACKAGEDIR package-dir)))
42     (setq command-line-args-left (cdr command-line-args-left))
43     (load-file "MU-CFG")
44     (load-file "MU-ELS")
45     (setq mu-modules (append mu-modules
46                              '(auto-autoloads custom-load)))
47     (princ (format "PACKAGEDIR=%s\n" PACKAGEDIR))))
48
49 (defun compile-mu-package ()
50   (config-mu-package)
51
52   (setq autoload-package-name "mu")
53   (add-to-list 'command-line-args-left ".")
54   (batch-update-directory)
55
56   (add-to-list 'command-line-args-left ".")
57   (Custom-make-dependencies)
58
59   (compile-elisp-modules mu-modules "."))
60
61 (defun install-mu-package ()
62   (config-mu-package)
63   (install-elisp-modules mu-modules
64                          "./"
65                          (expand-file-name MU_PREFIX
66                                            (expand-file-name "lisp"
67                                                              PACKAGEDIR))))
68
69 (load "bytecomp" nil t)
70
71 (if (fboundp 'byte-compile-file-form-custom-declare-variable)
72     nil
73   ;; Bind defcustom'ed variables when byte-compiling.
74   (put 'custom-declare-variable 'byte-hunk-handler
75        'byte-compile-file-form-custom-declare-variable)
76   (defun byte-compile-file-form-custom-declare-variable (form)
77     (if (memq 'free-vars byte-compile-warnings)
78         (setq byte-compile-bound-variables
79               (cons (nth 1 (nth 1 form)) byte-compile-bound-variables)))
80     form))
81
82 (cond ((featurep 'xemacs)
83        ;; Shut up!
84        (setq byte-compile-warnings
85              (delq 'unused-vars
86                    (copy-sequence byte-compile-default-warnings))))
87       ((and (boundp 'emacs-major-version)
88             (or (> emacs-major-version 20)
89                 (and (eq emacs-major-version 20)
90                      (>= emacs-minor-version 3))))
91        ;; Compiler macro for replacing `sref' with `aref'.
92        (put 'sref 'byte-optimizer
93             (lambda (form)
94               (cons 'aref (cdr form))))))
95
96 ;;; MU-MK ends here