changeset 3179:15139dbf89f4

[xemacs-hg @ 2005-12-27 18:50:47 by michaels] This: 2005-11-25 Mike Sperber <mike@xemacs.org> * CHANGES-beta: * configure.ac: Zap --with-package-prefix; instead, add --with-user-packages/--with-early-packages, --with-system-packages/--with-late-packages, and --with-legacy-packages/--with-last-packages. ... and the changes that result from it throughout the code.
author michaels
date Tue, 27 Dec 2005 18:51:30 +0000
parents 632fdf307588
children 60c42a3e83a4
files CHANGES-beta ChangeLog INSTALL configure configure.ac lisp/ChangeLog lisp/package-admin.el lisp/package-get.el lisp/packages.el man/ChangeLog man/lispref/packaging.texi man/xemacs-faq.texi man/xemacs/startup.texi netinstall/ChangeLog netinstall/reginfo.h src/ChangeLog src/config.h.in src/emacs.c src/nt.c src/paths.h.in
diffstat 20 files changed, 463 insertions(+), 137 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Dec 26 22:50:50 2005 +0000
+++ b/CHANGES-beta	Tue Dec 27 18:51:30 2005 +0000
@@ -342,8 +342,7 @@
 -- New: support NetBSD sound via Linux API. -- Aidan Kehoe
 -- Improve: generation of CFLAGS (Jerry James, Ben Wing
 -- Improve: parallel build support. -- Malcolm Purvis
--- Improve: support --package-prefix as simple interface to --package-path
-   facility. -- Ben Wing
+-- Improve: supersede --package-path by --with-{user/early,system/late,legacy/last}--packages
 -- Improve: support mmdf and pop arguments to --mail-locking. -- Ben Wing
 
 Documentation
--- a/ChangeLog	Mon Dec 26 22:50:50 2005 +0000
+++ b/ChangeLog	Tue Dec 27 18:51:30 2005 +0000
@@ -1,3 +1,16 @@
+2005-11-25  Mike Sperber  <mike@xemacs.org>
+
+	* CHANGES-beta: 
+	* configure.ac: Zap --with-package-prefix; instead, add
+	--with-user-packages/--with-early-packages,
+	--with-system-packages/--with-late-packages, and
+	--with-legacy-packages/--with-last-packages.
+
+2005-12-13  Mike Sperber  <mike@xemacs.org>
+
+	* configure.ac: Move the checks for the Xft-associated library out
+	of a conditional.
+
 2005-12-23  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* configure.ac (Xft): Fix typo preventing report of Xft buffers.
--- a/INSTALL	Mon Dec 26 22:50:50 2005 +0000
+++ b/INSTALL	Tue Dec 27 18:51:30 2005 +0000
@@ -875,7 +875,6 @@
 
 --with-site-lisp          Unchanged
 --with-site-modules       Unchanged
---package-prefix          --with-package-prefix
 --package-path            --with-package-path
 --infopath                --with-infopath
 
--- a/configure	Mon Dec 26 22:50:50 2005 +0000
+++ b/configure	Tue Dec 27 18:51:30 2005 +0000
@@ -359,7 +359,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS inststaticdir statedir LN_S blddir build build_cpu build_vendor build_os configuration CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP start_flags ld_switch_shared start_files ld lib_gcc RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA YACC SET_MAKE GTK_CONFIG X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS install_pp libs_xauth dnd_objs LIBSTDCPP dll_ld dll_cflags dll_ldflags dll_post dll_ldo ld_dynamic_link_flags with_modules MOD_CC MODARCHDIR MAKE_DOCFILE MODCFLAGS INSTALLPATH MOD_INSTALL_PROGRAM OBJECT_TO_BUILD ldap_libs postgresql_libs lwlib_objs canna_libs ALLOCA have_esd_config SRC_SUBDIR_DEPS INSTALL_ARCH_DEP_SUBDIR MAKE_SUBDIR SUBDIR_MAKEFILES PROGNAME version instvardir srcdir extra_includes PREFIX_USER_DEFINED PREFIX EXEC_PREFIX_USER_DEFINED EXEC_PREFIX INFODIR_USER_DEFINED INFODIR infopath INFOPATH_USER_DEFINED INFOPATH package_path PACKAGE_PATH_USER_DEFINED PACKAGE_PATH lispdir LISPDIR_USER_DEFINED LISPDIR moduledir MODULEDIR_USER_DEFINED MODULEDIR sitelispdir SITELISPDIR_USER_DEFINED SITELISPDIR sitemoduledir SITEMODULEDIR_USER_DEFINED SITEMODULEDIR etcdir ETCDIR_USER_DEFINED ETCDIR archlibdir ARCHLIBDIR_USER_DEFINED ARCHLIBDIR docdir DOCDIR_USER_DEFINED DOCDIR bitmapdir extra_objs machfile opsysfile c_switch_general c_switch_window_system c_switch_all ld_switch_general ld_switch_window_system ld_switch_all ld_libs_general ld_libs_window_system ld_libs_all RECURSIVE_MAKE_ARGS native_sound_lib sound_cflags dynodump_arch XEMACS_CC XE_CFLAGS internal_makefile_list LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS inststaticdir statedir LN_S blddir build build_cpu build_vendor build_os configuration CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP start_flags ld_switch_shared start_files ld lib_gcc RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA YACC SET_MAKE GTK_CONFIG X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS install_pp libs_xauth dnd_objs LIBSTDCPP dll_ld dll_cflags dll_ldflags dll_post dll_ldo ld_dynamic_link_flags with_modules MOD_CC MODARCHDIR MAKE_DOCFILE MODCFLAGS INSTALLPATH MOD_INSTALL_PROGRAM OBJECT_TO_BUILD ldap_libs postgresql_libs lwlib_objs canna_libs ALLOCA have_esd_config SRC_SUBDIR_DEPS INSTALL_ARCH_DEP_SUBDIR MAKE_SUBDIR SUBDIR_MAKEFILES PROGNAME version instvardir srcdir extra_includes PREFIX_USER_DEFINED PREFIX EXEC_PREFIX_USER_DEFINED EXEC_PREFIX INFODIR_USER_DEFINED INFODIR infopath INFOPATH_USER_DEFINED INFOPATH early_packages EARLY_PACKAGE_DIRECTORIES_USER_DEFINED EARLY_PACKAGE_DIRECTORIES late_packages LATE_PACKAGE_DIRECTORIES_USER_DEFINED LATE_PACKAGE_DIRECTORIES last_packages LAST_PACKAGE_DIRECTORIES_USER_DEFINED LAST_PACKAGE_DIRECTORIES package_path PACKAGE_PATH_USER_DEFINED PACKAGE_PATH lispdir LISPDIR_USER_DEFINED LISPDIR moduledir MODULEDIR_USER_DEFINED MODULEDIR sitelispdir SITELISPDIR_USER_DEFINED SITELISPDIR sitemoduledir SITEMODULEDIR_USER_DEFINED SITEMODULEDIR etcdir ETCDIR_USER_DEFINED ETCDIR archlibdir ARCHLIBDIR_USER_DEFINED ARCHLIBDIR docdir DOCDIR_USER_DEFINED DOCDIR bitmapdir extra_objs machfile opsysfile c_switch_general c_switch_window_system c_switch_all ld_switch_general ld_switch_window_system ld_switch_all ld_libs_general ld_libs_window_system ld_libs_all RECURSIVE_MAKE_ARGS native_sound_lib sound_cflags dynodump_arch XEMACS_CC XE_CFLAGS internal_makefile_list LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -982,10 +982,26 @@
   --with-site-modules=no  Disable site-modules directory in the XEmacs
                           hierarchy, which is searched before the installation
                           modules.
-  --with-package-prefix=DIR
-                          Specify packages root.
+  --with-early-packages=DIR
+                          Specify location of early/user packages (instead of
+                          ~/.xemacs; same as --with-user-packages).
+  --with-user-packages=DIR
+                          Specify location of early/user packages (instead of
+                          ~/.xemacs; same as --with-early-packages).
+  --with-late-packages=DIR
+                          Specify location of late/system packages (instead of
+                          default location; same as --with-system-packages).
+  --with-late-packages=DIR
+                          Specify location of late/system packages (instead of
+                          default location; same as --with-late-packages).
+  --with-last-packages=DIR
+                          Specify location of last/legacy packages (instead of
+                          default location; same as --with-legacy-packages).
+  --with-late-packages=DIR
+                          Specify location of late/legacy packages (instead of
+                          default location; same as --with-late-packages).
   --with-package-path=PATH
-                          Search path for package hierarchies.
+                          Search path for package directories.
   --with-infopath=PATH    Location of info directories
 
 Window-system options
@@ -2205,22 +2221,117 @@
   withval="$with_site_modules"
 
 fi;
-# If --with-package-prefix or --without-package-prefix were given then copy the value to the
-# equivalent enable_package-prefix variable.
-if test "${with_package_prefix+set}" = set; then
-  enable_package_prefix="$with_package_prefix"
-fi;
-# If -enable-package-prefix or --disable-package-prefix were given then copy the value to the
-# equivalent with_package-prefix variable.
-if test "${enable_package_prefix+set}" = set; then
-  with_package_prefix="$enable_package_prefix"
-fi;
-# Check whether --with-package-prefix or --without-package-prefix was given.
-if test "${with_package_prefix+set}" = set; then
-  enableval="$with_package_prefix"
-  withval="$with_package_prefix"
-  cat >>confdefs.h <<\_ACEOF
-#define PACKAGE_PATH_USER_DEFINED 1
+# If --with-early-packages or --without-early-packages were given then copy the value to the
+# equivalent enable_early-packages variable.
+if test "${with_early_packages+set}" = set; then
+  enable_early_packages="$with_early_packages"
+fi;
+# If -enable-early-packages or --disable-early-packages were given then copy the value to the
+# equivalent with_early-packages variable.
+if test "${enable_early_packages+set}" = set; then
+  with_early_packages="$enable_early_packages"
+fi;
+# Check whether --with-early-packages or --without-early-packages was given.
+if test "${with_early_packages+set}" = set; then
+  enableval="$with_early_packages"
+  withval="$with_early_packages"
+  cat >>confdefs.h <<\_ACEOF
+#define EARLY_PACKAGE_DIRECTORIES_USER_DEFINED 1
+_ACEOF
+
+fi;
+# If --with-user-packages or --without-user-packages were given then copy the value to the
+# equivalent enable_user-packages variable.
+if test "${with_user_packages+set}" = set; then
+  enable_user_packages="$with_user_packages"
+fi;
+# If -enable-user-packages or --disable-user-packages were given then copy the value to the
+# equivalent with_user-packages variable.
+if test "${enable_user_packages+set}" = set; then
+  with_user_packages="$enable_user_packages"
+fi;
+# Check whether --with-user-packages or --without-user-packages was given.
+if test "${with_user_packages+set}" = set; then
+  enableval="$with_user_packages"
+  withval="$with_user_packages"
+  cat >>confdefs.h <<\_ACEOF
+#define EARLY_PACKAGE_DIRECTORIES_USER_DEFINED 1
+_ACEOF
+
+fi;
+# If --with-late-packages or --without-late-packages were given then copy the value to the
+# equivalent enable_late-packages variable.
+if test "${with_late_packages+set}" = set; then
+  enable_late_packages="$with_late_packages"
+fi;
+# If -enable-late-packages or --disable-late-packages were given then copy the value to the
+# equivalent with_late-packages variable.
+if test "${enable_late_packages+set}" = set; then
+  with_late_packages="$enable_late_packages"
+fi;
+# Check whether --with-late-packages or --without-late-packages was given.
+if test "${with_late_packages+set}" = set; then
+  enableval="$with_late_packages"
+  withval="$with_late_packages"
+  cat >>confdefs.h <<\_ACEOF
+#define LATE_PACKAGE_DIRECTORIES_USER_DEFINED 1
+_ACEOF
+
+fi;
+# If --with-system-packages or --without-system-packages were given then copy the value to the
+# equivalent enable_system-packages variable.
+if test "${with_system_packages+set}" = set; then
+  enable_system_packages="$with_system_packages"
+fi;
+# If -enable-system-packages or --disable-system-packages were given then copy the value to the
+# equivalent with_system-packages variable.
+if test "${enable_system_packages+set}" = set; then
+  with_system_packages="$enable_system_packages"
+fi;
+# Check whether --with-system-packages or --without-system-packages was given.
+if test "${with_system_packages+set}" = set; then
+  enableval="$with_system_packages"
+  withval="$with_system_packages"
+  cat >>confdefs.h <<\_ACEOF
+#define LATE_PACKAGE_DIRECTORIES_USER_DEFINED 1
+_ACEOF
+
+fi;
+# If --with-last-packages or --without-last-packages were given then copy the value to the
+# equivalent enable_last-packages variable.
+if test "${with_last_packages+set}" = set; then
+  enable_last_packages="$with_last_packages"
+fi;
+# If -enable-last-packages or --disable-last-packages were given then copy the value to the
+# equivalent with_last-packages variable.
+if test "${enable_last_packages+set}" = set; then
+  with_last_packages="$enable_last_packages"
+fi;
+# Check whether --with-last-packages or --without-last-packages was given.
+if test "${with_last_packages+set}" = set; then
+  enableval="$with_last_packages"
+  withval="$with_last_packages"
+  cat >>confdefs.h <<\_ACEOF
+#define LAST_PACKAGE_DIRECTORIES_USER_DEFINED 1
+_ACEOF
+
+fi;
+# If --with-legacy-packages or --without-legacy-packages were given then copy the value to the
+# equivalent enable_legacy-packages variable.
+if test "${with_legacy_packages+set}" = set; then
+  enable_legacy_packages="$with_legacy_packages"
+fi;
+# If -enable-legacy-packages or --disable-legacy-packages were given then copy the value to the
+# equivalent with_legacy-packages variable.
+if test "${enable_legacy_packages+set}" = set; then
+  with_legacy_packages="$enable_legacy_packages"
+fi;
+# Check whether --with-legacy-packages or --without-legacy-packages was given.
+if test "${with_legacy_packages+set}" = set; then
+  enableval="$with_legacy_packages"
+  withval="$with_legacy_packages"
+  cat >>confdefs.h <<\_ACEOF
+#define LATE_PACKAGE_DIRECTORIES_USER_DEFINED 1
 _ACEOF
 
 fi;
@@ -38802,13 +38913,44 @@
 done
 
 
-if test -z "$with_package_path" && test -n "$with_package_prefix" ; then
-  if test "$enable_mule" = "yes" ; then
-    with_package_path="~/.xemacs::${with_package_prefix}/site-packages:${with_package_prefix}/xemacs-packages:${with_package_prefix}/mule-packages"
-  else
-    with_package_path="~/.xemacs::${with_package_prefix}/site-packages:${with_package_prefix}/xemacs-packages"
-  fi
-fi
+test -n "$with_user_packages" && with_early_packages=$with_user_packages
+early_packages=$with_early_packages
+
+
+EARLY_PACKAGE_DIRECTORIES=$with_early_packages
+while true; do
+  case "$EARLY_PACKAGE_DIRECTORIES" in
+    *\$* ) eval "EARLY_PACKAGE_DIRECTORIES=$EARLY_PACKAGE_DIRECTORIES" ;;
+    *) break ;;
+  esac
+done
+
+
+test -n "$with_system_packages" && with_late_packages=$with_system_packages
+late_packages=$with_late_packages
+
+
+LATE_PACKAGE_DIRECTORIES=$with_late_packages
+while true; do
+  case "$LATE_PACKAGE_DIRECTORIES" in
+    *\$* ) eval "LATE_PACKAGE_DIRECTORIES=$LATE_PACKAGE_DIRECTORIES" ;;
+    *) break ;;
+  esac
+done
+
+
+test -n "$with_legacy_packages" && with_last_packages=$with_legacy_packages
+last_packages=$with_last_packages
+
+
+LAST_PACKAGE_DIRECTORIES=$with_last_packages
+while true; do
+  case "$LAST_PACKAGE_DIRECTORIES" in
+    *\$* ) eval "LAST_PACKAGE_DIRECTORIES=$LAST_PACKAGE_DIRECTORIES" ;;
+    *) break ;;
+  esac
+done
+
 
 package_path=$with_package_path
 
