changeset 3281:57711e9aac15

[xemacs-hg @ 2006-03-14 00:09:02 by vins] Check for package hierarchies in siblings to the install directory on Windows.
author vins
date Tue, 14 Mar 2006 00:09:09 +0000
parents 60e2e8d7d7dc
children 390dee4913ba
files lisp/ChangeLog lisp/setup-paths.el nt/ChangeLog nt/config.inc.samp nt/xemacs.mak
diffstat 5 files changed, 53 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Mar 13 22:51:40 2006 +0000
+++ b/lisp/ChangeLog	Tue Mar 14 00:09:09 2006 +0000
@@ -1,3 +1,10 @@
+2006-02-26  Vin Shelton  <acs@xemacs.org>
+
+	* setup-paths.el (paths-emacs-data-root-p): Add search for package
+	root.
+	(paths-find-invocation-roots): Add root-p parameter to test
+	plausibility of the roots.
+
 2006-03-12  Marcus Crestani  <crestani@xemacs.org>
 
 	* diagnose.el (show-memory-usage): Fix regexp.
--- a/lisp/setup-paths.el	Mon Mar 13 22:51:40 2006 +0000
+++ b/lisp/setup-paths.el	Tue Mar 14 00:09:09 2006 +0000
@@ -102,12 +102,19 @@
    ;; in-place or windows-nt
    (and
     (paths-file-readable-directory-p (paths-construct-path (list directory "lisp")))
-    (paths-file-readable-directory-p (paths-construct-path (list directory "etc"))))))
+    (paths-file-readable-directory-p (paths-construct-path (list directory "etc"))))
 
