[21.5] Use .../share instead of .../lib for datadir

Michael Sperber sperber at informatik.uni-tuebingen.de
Tue Jul 31 10:07:38 EDT 2007


This changes the directory layout to use the share subdirectory for
architecture-independent files.  This is necessary to remove the
horrible kludge that would prevent anything *but* .../share to be used
for datadir, and generally brings us closer to widely used filesystem
layouts.

I'll commit Thursday if nobody objects.

ChangeLog

2007-07-31  Mike Sperber  <mike at xemacs.org>

	* configure.ac: Don't divert `share' to `lib' for datadir.
	Also, define AC_DATAROOTDIR_CHECKED to shut up autoconf.

lisp/ChangeLog

2007-07-31  Mike Sperber  <mike at xemacs.org>

	* find-paths.el (paths-for-each-site-directory): 
	(paths-find-site-directory):
	(paths-find-site-directories):
	(paths-for-each-version-directory):
	(paths-find-version-directory):
	(paths-find-version-directories): Add `arch-dependent-p' argument
	to distinguish between `lib' and `share'.
	(paths-find-architecture-directory): Follow above change.
	* packages.el (packages-find-installation-package-directories): Ditto.
	* setup-paths.el (paths-find-site-lisp-directory): 
	(paths-find-site-module-directory): 
	(paths-find-lisp-directory): 
	(paths-find-mule-lisp-directory): 
	(paths-find-module-directory): 
	(paths-find-data-directory): Ditto.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.ac,v
retrieving revision 1.59
diff -u -r1.59 configure.ac
--- configure.ac	21 May 2007 03:50:13 -0000	1.59
+++ configure.ac	31 Jul 2007 14:04:19 -0000
@@ -1073,12 +1073,14 @@
 then
   AC_DEFINE(INFODIR_USER_DEFINED)
   AC_DEFINE(LISPDIR_USER_DEFINED)
-  AC_DEFINE(MODULEDIR_USER_DEFINED)
   AC_DEFINE(ETCDIR_USER_DEFINED)
-  AC_DEFINE(DOCDIR_USER_DEFINED)
+fi
+
+if test "x$lib_expanded" != "x$prefix_expanded/lib"
+then
+  AC_DEFINE(MODULEDIR_USER_DEFINED)
   AC_DEFINE(ARCHLIBDIR_USER_DEFINED)
-else
-  datadir='${prefix}/lib'
+  AC_DEFINE(DOCDIR_USER_DEFINED)
 fi
 
 XE_EXPAND_VARIABLE(exec_prefix,exec_prefix_expanded)
@@ -5702,6 +5704,8 @@
 AC_SUBST(instvardir)
 AC_SUBST(srcdir)
 AC_SUBST(bindir)
+dnl Shut up spurious warnings from autoconf
+AC_DEFUN([AC_DATAROOTDIR_CHECKED])
 AC_SUBST(datadir)
 AC_SUBST(statedir)
 AC_SUBST(libdir)
Index: lisp/find-paths.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/find-paths.el,v
retrieving revision 1.30
diff -u -r1.30 find-paths.el
--- lisp/find-paths.el	19 Dec 2006 15:28:45 -0000	1.30
+++ lisp/find-paths.el	31 Jul 2007 14:04:21 -0000
@@ -207,12 +207,13 @@
 				    suffix base
 				    envvar default keep-suffix)))
 
-(defun paths-for-each-site-directory (func roots base &optional envvar default)
+(defun paths-for-each-site-directory (func roots base arch-dependent-p &optional envvar default)
   "Iterate over the site-specific directories in the XEmacs hierarchy.
 FUNC is a function that called for each directory, with the directory
 as the only argument.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value."
@@ -220,45 +221,48 @@
 				  roots
 				  (file-name-as-directory
 				   (paths-construct-path (list
-							  "lib"
+							  (if arch-dependent-p "lib" "share")
 							  emacs-program-name)))
 				  base
 				  envvar default))
 
