Description: Add DOCDIR as a location for the dump file
Author: Probably James LewisMoss <dres@debian.org> 
Origin: Old XEmacs packages
Forwarded: no
--- a/configure.in
+++ b/configure.in
@@ -5015,6 +5015,7 @@
   esac
 done
 AC_SUBST(DOCDIR)
+AC_DEFINE_UNQUOTED(DOCDIR, "$docdir")
 
 AC_SUBST(archlibdir)
 AC_SUBST(ARCHLIBDIR_USER_DEFINED)
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -916,6 +916,7 @@
 #undef MODULEDIR_USER_DEFINED
 #undef SITEMODULEDIR_USER_DEFINED
 #undef DOCDIR_USER_DEFINED
+#undef DOCDIR
 #undef LISPDIR_USER_DEFINED
 #undef PACKAGE_PATH_USER_DEFINED
 #undef SITELISPDIR_USER_DEFINED
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1401,6 +1401,11 @@
 
 	* specifier.c (Fvalid_specifier_type_p): Typo in comment.
 
+2002-11-16  James LewisMoss  <dres@lewismoss.org>
+
+	* dumper.c (pdump_load): add search for file DUMP in DOCDIR along
+	with the patterned exe path search.
+
 2002-11-13  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* event-Xt.c (Xt_timeout):
--- a/src/dumper.c
+++ b/src/dumper.c
@@ -1323,9 +1323,24 @@
 }
 #endif /* !WIN32_NATIVE */
 
+static int
+pdump_file_doc_dir_try (char *exe_path)
+{
+  char *w = exe_path + strlen (exe_path);
+
+  sprintf (w, "%s", "DUMP");
+
+  if (pdump_file_get (exe_path))
+    {
+      if (pdump_load_check ())
+        return 1;
+      pdump_free ();
+    }
+  return 0;
+}
 
 static int
-pdump_file_try (char *exe_path)
+pdump_file_exe_path_try (char *exe_path)
 {
   char *w = exe_path + strlen (exe_path);
 
@@ -1440,9 +1455,16 @@
 
   /* Save exe_path because pdump_file_try() modifies it */
   strcpy(real_exe_path, exe_path);
-  if (pdump_file_try (exe_path)
+  if (pdump_file_exe_path_try (exe_path)
       || (xrealpath(real_exe_path, real_exe_path)
-	  && pdump_file_try (real_exe_path)))
+	  && pdump_file_exe_path_try (real_exe_path)))
+    {
+      pdump_load_finish ();
+      return 1;
+    }
+
+  sprintf(exe_path, "%s", DOCDIR);
+  if (pdump_file_doc_dir_try (exe_path))
     {
       pdump_load_finish ();
       return 1;
