]> code.delx.au - gnu-emacs/commitdiff
Make a self-contained ns build able to find its own libexec directory
authorGlenn Morris <rgm@gnu.org>
Mon, 14 May 2012 16:33:11 +0000 (09:33 -0700)
committerGlenn Morris <rgm@gnu.org>
Mon, 14 May 2012 16:33:11 +0000 (09:33 -0700)
Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00298.html

* src/nsterm.m (ns_init_paths):
Put "libexec" before "bin", for the sake of init_callproc_1.

src/ChangeLog
src/nsterm.m

index d6df87c27e5c1c00733803df67923b65d8ea2af8..2d20f13dced917b0b1ca5a6c5df97bb8cc87e307 100644 (file)
@@ -1,6 +1,7 @@
 2012-05-14  Glenn Morris  <rgm@gnu.org>
 
        * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
+       Put "libexec" before "bin", for the sake of init_callproc_1.
 
 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
 
index 9a5122e5e8025d135a4c4856e7924079857dac65..4b8b2bb48201b7e6bf7cdbfcb56dba448c56fed7 100644 (file)
@@ -338,11 +338,18 @@ ns_init_paths (void)
 /*NSLog (@"loadPath: '%@'\n", resourcePaths); */
     }
 
+  /* Normally, Emacs does not add its own bin/ directory to the PATH.
+     However, a self-contained NS build has a different layout, with
+     bin/ and libexec/ subdirectories in the directory that contains
+     Emacs.app itself.
+     We put libexec first, because init_callproc_1 uses the first
+     element to initialize exec-directory.  An alternative would be
+     for init_callproc to check for invocation-directory/libexec.  */
   if (!getenv ("EMACSPATH"))
     {
       NSArray *paths = [binDir stringsByAppendingPaths:
-                                  [NSArray arrayWithObjects: @"bin",
-                                                             @"libexec", nil]];
+                                  [NSArray arrayWithObjects: @"libexec",
+                                                             @"bin", nil]];
       NSEnumerator *pathEnum = [paths objectEnumerator];
       resourcePaths = @"";
       while (resourcePath = [pathEnum nextObject])