From 0a63e8222c2865406f0c8967fedd8a89c2c816d8 Mon Sep 17 00:00:00 2001 From: Titus von Boxberg Date: Sat, 22 May 2010 12:37:02 +0200 Subject: scripts/wrapper.c: Under MacOS set DYLD_LIBRARY_PATH Depending on (predefined) macro __APPLE__, use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH. diff --git a/scripts/wrapper.c b/scripts/wrapper.c index 3d815b4..f836188 100644 --- a/scripts/wrapper.c +++ b/scripts/wrapper.c @@ -7,6 +7,11 @@ #include #include +#ifdef __APPLE__ +#define LDLP "DYLD_LIBRARY_PATH" +#else +#define LDLP "LD_LIBRARY_PATH" +#endif /* Needed for execve */ extern char **environ; @@ -106,7 +111,7 @@ int main( int argc, /* Now add the directory with our runtime libraries to the front of the library search path, LD_LIBRARY_PATH */ - ldlibpath = getenv( "LD_LIBRARY_PATH" ); + ldlibpath = getenv(LDLP); if( ldlibpath ) { basedir = (char*) realloc( basedir, strlen( basedir ) + strlen( ldlibpath ) @@ -115,7 +120,7 @@ int main( int argc, strcat( basedir, ldlibpath ); } - if( setenv( "LD_LIBRARY_PATH", basedir, 1 ) ) { + if( setenv( LDLP, basedir, 1 ) ) { errno = ENOMEM; perror( "tool wrapper" ); exit( 1 ); -- cgit v0.10.2-6-g49f6