diff options
author | Titus von Boxberg <titus@v9g.de> | 2010-05-22 12:37:02 +0200 |
---|---|---|
committer | Titus von Boxberg <titus@v9g.de> | 2010-05-22 12:37:02 +0200 |
commit | 0a63e8222c2865406f0c8967fedd8a89c2c816d8 (patch) | |
tree | eb092bad381c59d026502953785d9ea615d1419e /scripts/wrapper.c | |
parent | d6d670bac2d912db684f15b7e1a991756f235528 (diff) | |
download | crosstool-ng-0a63e8222c2865406f0c8967fedd8a89c2c816d8.tar.gz crosstool-ng-0a63e8222c2865406f0c8967fedd8a89c2c816d8.tar.bz2 crosstool-ng-0a63e8222c2865406f0c8967fedd8a89c2c816d8.zip |
scripts/wrapper.c: Under MacOS set DYLD_LIBRARY_PATH
Depending on (predefined) macro __APPLE__, use DYLD_LIBRARY_PATH
instead of LD_LIBRARY_PATH.
Diffstat (limited to 'scripts/wrapper.c')
-rw-r--r-- | scripts/wrapper.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/wrapper.c b/scripts/wrapper.c index 3d815b43..f8361883 100644 --- a/scripts/wrapper.c +++ b/scripts/wrapper.c @@ -7,6 +7,11 @@ #include <unistd.h> #include <errno.h> +#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 ); |