From 985584aed1505c40f97b0cfc983f4a5e05b127d8 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 14 May 2012 09:33:11 -0700 Subject: [PATCH] Make a self-contained ns build able to find its own libexec directory 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 | 1 + src/nsterm.m | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d6df87c27e..2d20f13dce 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,7 @@ 2012-05-14 Glenn Morris * 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 diff --git a/src/nsterm.m b/src/nsterm.m index 9a5122e5e8..4b8b2bb482 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -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]) -- 2.39.2