(AC_EXAMINE_PACKAGEDIR): Check for (early|late|last)-package-hierarchies and
authoryamaoka <yamaoka>
Mon, 11 Dec 2006 06:49:17 +0000 (06:49 +0000)
committeryamaoka <yamaoka>
Mon, 11 Dec 2006 06:49:17 +0000 (06:49 +0000)
 configure-package-path as well as (early|late|last)-packages.

ChangeLog
acinclude.m4

index fe34af6..ab1429c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-11  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * acinclude.m4 (AC_EXAMINE_PACKAGEDIR): Check for
+       (early|late|last)-package-hierarchies and configure-package-path
+       as well as (early|late|last)-packages.
+
 2006-09-29  Daiki Ueno  <ueno@unixuser.org>
 
        * Riece: Version 3.1.1 released.
index ad09542..3557023 100644 (file)
@@ -308,19 +308,43 @@ AC_SUBST(USE_FONTS)
 AC_DEFUN([AC_EXAMINE_PACKAGEDIR],
  [dnl Examine PACKAGEDIR.
   AC_EMACS_LISP(PACKAGEDIR,
-    (let (package-dir)\
-      (if (boundp (quote early-packages))\
-         (let ((dirs (delq nil (append (if early-package-load-path\
-                                           early-packages)\
-                                       (if late-package-load-path\
-                                           late-packages)\
-                                       (if last-package-load-path\
-                                           last-packages)))))\
-           (while (and dirs (not package-dir))\
-             (if (file-directory-p (car dirs))\
-                 (setq package-dir (car dirs)\
-                       dirs (cdr dirs))))))\
-      (or package-dir \"\")),
+    (let ((prefix \"${prefix}\")\
+         (dirs (append\
+                (cond ((boundp (quote early-package-hierarchies))\
+                       (append (if early-package-load-path\
+                                   early-package-hierarchies)\
+                               (if late-package-load-path\
+                                   late-package-hierarchies)\
+                               (if last-package-load-path\
+                                   last-package-hierarchies)))\
+                      ((boundp (quote early-packages))\
+                       (append (if early-package-load-path\
+                                   early-packages)\
+                               (if late-package-load-path\
+                                   late-packages)\
+                               (if last-package-load-path\
+                                   last-packages))))\
+                (if (and (boundp (quote configure-package-path))\
+                         (listp configure-package-path))\
+                    (delete \"\" configure-package-path))))\
+         package-dir)\
+      (while (and dirs (not package-dir))\
+       (if (file-directory-p (car dirs))\
+           (setq package-dir (car dirs)\
+                 dirs (cdr dirs))))\
+      (if package-dir\
+         (progn\
+           (if (string-match \"/\$\" package-dir)\
+               (setq package-dir (substring package-dir 0\
+                                            (match-beginning 0))))\
+           (if (and prefix\
+                    (progn\
+                      (setq prefix (file-name-as-directory prefix))\
+                      (eq 0 (string-match (regexp-quote prefix)\
+                                          package-dir))))\
+               (replace-match \"\$(prefix)/\" nil nil package-dir)\
+             package-dir))\
+       \"\")),
     "noecho")])
 
 AC_DEFUN([AC_PATH_PACKAGEDIR],