From 783bf96a56316a01b2790b3c3cb15436ab6d0e42 Mon Sep 17 00:00:00 2001 From: Torsten Maehne Date: Mon, 27 Aug 2012 11:28:48 +0200 Subject: [PATCH] zgz: dynamic library handling on Mac OS X On Mac OS X, DYLD_LIBRARY_PATH has to be set instead of LD_LIBRARY_PATH to find dynamic libraries in a non-standard path. Signed-off-by: Philipp A. Hartmann (cherry picked from commit 19748569d2d98100dabbc3c3ec9d93b8f32e5ef7) --- zgz/zgz.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zgz/zgz.c b/zgz/zgz.c index 7e7a912..377b073 100644 --- a/zgz/zgz.c +++ b/zgz/zgz.c @@ -528,7 +528,14 @@ static void rebrain(char *zombie, char *program, int level, char *opts) { char buf[128]; - sprintf(buf, "LD_LIBRARY_PATH=%s/%s %s -%i %s", + +#if defined(__APPLE__) && defined(__MACH__) +# define LD_PATH_VAR "DYLD_LIBRARY_PATH" +#else +# define LD_PATH_VAR "LD_LIBRARY_PATH" +#endif + + sprintf(buf, LD_PATH_VAR "=%s/%s %s -%i %s", ZGZ_LIB, zombie, program, level, opts); exit(system(buf)); } -- 2.7.4