@@ -40127,6 +40269,15 @@
 s,@infopath@,$infopath,;t t
 s,@INFOPATH_USER_DEFINED@,$INFOPATH_USER_DEFINED,;t t
 s,@INFOPATH@,$INFOPATH,;t t
+s,@early_packages@,$early_packages,;t t
+s,@EARLY_PACKAGE_DIRECTORIES_USER_DEFINED@,$EARLY_PACKAGE_DIRECTORIES_USER_DEFINED,;t t
+s,@EARLY_PACKAGE_DIRECTORIES@,$EARLY_PACKAGE_DIRECTORIES,;t t
+s,@late_packages@,$late_packages,;t t
+s,@LATE_PACKAGE_DIRECTORIES_USER_DEFINED@,$LATE_PACKAGE_DIRECTORIES_USER_DEFINED,;t t
+s,@LATE_PACKAGE_DIRECTORIES@,$LATE_PACKAGE_DIRECTORIES,;t t
+s,@last_packages@,$last_packages,;t t
+s,@LAST_PACKAGE_DIRECTORIES_USER_DEFINED@,$LAST_PACKAGE_DIRECTORIES_USER_DEFINED,;t t
+s,@LAST_PACKAGE_DIRECTORIES@,$LAST_PACKAGE_DIRECTORIES,;t t
 s,@package_path@,$package_path,;t t
 s,@PACKAGE_PATH_USER_DEFINED@,$PACKAGE_PATH_USER_DEFINED,;t t
 s,@PACKAGE_PATH@,$PACKAGE_PATH,;t t
