This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 7 of 8] scripts/wrapper.c: Under MacOS set DYLD_LIBRARY_PATH


# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1274524622 -7200
# Node ID 0c64aa7189a9687158505850d6e188a66c04e5cd
# Parent  072e4451cbffd1b1f9039a66f9095e44d8557b1e
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 072e4451cbff -r 0c64aa7189a9 scripts/wrapper.c
--- a/scripts/wrapper.c	Sat May 22 10:57:50 2010 +0200
+++ b/scripts/wrapper.c	Sat May 22 12:37:02 2010 +0200
@@ -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 @@
 
   /* 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 );

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]