aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-07-25 21:51:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-07-25 21:51:47 +0200
commit4817b856d820563dd0d2a175bdbac5fdb0863398 (patch)
tree5a68ed9ae817d6d75447d701fc33a1b7dce89533
parent62f80ff3be185a5b8639b5326aa97cff484e663b (diff)
Add support for Mac OS X DYLD_LIBRARY_PATH1.5.0
-rw-r--r--odb/odb.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/odb/odb.cxx b/odb/odb.cxx
index 258d7fa..2a14eb9 100644
--- a/odb/odb.cxx
+++ b/odb/odb.cxx
@@ -185,9 +185,15 @@ main (int argc, char* argv[])
//
#ifndef _WIN32
{
+#ifdef __APPLE__
+ char const name[] = "DYLD_LIBRARY_PATH";
+#else
+ char const name[] = "LD_LIBRARY_PATH";
+#endif
+
string ld_paths;
- if (char const* s = getenv ("LD_LIBRARY_PATH"))
+ if (char const* s = getenv (name))
ld_paths = s;
path d (gxx.directory ());
@@ -202,7 +208,7 @@ main (int argc, char* argv[])
else
ld_paths = d.string () + path::traits::path_separator + ld_paths;
- if (setenv ("LD_LIBRARY_PATH", ld_paths.c_str (), 1) != 0)
+ if (setenv (name, ld_paths.c_str (), 1) != 0)
{
e << argv[0] << ": error: unable to update environment" << endl;
return 1;