--- a/configure.ac	Mon Dec 26 22:50:50 2005 +0000
+++ b/configure.ac	Tue Dec 27 18:51:30 2005 +0000
@@ -643,11 +643,26 @@
 XE_MERGED_ARG([site-modules],
 	AC_HELP_STRING([--with-site-modules=no],[Disable site-modules directory in the XEmacs hierarchy, which is searched before the installation modules.]),
 	[], [])
-XE_MERGED_ARG([package-prefix],
-	AC_HELP_STRING([--with-package-prefix=DIR],[Specify packages root.]),
-	[AC_DEFINE(PACKAGE_PATH_USER_DEFINED)], [])
+XE_MERGED_ARG([early-packages],
+	AC_HELP_STRING([--with-early-packages=DIR],[Specify location of early/user packages (instead of ~/.xemacs; same as --with-user-packages).]),
+	[AC_DEFINE(EARLY_PACKAGE_DIRECTORIES_USER_DEFINED)], [])
+XE_MERGED_ARG([user-packages],
+	AC_HELP_STRING([--with-user-packages=DIR],[Specify location of early/user packages (instead of ~/.xemacs; same as --with-early-packages).]),
+	[AC_DEFINE(EARLY_PACKAGE_DIRECTORIES_USER_DEFINED)], [])
+XE_MERGED_ARG([late-packages],
+	AC_HELP_STRING([--with-late-packages=DIR],[Specify location of late/system packages (instead of default location; same as --with-system-packages).]),
+	[AC_DEFINE(LATE_PACKAGE_DIRECTORIES_USER_DEFINED)], [])
+XE_MERGED_ARG([system-packages],
+	AC_HELP_STRING([--with-late-packages=DIR],[Specify location of late/system packages (instead of default location; same as --with-late-packages).]),
+	[AC_DEFINE(LATE_PACKAGE_DIRECTORIES_USER_DEFINED)], [])
+XE_MERGED_ARG([last-packages],
+	AC_HELP_STRING([--with-last-packages=DIR],[Specify location of last/legacy packages (instead of default location; same as --with-legacy-packages).]),
+	[AC_DEFINE(LAST_PACKAGE_DIRECTORIES_USER_DEFINED)], [])
+XE_MERGED_ARG([legacy-packages],
+	AC_HELP_STRING([--with-late-packages=DIR],[Specify location of late/legacy packages (instead of default location; same as --with-late-packages).]),
+	[AC_DEFINE(LATE_PACKAGE_DIRECTORIES_USER_DEFINED)], [])
 XE_MERGED_ARG([package-path],
-	AC_HELP_STRING([--with-package-path=PATH],[Search path for package hierarchies.]),
+	AC_HELP_STRING([--with-package-path=PATH],[Search path for package directories.]),
 	[AC_DEFINE(PACKAGE_PATH_USER_DEFINED)], [])
 XE_MERGED_ARG([infopath],
 	AC_HELP_STRING([--with-infopath=PATH],[Location of info directories]),
@@ -5617,13 +5632,41 @@
 done
 AC_SUBST(INFOPATH)
 
-if test -z "$with_package_path" && test -n "$with_package_prefix" ; then
-  if test "$enable_mule" = "yes" ; then
-    with_package_path="~/.xemacs::${with_package_prefix}/site-packages:${with_package_prefix}/xemacs-packages:${with_package_prefix}/mule-packages"
-  else
-    with_package_path="~/.xemacs::${with_package_prefix}/site-packages:${with_package_prefix}/xemacs-packages"
-  fi
-fi
+test -n "$with_user_packages" && with_early_packages=$with_user_packages
+AC_SUBST(early_packages,$with_early_packages)
+AC_SUBST(EARLY_PACKAGE_DIRECTORIES_USER_DEFINED)
+EARLY_PACKAGE_DIRECTORIES=$with_early_packages
+while true; do
+  case "$EARLY_PACKAGE_DIRECTORIES" in
+    *\$* ) eval "EARLY_PACKAGE_DIRECTORIES=$EARLY_PACKAGE_DIRECTORIES" ;;
+    *) break ;;
+  esac
+done
+AC_SUBST(EARLY_PACKAGE_DIRECTORIES)
+
+test -n "$with_system_packages" && with_late_packages=$with_system_packages
+AC_SUBST(late_packages,$with_late_packages)
+AC_SUBST(LATE_PACKAGE_DIRECTORIES_USER_DEFINED)
+LATE_PACKAGE_DIRECTORIES=$with_late_packages
+while true; do
+  case "$LATE_PACKAGE_DIRECTORIES" in
+    *\$* ) eval "LATE_PACKAGE_DIRECTORIES=$LATE_PACKAGE_DIRECTORIES" ;;
+    *) break ;;
+  esac
+done
+AC_SUBST(LATE_PACKAGE_DIRECTORIES)
+
+test -n "$with_legacy_packages" && with_last_packages=$with_legacy_packages
+AC_SUBST(last_packages,$with_last_packages)
+AC_SUBST(LAST_PACKAGE_DIRECTORIES_USER_DEFINED)
+LAST_PACKAGE_DIRECTORIES=$with_last_packages
+while true; do
+  case "$LAST_PACKAGE_DIRECTORIES" in
+    *\$* ) eval "LAST_PACKAGE_DIRECTORIES=$LAST_PACKAGE_DIRECTORIES" ;;
+    *) break ;;
+  esac
+done
+AC_SUBST(LAST_PACKAGE_DIRECTORIES)
 
 AC_SUBST(package_path,$with_package_path)
 AC_SUBST(PACKAGE_PATH_USER_DEFINED)
