summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTitus von Boxberg <titus@v9g.de>2010-05-22 10:37:02 (GMT)
committerTitus von Boxberg <titus@v9g.de>2010-05-22 10:37:02 (GMT)
commit0a63e8222c2865406f0c8967fedd8a89c2c816d8 (patch)
treeeb092bad381c59d026502953785d9ea615d1419e /scripts
parentd6d670bac2d912db684f15b7e1a991756f235528 (diff)
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')
-rw-r--r--scripts/wrapper.c9
1 files changed, 7 insertions, 2 deletions
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 <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 );