-(defun paths-find-emacs-root (invocation-directory invocation-name)
-  "Find the run-time root of XEmacs.
+   ;; searching for a package directory
+   (and
+    (string-match "win32" system-configuration)
+    (paths-file-readable-directory-p (paths-construct-path (list directory
+								 "xemacs-packages"))))))
+
+(defun paths-find-invocation-roots (invocation-directory invocation-name root-p)
+  "Find the list of run-time roots of XEmacs.
 INVOCATION-DIRECTORY is a directory containing the XEmacs executable.
-INVOCATION-NAME is the name of the executable itself."
+INVOCATION-NAME is the name of the executable itself
+ROOT-P is a function that tests whether a root is plausible."
   (let* ((executable-file-name (paths-chase-symlink
 				(concat invocation-directory
 					invocation-name)))
@@ -116,10 +123,9 @@
 			(paths-construct-path '("..") executable-directory)))
 	 (maybe-root-2 (file-name-as-directory
 			(paths-construct-path '(".." "..") executable-directory))))
-    (or (and (paths-emacs-root-p maybe-root-1)
-	     maybe-root-1)
-	(and (paths-emacs-root-p maybe-root-2)
-	     maybe-root-2))))
+
+    (paths-filter root-p
+		  (list maybe-root-1 maybe-root-2))))
 
 (defun paths-find-emacs-roots (invocation-directory
 			       invocation-name
@@ -129,11 +135,10 @@
 directories used by XEmacs at run-time, for example `exec-directory',
 `data-directory' and `lisp-directory'.
 ROOT-P is a function that tests whether a root is plausible."
-  (let* ((potential-invocation-root
-	  (paths-find-emacs-root invocation-directory invocation-name))
-	 (invocation-roots
-	  (and potential-invocation-root
-	       (list potential-invocation-root)))
+  (let* ((invocation-roots
+	  (paths-find-invocation-roots invocation-directory
+				       invocation-name
+				       root-p))
 	 (potential-installation-roots
 	  (paths-uniq-append
 	   (and configure-exec-prefix-directory
--- a/nt/ChangeLog	Mon Mar 13 22:51:40 2006 +0000
+++ b/nt/ChangeLog	Tue Mar 14 00:09:09 2006 +0000
@@ -1,3 +1,9 @@
+2006-02-27  Vin Shelton  <acs@xemacs.org>
+
+	* config.inc.samp: Comment out PACKAGE_PREFIX.
+	* xemacs.mak: Convert PACKAGE_PREFIX input from config.inc to
+	PATH_LATE_PACKAGE_DIRECTORIES.  Do not use PACKAGE_PATH.
+
 2006-02-22  Marcus Crestani  <crestani@xemacs.org>
 
 	* xemacs.mak: Remove mc-alloc, replace with newgc, adjust output.
--- a/nt/config.inc.samp	Mon Mar 13 22:51:40 2006 +0000
+++ b/nt/config.inc.samp	Tue Mar 14 00:09:09 2006 +0000
@@ -6,7 +6,11 @@
 
 INSTALL_DIR=c:\Program Files\XEmacs\XEmacs-$(XEMACS_VERSION_STRING)
 
-PACKAGE_PREFIX=c:\Program Files\XEmacs
+# PACKAGE_PREFIX is root of the installed package hierarchies.
+# This corresponds to the configure option --with-late-packages.
+# See 'Package Hierarchies' in the info for more documentation.
+# If you don't set this, XEmacs will attempt to find the packages at runtime.
+#PACKAGE_PREFIX=c:\Program Files\XEmacs
 
 ############################################################################
 #                      Compiled-in features: basic                         #
--- a/nt/xemacs.mak	Mon Mar 13 22:51:40 2006 +0000
+++ b/nt/xemacs.mak	Tue Mar 14 00:09:09 2006 +0000
@@ -440,17 +440,11 @@
 INSTALL_DIR=c:\Program Files\XEmacs\XEmacs-$(XEMACS_VERSION_STRING)
 ! endif
 !endif
-!if !defined(PACKAGE_PATH)
-! if !defined(PACKAGE_PREFIX)
-PACKAGE_PREFIX=c:\Program Files\XEmacs
-! endif
-! if $(MULE)
-PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\mule-packages;$(PACKAGE_PREFIX)\xemacs-packages
-! else
-PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\xemacs-packages
-! endif
+
+# If PACKAGE_PREFIX was defined, use it to generate a package path.
+!if defined(PACKAGE_PREFIX)
+PATH_LATE_PACKAGE_DIRECTORIES="$(PACKAGE_PREFIX:\=\\)"
 !endif
-PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)"
 
 !if $(INFODOCK)
 PATH_PREFIX=../..
@@ -805,8 +799,10 @@
 !if defined(xemacs_extra_name)
  -DXEMACS_EXTRA_NAME=\"$(xemacs_extra_name:"=)\" \
 !endif
- -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \
- -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\"
+!if defined(PATH_LATE_PACKAGE_DIRECTORIES)
+ -DPATH_LATE_PACKAGE_DIRECTORIES=\"$(PATH_LATE_PACKAGE_DIRECTORIES)\" \
+!endif
+ -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\"
 TEMACS_CPP_FLAGS=$(CFLAGS) $(TEMACS_CPP_FLAGS_NO_CFLAGS)
 TEMACS_CPP_CDECL_FLAGS=$(CFLAGS_CDECL) $(TEMACS_CPP_FLAGS_NO_CFLAGS)
 
@@ -1067,8 +1063,10 @@
 !endif
 !if [echo LISPDIR>>$(CONFIG_VALUES) && echo "\\$(LISP:\=\\)">>$(CONFIG_VALUES)]
 !endif
-# PATH_PACKAGEPATH is already a quoted string.
-!if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)]
+!if defined(PATH_LATE_PACKAGE_DIRECTORIES)
+# PATH_LATE_PACKAGE_DIRECTORIES is already a quoted string.
+! if [echo PATH_LATE_PACKAGE_DIRECTORIES>>$(CONFIG_VALUES) && echo $(PATH_LATE_PACKAGE_DIRECTORIES)>>$(CONFIG_VALUES)]
+! endif
 !endif
 
 LINK_DEPENDENCY_ARGS = -Fe$@ -Fd$* $** -link $(DEBUG_FLAGS_LINK)
@@ -1141,7 +1139,9 @@
   Compiling as C++.
 !endif
   Installing XEmacs in "$(INSTALL_DIR:\=\\)".
-  Package path is $(PATH_PACKAGEPATH).
+!if defined(PATH_LATE_PACKAGE_DIRECTORIES)
+  Package path is $(PATH_LATE_PACKAGE_DIRECTORIES).
+!endif
 !if $(INFODOCK)
   Building InfoDock.
 !endif
@@ -1672,6 +1672,7 @@
 	@$(COPYDIR) $(SRCROOT)\etc  "$(INSTALL_DIR)\etc\"
 	@$(COPYDIR) $(SRCROOT)\info "$(INSTALL_DIR)\info\"
 	@$(COPYDIR) $(SRCROOT)\lisp "$(INSTALL_DIR)\lisp\"
+!if defined(PACKAGE_PREFIX)
 	@echo Making skeleton package tree in $(PACKAGE_PREFIX) ...
 	@$(COPY) PlaceHolder "$(PACKAGE_PREFIX)\site-packages\"
 	-$(DEL) "$(PACKAGE_PREFIX)\site-packages\PlaceHolder"
@@ -1679,6 +1680,7 @@
 	-$(DEL) "$(PACKAGE_PREFIX)\mule-packages\PlaceHolder"
 	@$(COPY) PlaceHolder "$(PACKAGE_PREFIX)\xemacs-packages\"
 	-$(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder"
+!endif
 	-$(DEL) PlaceHolder
 
 ########################### clean