changeset 7465:fccf9d4df7bb

(init_callproc): Never set Vdata_directory based on the executable's location. But maybe set it from source dir.
author Richard M. Stallman <rms@gnu.org>
date Thu, 12 May 1994 06:35:19 +0000
parents 1e6adb18271b
children b48210278981
files src/callproc.c
diffstat 1 files changed, 25 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/callproc.c	Thu May 12 05:03:19 1994 +0000
+++ b/src/callproc.c	Thu May 12 06:35:19 1994 +0000
@@ -851,10 +851,34 @@
 	    {
 	      tem = Fexpand_file_name (build_string ("etc"),
 				       Vinstallation_directory);
-	      Vdoc_directory = Vdata_directory = Ffile_name_as_directory (tem);
+	      Vdoc_directory = Ffile_name_as_directory (tem);
 	    }
 	}
     }
+
+  /* Look for the files that should be in etc.  We don't use
+     Vinstallation_directory, because these files are never installed
+     in /bin near the executable, and they are never in the build
+     directory when that's different from the source directory.
+
+     Instead, if these files are not in the nominal place, we try the
+     source directory.  */
+  if (data_dir == 0)
+    {
+      Lisp_Object tem, tem1, newdir;
+
+      tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory);
+      tem1 = Ffile_exists_p (tem);
+      if (NILP (tem1))
+	{
+	  newdir = Fexpand_file_name (build_string ("../etc/"),
+				      build_string (PATH_DUMPLOADSEARCH));
+	  tem = Fexpand_file_name (build_string ("GNU"), newdir);
+	  tem1 = Ffile_exists_p (tem);
+	  if (!NILP (tem1))
+	    Vdata_directory = newdir;
+	}
+    }
 #endif
 
   tempdir = Fdirectory_file_name (Vexec_directory);