--- a/lisp/ChangeLog	Mon Dec 26 22:50:50 2005 +0000
+++ b/lisp/ChangeLog	Tue Dec 27 18:51:30 2005 +0000
@@ -1,3 +1,21 @@
+2005-11-25  Mike Sperber  <mike@xemacs.org>
+
+	* packages.el (packages-find-package-hierarchies-named): Use
+	`file-name-as-directory' to normalize something which may not
+	have a trailing path separator.
+
+	* package-get.el (package-get-package-index-file-location): Fix
+	essentially bogus definition.
+
+	* package-admin.el (package-admin-find-top-directory): Use the
+	existing variables rather than groking the paths from scratch, and
+	greatly simplify.
+
+	* packages.el (packages-find-all-package-hierarchies): 
+	Take into account `configure-early-package-hierarchies',
+	`configure-late-package-hierarchies',
+	`configure-last-package-hierarchies', as set by configure.
+
 2005-12-24  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* mule/chinese.el:
--- a/lisp/package-admin.el	Mon Dec 26 22:50:50 2005 +0000
+++ b/lisp/package-admin.el	Tue Dec 27 18:51:30 2005 +0000
@@ -150,12 +150,7 @@
 trying to find a directory for.
 
 Optional Argument USER-DIR if non-nil use directories off
