Skip to content

Commit

Permalink
On MacOS, remove from the list of libraries, the Python dynamically l…
Browse files Browse the repository at this point in the history
…oaded ones.
  • Loading branch information
peremato committed Nov 2, 2016
1 parent 644884b commit 3f783c4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions core/base/src/TSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2201,6 +2201,33 @@ const char *TSystem::GetLibraries(const char *regexp, const char *options,
} else
fListLibs = libs;

#if defined(R__MACOSX)
// We need to remove the libraries that are dynamically loaded and not linked
{
TString libs2 = fListLibs;
TString maclibs;

static TRegexp separator("[^ \\t\\s]+");
static TRegexp dynload("/lib-dynload/");

Ssiz_t start, index, end;
start = index = end = 0;

while ((start < libs2.Length()) && (index != kNPOS)) {
index = libs2.Index(separator, &end, start);
if (index >= 0) {
TString s = libs2(index, end);
if (s.Index(dynload) == kNPOS) {
if (!maclibs.IsNull()) maclibs.Append(" ");
maclibs.Append(s);
}
}
start += end+1;
}
fListLibs = maclibs;
}
#endif

#if defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5)
if (so2dylib) {
TString libs2 = fListLibs;
Expand Down

0 comments on commit 3f783c4

Please sign in to comment.