]> git.eshelyaron.com Git - emacs.git/commitdiff
(init_environment): Set emacs_dir correctly when running
authorJason Rumney <jasonr@gnu.org>
Tue, 19 Oct 2004 19:09:37 +0000 (19:09 +0000)
committerJason Rumney <jasonr@gnu.org>
Tue, 19 Oct 2004 19:09:37 +0000 (19:09 +0000)
emacs from the build directory.

src/ChangeLog
src/w32.c

index 5b22d072cf712b6303842287d21b3916e989f98b..750e3d52df34b66ef33d825465321d560a08a93e 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-19  Jason Rumney  <jasonr@gnu.org>
+
+       * w32.c (init_environment): Set emacs_dir correctly when running
+       emacs from the build directory.
+
 2004-10-19  Richard M. Stallman  <rms@gnu.org>
 
        * editfns.c (Fdelete_and_extract_region):
index 12d1f21b091fb6f5452411732f90a8176d3aac1f..7b54924d73667474cc64b9b7ff84801b66a93898 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -1005,6 +1005,32 @@ init_environment (char ** argv)
          _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
          _putenv (strdup (buf));
        }
+      /* Handle running emacs from the build directory: src/oo-spd/i386/  */
+
+      /* FIXME: should use substring of get_emacs_configuration ().
+        But I don't think the Windows build supports alpha, mips etc
+         anymore, so have taken the easy option for now.  */
+      else if (p && stricmp (p, "\\i386") == 0)
+       {
+         *p = 0;
+         p = strrchr (modname, '\\');
+         if (p != NULL)
+           {
+             *p = 0;
+             p = strrchr (modname, '\\');
+             if (p && stricmp (p, "\\src") == 0)
+               {
+                 char buf[SET_ENV_BUF_SIZE];
+
+                 *p = 0;
+                 for (p = modname; *p; p++)
+                   if (*p == '\\') *p = '/';
+
+                 _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
+                 _putenv (strdup (buf));
+               }
+           }
+       }
     }
 
     for (i = 0; i < (sizeof (env_vars) / sizeof (env_vars[0])); i++)