-`user-init-directory'.  This overrides everything except
-\"EMACSPACKAGEPATH\".
-
-This function honours the environment variable \"EMACSPACKAGEPATH\"
-and returns directories found there as a priority.  If that variable
-doesn't exist and USER-DIR is nil, check in the normal places.
+`early-package-directories'.
 
 If we still can't find a suitable directory, return nil.
 
@@ -164,55 +159,31 @@
     std  == For \"standard\" packages that go in '/xemacs-packages/'
     mule == For \"mule\" packages that go in '/mule-packages/'
     site == For \"unsupported\" packages that go in '/site-packages/'
-
-Note:  Type \"site\" is not yet fully supported."
-  (let* ((env-value (getenv "EMACSPACKAGEPATH"))
+"
+  (let* ((hierarchies late-package-hierarchies)
+	 
+	 (hierarchy-suffix
+	  (file-name-as-directory
+	   (cond
+	    ((eq type 'std) "xemacs-packages")
+	    ((eq type 'mule) "mule-packages")
+	    ((eq type 'site) "site-packages"))))
+	 (suffix-length (length hierarchy-suffix))
 	 top-dir)
-    ;; First, check the environment var.
-    (if env-value
-	(let ((path-list (paths-decode-directory-path env-value 'drop-empties)))
-	  (cond ((eq type 'std)
-		 (while path-list
-		   (if (equal (file-name-nondirectory 
-			       (directory-file-name (car path-list)))
-			      "xemacs-packages")
-		       (setq top-dir (car path-list)))
-		   (setq path-list (cdr path-list))))
-		((eq type 'mule)
-		 (while path-list
-		   (if (equal (file-name-nondirectory 
-			       (directory-file-name (car path-list)))
-			      "mule-packages")
-		       (setq top-dir (car path-list)))
-		   (setq path-list (cdr path-list)))))))
-    ;; Wasn't in the environment, try `user-init-directory' if
-    ;; USER-DIR is non-nil.
-    (if (and user-dir
-	     (not top-dir))
-	(cond ((eq type 'std)
-	       (setq top-dir (file-name-as-directory
-			      (expand-file-name "xemacs-packages" user-init-directory))))
-	      ((eq type 'mule)
-	       (setq top-dir (file-name-as-directory
-			      (expand-file-name "mule-packages" user-init-directory))))))
-    ;; Finally check the normal places
-    (if (not top-dir)
-	(let ((path-list (nth 1 (packages-find-all-package-hierarchies
-				 emacs-data-roots))))
-	  (cond ((eq type 'std)
-		 (while path-list
-		   (if (equal (substring (car path-list) -16) 
-			      (concat "xemacs-packages" (char-to-string directory-sep-char)))
-		       (setq top-dir (car path-list)))
-		   (setq path-list (cdr path-list))))
-		((eq type 'mule)
-		 (while path-list
-		   (if (equal (substring (car path-list) -14) 
-			      (concat "mule-packages" (char-to-string directory-sep-char)))
-		       (setq top-dir (car path-list)))
-		   (setq path-list (cdr path-list)))))))
-    ;; Now return either the directory or nil.
-    top-dir))
+
+    (if user-dir
+	(expand-file-name hierarchy-suffix
+			  (if configure-early-package-directories
+			      (car configure-early-package-directories)
+			    user-init-directory))
+      
+      (while hierarchies
+	(if (string-equal (substring (car hierarchies) (- suffix-length))
+			  hierarchy-suffix)
+	    (setq top-dir (car hierarchies)))
+	(setq hierarchies (cdr hierarchies)))
+      top-dir)))
+  
 
 (defun package-admin-get-install-dir (package &optional pkg-dir)
   "Find a suitable installation directory for a package.
--- a/lisp/package-get.el	Mon Dec 26 22:50:50 2005 +0000
+++ b/lisp/package-get.el	Tue Dec 27 18:51:30 2005 +0000
@@ -171,7 +171,16 @@
 
 ;;;###autoload
 (defcustom package-get-package-index-file-location 
-  (car (split-path (or (getenv "EMACSPACKAGEPATH") user-init-directory)))
+  (cond
+   ;; historical backage
+   ((getenv "EMACSPACKAGEPATH") 
+    (split-path (getenv "EMACSPACKAGEPATH")))
+   ((getenv "EMACSEARLYPACKAGES")
+    (split-path (getenv "EMACSEARLYPACKAGES")))
+   (configure-early-package-directories
+    (car configure-early-package-directories))
+   (t
+    user-init-directory))
   "*The directory where the package-index file can be found."
   :type 'directory
   :group 'package-get)
--- a/lisp/packages.el	Mon Dec 26 22:50:50 2005 +0000
+++ b/lisp/packages.el	Tue Dec 27 18:51:30 2005 +0000
@@ -345,7 +345,9 @@
 Returns list of hierarchies."
   (paths-directories-which-exist
    (mapcar #'(lambda (package-directory)
-	       (file-name-as-directory (concat package-directory base)))
+	       (file-name-as-directory
+		(concat (file-name-as-directory package-directory)
+			base)))
 	   package-directories)))
 
 (defun packages-split-path (path)
@@ -387,44 +389,67 @@
   (paths-uniq-append (paths-find-version-directories roots "" nil nil t)
 		     (paths-find-site-directories roots "")))
 
-(defun packages-find-package-hierarchies (package-directories &optional default)
+(defun packages-find-package-hierarchies (package-directories &optional envvar default)
   "Find package hierarchies in a list of package directories.
 PACKAGE-DIRECTORIES is a list of package directories.
-DEFAULT is a default list of package hierarchies."
-  (or default
-      (let ((package-hierarchies '())
-	    (hierarchy-directories (packages-package-hierarchy-directory-names)))
-	(while hierarchy-directories
-	  (setq package-hierarchies
-		(nconc package-hierarchies
-		       (packages-find-package-hierarchies-named
-			package-directories
-			(car hierarchy-directories))))
-	  (setq hierarchy-directories (cdr hierarchy-directories)))
-	package-hierarchies)))
+DEFAULT is a default list of package hierarchies.
+ENVVAR is the name of an environment variable that may override
+the default."
+  (let* ((envvar-value (and envvar (getenv envvar)))
+	 (package-directories
+	  (if envvar-value
+	      (split-path envvar-value)
+	    package-directories)))
+
+    (or (and (not envvar-value) default)
+	(let ((package-hierarchies '())
+	      (hierarchy-directories (packages-package-hierarchy-directory-names)))
+	  (while hierarchy-directories
+	    (setq package-hierarchies
+		  (nconc package-hierarchies
+			 (packages-find-package-hierarchies-named
+			  package-directories
+			  (car hierarchy-directories))))
+	    (setq hierarchy-directories (cdr hierarchy-directories)))
+	  package-hierarchies))))
   
 (defun packages-find-all-package-hierarchies (roots)
- "Find the package hierarchies.
+  "Find the package hierarchies.
 ROOTS is a list of installation roots.
 Returns a list of three directory lists, the first being the list of early
 hierarchies, the second that of the late hierarchies, and the third the
 list of the last hierarchies."
+  ;; EMACSPACKAGEPATH is a historical kludge
   (let ((envvar-value (getenv "EMACSPACKAGEPATH")))
-    (if envvar-value
-	(packages-split-package-path (paths-decode-directory-path envvar-value))
+    (cond
+     (envvar-value
+      (packages-split-package-path (paths-decode-directory-path envvar-value)))
+     (configure-package-path
       (packages-deconstruct
        (packages-split-package-path configure-package-path)
-       #'(lambda (configure-early-package-hierarchies
-		  configure-late-package-hierarchies
-		  configure-last-package-hierarchies)
+       #'(lambda (early late last)
 	   (list
 	    (packages-find-package-hierarchies (list user-init-directory)
-					       configure-early-package-hierarchies)
+					       "EMACSEARLYPACKAGES"
+					       early)
 	    (packages-find-package-hierarchies (packages-find-installation-package-directories roots)
-					       configure-late-package-hierarchies)
+					       "EMACSLATEPACKAGES"
+					       
+					       late)
 	    (packages-find-package-hierarchies '()
-					       configure-last-package-hierarchies)))))))
-
+					       "EMACSLASTPACKAGES"
+					       last)))))
+     (t
+      (list
+       (packages-find-package-hierarchies (or configure-early-package-directories
+					      (list user-init-directory))
+					  "EMACSEARLYPACKAGES")
+       (packages-find-package-hierarchies (or configure-late-package-directories
+					      (packages-find-installation-package-directories roots))
+					  "EMACSLATEPACKAGES")
+       (packages-find-package-hierarchies configure-last-package-directories
+					  "EMACSLASTPACKAGES"))))))
+      
 (defun packages-find-package-library-path (package-hierarchies suffixes)
   "Construct a path into a component of the packages hierarchy.
 PACKAGE-HIERARCHIES is a list of package hierarchies.
--- a/man/ChangeLog	Mon Dec 26 22:50:50 2005 +0000
+++ b/man/ChangeLog	Tue Dec 27 18:51:30 2005 +0000
@@ -1,3 +1,11 @@
+2005-11-25  Mike Sperber  <mike@xemacs.org>
+
+	* lispref/packaging.texi (The User View): 
+	* xemacs/startup.texi (Startup Paths): 
+	* xemacs-faq.texi (Q2.1.6): Document new configure options and
+	environment variables for
+	package locations.
+
 2005-12-24  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* xemacs/keystrokes.texi (Keystrokes): 
--- a/man/lispref/packaging.texi	Mon Dec 26 22:50:50 2005 +0000
+++ b/man/lispref/packaging.texi	Tue Dec 27 18:51:30 2005 +0000
@@ -168,9 +168,13 @@
 results in a very ``clean'' @code{load-path}.
 
 The order of search can be changed at build time by specifying the
-@samp{--package-path} option to @file{configure}, or at run-time by
-specifying the @code{EMACSPACKAGEPATH} environment variable.
-@xref{Packages,,,xemacs}.
+@samp{--with-user-packages} (an alias for @samp{--with-early-packages}),
+@samp{--with-system-packages} (an alias for
+@samp{--with-late-packages}), and @samp{--with-legacy-packages} (an
+alias for @samp{--with-last-packages}) options to @file{configure}, or
+at run-time by specifying the @code{EMACSEARLYPACKAGES},
+@code{EMACSLATEPACKAGES}, @code{EMACSLASTPACKAGES} environment
+variables.  @xref{Packages,,,xemacs}.
 
 @c #### The following description is quite possibly inaccurate.
 @c Please, Michael, write some specs up!
--- a/man/xemacs-faq.texi	Mon Dec 26 22:50:50 2005 +0000
+++ b/man/xemacs-faq.texi	Tue Dec 27 18:51:30 2005 +0000
@@ -7,7 +7,7 @@
 @finalout
 @titlepage
 @title XEmacs FAQ
-@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2005/10/24 20:39:47 $
+@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2005/12/27 18:51:21 $
 @sp 1
 @author Ben Wing <ben@@xemacs.org>
 @author Tony Rossini <rossini@@u.washington.edu>
@@ -3268,7 +3268,7 @@
 with @samp{$prefix} (for example, you're a developer and are compiling
 the packages yourself, and want your own private copy of everything),
 you can also directly specify this using @file{configure}.  To do this
-with 21.5 and above use the @samp{--with-package-prefix} parameter to
+with 21.5 and above use the @samp{--with-late-packages} parameter to
 specify the directory under which you untarred the above tarballs.
 Under 21.4 and previous you need to use @samp{--package-path}.  Using
 these options looks something like this:
@@ -3506,10 +3506,15 @@
 under @file{/usr/local/lib/xemacs}.
 
 You can specify where exactly XEmacs looks for packages by using the
-@samp{--with-package-prefix} or @samp{--with-package-path} parameters to
-@file{configure} (or the equivalent settings in @file{config.inc}, under
-Windows), or setting the @samp{EMACSPACKAGEPATH} environment variable
-(which has the same format as @samp{--with-package-path}).  @xref{Q2.1.1}.
+@samp{--with-user-packages} (an alias for @samp{--with-early-packages})
+or @samp{--with-system-packages} (an alias for
+@samp{--with-late-packages}) or @samp{--with-legacy-packages}
+(an alias for @samp{--with-last-packages})
+parameters to @file{configure} (or the equivalent settings in
+@file{config.inc}, under Windows), or setting the
+@samp{EMACSEARLYPACKAGES}, @samp{EMACSLATEPACKAGES}, and
+@samp{EMACSLASTPACKAGES} environment variables (which have the same
+format as the configure options).  @xref{Q2.1.1}.
 
 See @file{configure.usage} for more info about the format of these
 @file{configure} parameters.
--- a/man/xemacs/startup.texi	Mon Dec 26 22:50:50 2005 +0000
+++ b/man/xemacs/startup.texi	Tue Dec 27 18:51:30 2005 +0000
@@ -82,15 +82,14 @@
 hierarchy.
 
 It is possible to specify at configure-time the location of the various
-package hierarchies with the @code{--package-path} option to configure.
+package directories with the @code{--with-user-packages} (an alias for
+@samp{--with-early-packages}), @code{--with-system-packages} (an alias
+for @samp{--with-late-packages}), and @code{--with-legacy-packages} (an
+alias for @samp{--with-last-packages}) options to configure.
 @cindex package path
-The early, late, and last components of the package path are separated
-by double instead of single colons.  If all three components are
-present, they locate the early, late, and last package hierarchies
-respectively.  If two components are present, they locate the early and
-late hierarchies.  If only one component is present, it locates the
-late hierarchy.  At run time, the package path may also be specified via
-the @code{EMACSPACKAGEPATH} environment variable.
+At run time, the package directories may also be specified via the
+@code{EMACSEARLYPACKAGES}, @code{EMACSLATEPACKAGES}, and
+@code{EMACSLASTPACKAGES} environment variables.
 
 An XEmacs package hierarchy is laid out just like a normal installed
 XEmacs directory.  It may have @file{lisp}, @file{etc}, @file{info}, and
--- a/netinstall/ChangeLog	Mon Dec 26 22:50:50 2005 +0000
+++ b/netinstall/ChangeLog	Tue Dec 27 18:51:30 2005 +0000
@@ -1,3 +1,9 @@
+2005-11-25  Mike Sperber  <mike@xemacs.org>
+
+	* reginfo.h (XEMACS_INFO_XEMACS_EARLY_PACKAGES_KEY)
+	(XEMACS_INFO_XEMACS_LATE_PACKAGES_KEY)
+	(XEMACS_INFO_XEMACS_LAST_PACKAGES_KEY): Add.
+
 2005-12-18  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* XEmacs 21.5.24 "dandelion" is released.
--- a/netinstall/reginfo.h	Mon Dec 26 22:50:50 2005 +0000
+++ b/netinstall/reginfo.h	Tue Dec 27 18:51:30 2005 +0000
@@ -8,6 +8,9 @@
 #define XEMACS_INFO_XEMACS_ROOT_KEY "emacs_dir"
 #define XEMACS_INFO_XEMACS_ROOT_TYPE "install_type"
 #define XEMACS_INFO_XEMACS_PACKAGE_KEY "EMACSPACKAGEPATH"
+#define XEMACS_INFO_XEMACS_EARLY_PACKAGES_KEY "EMACSEARLYPACKAGES"
+#define XEMACS_INFO_XEMACS_LATE_PACKAGES_KEY "EMACSLATEPACKAGES"
+#define XEMACS_INFO_XEMACS_LAST_PACKAGES_KEY "EMACSLASTPACKAGES"
 #define XEMACS_INFO_XEMACS_VERSION_KEY "version"
 
 #define XEMACS_DEFAULT_ROOT "\\Program Files\\XEmacs"
--- a/src/ChangeLog	Mon Dec 26 22:50:50 2005 +0000
+++ b/src/ChangeLog	Tue Dec 27 18:51:30 2005 +0000
@@ -1,3 +1,21 @@
+2005-11-25  Mike Sperber  <mike@xemacs.org>
+
+	* nt.c (init_mswindows_environment): Add EMACSEARLYPACKAGES,
+	EMACSLATEPACKAGES, EMACSLASTPACKAGES.
+
+	* config.h.in: 
+	(PATH_EARLY_PACKAGE_DIRECTORIES, PATH_LATE_PACKAGE_DIRECTORIES)
+	(PATH_LAST_PACKAGE_DIRECTORIES): Add.
+
+	* paths.h.in: 
+	(PATH_EARLY_PACKAGE_DIRECTORIES, PATH_LATE_PACKAGE_DIRECTORIES)
+	(PATH_LAST_PACKAGE_DIRECTORIES): Add.
+
+	* emacs.c: Add Vconfigure_early_package_directories,
+	Vconfigure_late_package_directories,
+	Vconfigure_last_package_directories.
+	(complex_vars_of_emacs): Set them.
+
 2005-12-25  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* alloc.c:
--- a/src/config.h.in	Mon Dec 26 22:50:50 2005 +0000
+++ b/src/config.h.in	Tue Dec 27 18:51:30 2005 +0000
@@ -766,6 +766,9 @@
 #undef SITEMODULEDIR_USER_DEFINED
 #undef DOCDIR_USER_DEFINED
 #undef LISPDIR_USER_DEFINED
+#undef EARLY_PACKAGE_DIRECTORIES_USER_DEFINED
+#undef LATE_PACKAGE_DIRECTORIES_USER_DEFINED
+#undef LAST_PACKAGE_DIRECTORIES_USER_DEFINED
 #undef PACKAGE_PATH_USER_DEFINED
 #undef SITELISPDIR_USER_DEFINED
 #undef ARCHLIBDIR_USER_DEFINED
--- a/src/emacs.c	Mon Dec 26 22:50:50 2005 +0000
+++ b/src/emacs.c	Tue Dec 27 18:51:30 2005 +0000
@@ -542,6 +542,9 @@
 Lisp_Object Vmodule_directory, Vconfigure_module_directory;
 Lisp_Object Vsite_module_directory, Vconfigure_site_module_directory;
 Lisp_Object Vconfigure_package_path;
+Lisp_Object Vconfigure_early_package_directories;
+Lisp_Object Vconfigure_late_package_directories;
+Lisp_Object Vconfigure_last_package_directories;
 Lisp_Object Vdata_directory, Vconfigure_data_directory;
 Lisp_Object Vdoc_directory, Vconfigure_doc_directory;
 Lisp_Object Vconfigure_lock_directory;
@@ -4508,6 +4511,36 @@
   Vconfigure_module_directory = Qnil;
 #endif
 
+  DEFVAR_LISP ("configure-early-package-directories", &Vconfigure_early_package_directories /*
+For internal use by the build procedure only.
+configure's idea of what the early package directories will be.
+*/ );
+#ifdef PATH_EARLY_PACKAGE_DIRECTORIES
+  Vconfigure_early_package_directories = split_external_path (PATH_EARLY_PACKAGE_DIRECTORIES);
+#else
+  Vconfigure_early_package_directories = Qnil;
+#endif
+
+  DEFVAR_LISP ("configure-late-package-directories", &Vconfigure_late_package_directories /*
+For internal use by the build procedure only.
+configure's idea of what the late package directories will be.
+*/ );
+#ifdef PATH_LATE_PACKAGE_DIRECTORIES
+  Vconfigure_late_package_directories = split_external_path (PATH_LATE_PACKAGE_DIRECTORIES);
+#else
+  Vconfigure_late_package_directories = Qnil;
+#endif
+
+  DEFVAR_LISP ("configure-last-package-directories", &Vconfigure_last_package_directories /*
+For internal use by the build procedure only.
+configure's idea of what the last package directories will be.
+*/ );
+#ifdef PATH_LAST_PACKAGE_DIRECTORIES
+  Vconfigure_last_package_directories = split_external_path (PATH_LAST_PACKAGE_DIRECTORIES);
+#else
+  Vconfigure_last_package_directories = Qnil;
+#endif
+
   DEFVAR_LISP ("configure-package-path", &Vconfigure_package_path /*
 For internal use by the build procedure only.
 configure's idea of what the package path will be.
--- a/src/nt.c	Mon Dec 26 22:50:50 2005 +0000
+++ b/src/nt.c	Tue Dec 27 18:51:30 2005 +0000
@@ -443,6 +443,9 @@
       "EMACSDATA",
       "EMACSPATH",
       "EMACSPACKAGEPATH",
+      "EMACSEARLYPACKAGES",
+      "EMACSLATEPACKAGES",
+      "EMACSLASTPACKAGES",
       "EMACSLOCKMETHOD",
       "INFOPATH"
     };
--- a/src/paths.h.in	Mon Dec 26 22:50:50 2005 +0000
+++ b/src/paths.h.in	Tue Dec 27 18:51:30 2005 +0000
@@ -36,6 +36,10 @@
 
    PATH_MODULESEARCH	The default value of `module-load-path'.
 
+   PATH_EARLY_PACKAGE_DIRECTORIES The value of `--with-early-packages'.
+   PATH_LATE_PACKAGE_DIRECTORIES  The value of `--with-late-packages'.
+   PATH_EARLY_PACKAGE_DIRECTORIES The value of `--with-last-packages'.
+
    PATH_PACKAGEPATH     The default value of `package-path'.
 
    PATH_SITE            The default location of site-specific Lisp files.
@@ -84,6 +88,18 @@
 #define  PATH_SITE_MODULES "@SITEMODULEDIR@"
 #endif
 
+#ifdef EARLY_PACKAGE_DIRECTORIES_USER_DEFINED
+#define PATH_EARLY_PACKAGE_DIRECTORIES "@EARLY_PACKAGE_DIRECTORIES@"
+#endif
+
+#ifdef LATE_PACKAGE_DIRECTORIES_USER_DEFINED
+#define PATH_LATE_PACKAGE_DIRECTORIES "@LATE_PACKAGE_DIRECTORIES@"
+#endif
+
+#ifdef LAST_PACKAGE_DIRECTORIES_USER_DEFINED
+#define PATH_LAST_PACKAGE_DIRECTORIES "@LAST_PACKAGE_DIRECTORIES@"
+#endif
+
 #ifdef PACKAGE_PATH_USER_DEFINED
 #define PATH_PACKAGEPATH "@PACKAGE_PATH@"
 #endif