# HG changeset patch # User Titus von Boxberg # Date 1274524622 -7200 # Node ID f02cfced8f552f9c69762b65d47c97bcaf1e4e46 # Parent ea472c30c35668455f2763176cb79b85e7f0004b scripts/wrapper.c: Under MacOS set DYLD_LIBRARY_PATH Depending on (predefined) macro __APPLE__, use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH. diff -r ea472c30c356 -r f02cfced8f55 scripts/wrapper.c --- a/scripts/wrapper.c Sat May 22 18:48:50 2010 +0200 +++ b/scripts/wrapper.c Sat May 22 12:37:02 2010 +0200 @@ -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 @@ /* 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 @@ strcat( basedir, ldlibpath ); } - if( setenv( "LD_LIBRARY_PATH", basedir, 1 ) ) { + if( setenv( LDLP, basedir, 1 ) ) { errno = ENOMEM; perror( "tool wrapper" ); exit( 1 );