From 4817b856d820563dd0d2a175bdbac5fdb0863398 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Jul 2011 21:51:47 +0200 Subject: Add support for Mac OS X DYLD_LIBRARY_PATH --- odb/odb.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'odb/odb.cxx') 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; -- cgit v1.1