diff -r 160fc94ed49f scripts/wrapper.c --- a/scripts/wrapper.c Sun Jan 31 23:04:35 2010 +0100 +++ b/scripts/wrapper.c Tue Feb 02 23:11:25 2010 +0100 @@ -7,6 +7,11 @@ #include #include +#ifdef Darwin +static const char * ldlp = "DYLD_LIBRARY_PATH"; +#else +static const char * 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 );