Date UT
[elisp/mu-cite.git] / MU-MK
diff --git a/MU-MK b/MU-MK
index 4a2427e..7fcc9a0 100644 (file)
--- a/MU-MK
+++ b/MU-MK
@@ -8,64 +8,63 @@
   (let (prefix lisp-dir version-specific-lisp-dir)
     (and (setq prefix (car command-line-args-left))
         (or (string-equal "NONE" prefix)
-            (defvar PREFIX prefix)
-            ))
+            (defvar PREFIX prefix)))
     (setq command-line-args-left (cdr command-line-args-left))
     (and (setq lisp-dir (car command-line-args-left))
         (or (string-equal "NONE" lisp-dir)
-            (defvar LISPDIR lisp-dir)
-            ))
+            (defvar LISPDIR lisp-dir)))
     (setq command-line-args-left (cdr command-line-args-left))
     (and (setq version-specific-lisp-dir (car command-line-args-left))
         (or (string-equal "NONE" version-specific-lisp-dir)
             (progn
               (defvar VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir)
               (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n"
-                             VERSION_SPECIFIC_LISPDIR)))
-            ))
+                             VERSION_SPECIFIC_LISPDIR)))))
     (setq command-line-args-left (cdr command-line-args-left))
     (load-file "MU-CFG")
     (load-file "MU-ELS")
     (princ (format "PREFIX=%s
-LISPDIR=%s\n" PREFIX LISPDIR))
-    ))
+LISPDIR=%s\n" PREFIX LISPDIR))))
 
 (defun compile-mu ()
   (config-mu)
-  (compile-elisp-modules mu-modules-to-compile ".")
-  )
+  (compile-elisp-modules mu-modules-to-compile "."))
 
 (defun install-mu ()
   (config-mu)
-  (install-elisp-modules mu-modules    "./"    MU_DIR)
-  )
+  (install-elisp-modules mu-modules "./" MU_DIR))
 
 (defun config-mu-package ()
   (let (package-dir)
     (and (setq package-dir (car command-line-args-left))
         (or (string= "NONE" package-dir)
-            (defvar PACKAGEDIR package-dir)
-            ))
+            (defvar PACKAGEDIR package-dir)))
     (setq command-line-args-left (cdr command-line-args-left))
     (load-file "MU-CFG")
     (load-file "MU-ELS")
-    (setq mu-modules (append mu-modules
-                              '(auto-autoloads custom-load)))
-    (princ (format "PACKAGEDIR=%s\n" PACKAGEDIR))
-    ))
+    (setq mu-modules-to-compile (append mu-modules-to-compile
+                                       '(auto-autoloads custom-load)))
+    (setq mu-modules (append mu-modules-to-compile
+                            mu-modules-not-to-compile))
+    (princ (format "PACKAGEDIR=%s\n" PACKAGEDIR))))
 
 (defun compile-mu-package ()
   (config-mu-package)
 
-  (setq autoload-package-name "mu")
-  (add-to-list 'command-line-args-left ".")
-  (batch-update-directory)
+  (if (fboundp 'batch-update-directory-autoloads)
+      ;; XEmacs 21.5.19 and newer.
+      (progn
+       (add-to-list 'command-line-args-left ".")
+       (add-to-list 'command-line-args-left "mu")
+       (batch-update-directory-autoloads))
+    (setq autoload-package-name "mu")
+    (add-to-list 'command-line-args-left ".")
+    (batch-update-directory))
 
   (add-to-list 'command-line-args-left ".")
   (Custom-make-dependencies)
 
-  (compile-elisp-modules mu-modules ".")
-  )
+  (compile-elisp-modules mu-modules-to-compile "."))
 
 (defun install-mu-package ()
   (config-mu-package)
@@ -73,7 +72,33 @@ LISPDIR=%s\n" PREFIX LISPDIR))
                         "./"
                         (expand-file-name MU_PREFIX
                                           (expand-file-name "lisp"
-                                                            PACKAGEDIR)))
-  )
+                                                            PACKAGEDIR))))
+
+(load "bytecomp" nil t)
+
+(if (fboundp 'byte-compile-file-form-custom-declare-variable)
+    nil
+  ;; Bind defcustom'ed variables when byte-compiling.
+  (put 'custom-declare-variable 'byte-hunk-handler
+       'byte-compile-file-form-custom-declare-variable)
+  (defun byte-compile-file-form-custom-declare-variable (form)
+    (if (memq 'free-vars byte-compile-warnings)
+       (setq byte-compile-bound-variables
+             (cons (nth 1 (nth 1 form)) byte-compile-bound-variables)))
+    form))
+
+(cond ((featurep 'xemacs)
+       ;; Shut up!
+       (setq byte-compile-warnings
+            (delq 'unused-vars
+                  (copy-sequence byte-compile-default-warnings))))
+      ((and (boundp 'emacs-major-version)
+           (or (> emacs-major-version 20)
+               (and (eq emacs-major-version 20)
+                    (>= emacs-minor-version 3))))
+       ;; Compiler macro for replacing `sref' with `aref'.
+       (put 'sref 'byte-optimizer
+           (lambda (form)
+             (cons 'aref (cdr form))))))
 
 ;;; MU-MK ends here