Prechádzať zdrojové kódy

mpfr: add support for additional platforms (#6582)

* mpfr: require shared 'gmp' when enabling shared libraries

* mpfr: add support for additional platforms

* gmp: workaround for MSYS to handle spaces in shell path

* mpfr: workaround for MSYS to handle spaces in shell path

* mpfr: fix for Android NDK r27 to avoid empty `ARFLAGS` overriding defaults
Doekin 4 mesiacov pred
rodič
commit
837f4833a4
2 zmenil súbory, kde vykonal 17 pridanie a 3 odobranie
  1. 3 0
      packages/g/gmp/xmake.lua
  2. 14 3
      packages/m/mpfr/xmake.lua

+ 3 - 0
packages/g/gmp/xmake.lua

@@ -27,6 +27,9 @@ package("gmp")
     add_deps("m4")
 
     on_install("@!windows and !wasm", function (package)
+        if is_host("windows") then
+            io.replace("configure", "LIBTOOL='$(SHELL) $(top_builddir)/libtool'", "LIBTOOL='\"$(SHELL)\" $(top_builddir)/libtool'", {plain = true})
+        end
         local configs = {}
         table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
         table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))

+ 14 - 3
packages/m/mpfr/xmake.lua

@@ -16,8 +16,14 @@ package("mpfr")
         add_extsources("brew::mpfr")
     end
 
-    add_deps("gmp")
-    on_install("macosx", "linux", function (package)
+    on_load(function (package)
+        package:add("deps", "gmp", { configs = {shared = package:config("shared")} })
+    end)
+
+    on_install("@!windows and !wasm", function (package)
+        if is_host("windows") then
+            io.replace("configure", "LIBTOOL='$(SHELL) $(top_builddir)/libtool'", "LIBTOOL='\"$(SHELL)\" $(top_builddir)/libtool'", {plain = true})
+        end
         local configs = {"--disable-dependency-tracking"}
         table.insert(configs, "--with-gmp=" .. package:dep("gmp"):installdir())
         if package:config("shared") then
@@ -30,7 +36,12 @@ package("mpfr")
         if package:config("pic") ~= false then
             table.insert(configs, "--with-pic")
         end
-        import("package.tools.autoconf").install(package, configs)
+        import("package.tools.autoconf")
+        local envs = autoconf.buildenvs(package)
+        if envs.ARFLAGS and envs.ARFLAGS:match("^%s*$") then
+            envs.ARFLAGS = nil
+        end
+        autoconf.install(package, configs, {envs = envs})
     end)
 
     on_test(function (package)