From 3f783c4dfa9844fbb3ef8565a11847234ad01c3a Mon Sep 17 00:00:00 2001 From: Pere Mato Date: Wed, 2 Nov 2016 19:01:25 +0100 Subject: [PATCH] On MacOS, remove from the list of libraries, the Python dynamically loaded ones. --- core/base/src/TSystem.cxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/core/base/src/TSystem.cxx b/core/base/src/TSystem.cxx index c1c29ca1a563f..401d769fe0e56 100644 --- a/core/base/src/TSystem.cxx +++ b/core/base/src/TSystem.cxx @@ -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;