built-in library path for (optional) libgmp on macos;
authorwenzelm
Fri, 09 Feb 2018 14:28:24 +0100
changeset 67582 bf5c69acf2be
parent 67581 30f412d1d7c3
child 67583 c933a5d4e1ee
built-in library path for (optional) libgmp on macos;
src/Pure/Admin/build_polyml.scala
--- a/src/Pure/Admin/build_polyml.scala	Fri Feb 09 11:47:18 2018 +0100
+++ b/src/Pure/Admin/build_polyml.scala	Fri Feb 09 14:28:24 2018 +0100
@@ -169,9 +169,18 @@
       File.copy(Path.explode(file).expand_env(settings), target)
 
 
-    /* rpath */
+    /* built-in library path */
 
-    if (Platform.is_linux) bash(target, "chrpath -r '$ORIGIN' poly", echo = true).check
+    if (Platform.is_linux) {
+      bash(target, "chrpath -r '$ORIGIN' poly", echo = true).check
+    }
+    else if (Platform.is_macos) {
+      for (file <- ldd_files) {
+        bash(target,
+          """install_name_tool -change """ + Bash.string(file) + " " +
+            Bash.string("@executable_path/" + Path.explode(file).base_name) + " poly").check
+      }
+    }
   }