-(defun paths-find-site-directory (roots base &optional envvar default)
+(defun paths-find-site-directory (roots base arch-dependent-p &optional envvar default)
   "Find a site-specific directory in the XEmacs hierarchy.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value."
   (catch 'gotcha
     (paths-for-each-site-directory #'(lambda (dir)
 				       (throw 'gotcha dir))
-				   roots base
+				   roots base arch-dependent-p
 				   envvar default)))
 
-(defun paths-find-site-directories (roots base &optional envvar default)
+(defun paths-find-site-directories (roots base arch-dependent-p &optional envvar default)
   "Find a list of site-specific directories in the XEmacs hierarchy.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value."
   (let ((l '()))
     (paths-for-each-site-directory #'(lambda (dir)
 					(setq l (cons dir l)))
-				   roots base
+				   roots base arch-dependent-p
 				   envvar default)
     (reverse l)))
 
-(defun paths-for-each-version-directory (func roots base
+(defun paths-for-each-version-directory (func roots base arch-dependent-p
 					 &optional envvar default enforce-version)
   "Iterate over version-specific directories in the XEmacs hierarchy.
 FUNC is a function that called for each directory, with the directory
 as the only argument.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value.
@@ -267,16 +271,17 @@
 				  roots
 				  (file-name-as-directory
 				   (paths-construct-path
-				    (list "lib"
+				    (list (if arch-dependent-p "lib" "share")
 					  (construct-emacs-version-name))))
 				  base
 				  envvar default))
 
-(defun paths-find-version-directory (roots base
+(defun paths-find-version-directory (roots base arch-dependent-p
 				     &optional envvar default enforce-version)
   "Find a version-specific directory in the XEmacs hierarchy.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value.
@@ -284,23 +289,24 @@
   (catch 'gotcha
     (paths-for-each-version-directory #'(lambda (dir)
 					  (throw 'gotcha dir))
-				      roots base
+				      roots base arch-dependent-p
 				      envvar default)))
 
-(defun paths-find-version-directories (roots base
+(defun paths-find-version-directories (roots base arch-dependent-p
 				       &optional envvar default enforce-version)
   "Find a list of version-specific directories in the XEmacs hierarchy.
 ROOTS must be a list of installation roots.
 BASE is the base to look for.
+ARCH-DEPENDENT-P says whether the file is architecture-specific.
 ENVVAR is the name of the environment variable that might also
 specify the directory.
 DEFAULT is the preferred value.
 If ENFORCE-VERSION is non-nil, the directory must contain the XEmacs version."
   (let ((l '()))
-    (paths-for-each-site-directory #'(lambda (dir)
-				       (setq l (cons dir l)))
-				   roots base
-				   envvar default)
+    (paths-for-each-version-directory #'(lambda (dir)
+					  (setq l (cons dir l)))
+				      roots base arch-dependent-p
+				      envvar default)
     (reverse l)))
 
 (defun paths-find-architecture-directory (roots base &optional envvar default)
@@ -315,12 +321,13 @@
    (paths-find-version-directory roots
 				 (paths-construct-path
 				  (list system-configuration base))
+				 t
 				 envvar default)
    (paths-find-version-directory roots
-				 base
+				 base t
 				 envvar)
    (paths-find-version-directory roots
-				 system-configuration
+				 system-configuration t
 				 envvar)))
 
 (defun construct-emacs-version-name ()
Index: lisp/packages.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/packages.el,v
retrieving revision 1.55
diff -u -r1.55 packages.el
--- lisp/packages.el	30 Dec 2005 16:42:36 -0000	1.55
+++ lisp/packages.el	31 Jul 2007 14:04:21 -0000
@@ -386,8 +386,8 @@
 (defun packages-find-installation-package-directories (roots)
   "Find the package directories in the XEmacs installation.
 ROOTS is a list of installation roots."
-  (paths-uniq-append (paths-find-version-directories roots "" nil nil t)
-		     (paths-find-site-directories roots "")))
+  (paths-uniq-append (paths-find-version-directories roots "" nil nil nil t)
+		     (paths-find-site-directories roots "" nil)))
 
 (defun packages-find-package-hierarchies (package-directories &optional envvar default)
   "Find package hierarchies in a list of package directories.
Index: lisp/setup-paths.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/setup-paths.el,v
retrieving revision 1.23
diff -u -r1.23 setup-paths.el
--- lisp/setup-paths.el	5 Feb 2007 15:19:18 -0000	1.23
+++ lisp/setup-paths.el	31 Jul 2007 14:04:21 -0000
@@ -159,21 +159,21 @@
   "Find the site Lisp directory of the XEmacs hierarchy.
 ROOTS is a list of installation roots."
   (paths-find-site-directory roots "site-lisp"
-			     nil
+			     nil nil
 			     configure-site-directory))
 
 (defun paths-find-site-module-directory (roots)
   "Find the site modules directory of the XEmacs hierarchy.
 ROOTS is a list of installation roots."
   (paths-find-site-directory roots "site-modules"
-			     nil
+			     t nil
 			     configure-site-module-directory))
 
 (defun paths-find-lisp-directory (roots)
   "Find the main Lisp directory of the XEmacs hierarchy.
 ROOTS is a list of installation roots."
   (paths-find-version-directory roots "lisp"
-				nil
+				nil nil
 				configure-lisp-directory))
 
 (defun paths-find-mule-lisp-directory (roots &optional lisp-directory)
@@ -187,7 +187,7 @@
 	(if (paths-file-readable-directory-p guess)
 	    guess
 	  (paths-find-version-directory roots "mule-lisp"
-					nil
+					nil nil
 					configure-mule-lisp-directory)))))
 
 (defun paths-find-module-directory (roots)
@@ -265,7 +265,7 @@
      (append
       (let ((info-directory
 	     (paths-find-version-directory roots "info"
-					   nil
+					   nil nil
 					   configure-info-directory)))
 	(and info-directory
 	     (list info-directory)))
@@ -319,7 +319,7 @@
 (defun paths-find-data-directory (roots)
   "Find the data directory.
 ROOTS is the list of installation roots."
-  (paths-find-version-directory roots "etc" "EMACSDATA" configure-data-directory))
+  (paths-find-version-directory roots "etc" nil "EMACSDATA" configure-data-directory))
 
 (defun paths-construct-data-directory-list (data-directory
 					    early-package-hierarchies


More information about the XEmacs-Patches mailing list