Support the CORE_LIBRARIES environment variable on Unix (#5112)
authorManu <manu-silicon@users.noreply.github.com>
Wed, 25 May 2016 02:21:23 +0000 (11:21 +0900)
committerJan Kotas <jkotas@microsoft.com>
Wed, 25 May 2016 02:21:23 +0000 (19:21 -0700)
Mimic the Windows behavior by adding to the search path of native dlls
the content of the CORE_LIBRARIES environment variable.

src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp

index b9e62ff..fb70c69 100644 (file)
@@ -292,7 +292,14 @@ int ExecuteManagedAssembly(
     std::string appPath;
     GetDirectory(managedAssemblyAbsolutePath, appPath);
 
+    // Construct native search directory paths
     std::string nativeDllSearchDirs(appPath);
+    char *coreLibraries = getenv("CORE_LIBRARIES");
+    if (coreLibraries)
+    {
+        nativeDllSearchDirs.append(":");
+        nativeDllSearchDirs.append(coreLibraries);
+    }
     nativeDllSearchDirs.append(":");
     nativeDllSearchDirs.append(clrFilesAbsolutePath);