openssl: Fix compilation for Android on Windows (#3643)

temp fix
see https://github.com/xmake-io/xmake/pull/4903
pull/3657/head
Jérôme Leclercq 10 months ago committed by GitHub
parent 73c7cfc3e2
commit d6c1d721d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 21
      packages/o/openssl/xmake.lua

@ -28,11 +28,16 @@ package("openssl")
on_fetch("fetch")
on_load(function (package)
if is_subhost("windows") and not package:is_precompiled() then
package:add("deps", "nasm")
-- the perl executable found in GitForWindows will fail to build OpenSSL
-- see https://github.com/openssl/openssl/blob/master/NOTES-PERL.md#perl-on-windows
package:add("deps", "strawberry-perl", { system = false })
if not package:is_precompiled() then
if package:is_plat("android") and is_subhost("windows") and os.arch() == "x64" then
-- when building for android on windows, use msys2 perl instead of strawberry-perl to avoid configure issue
package:add("deps", "msys2", {configs = {msystem = "MINGW64", base_devel = true}, private = true})
elseif is_subhost("windows") and not package:is_precompiled() then
package:add("deps", "nasm", { private = true })
-- the perl executable found in GitForWindows will fail to build OpenSSL
-- see https://github.com/openssl/openssl/blob/master/NOTES-PERL.md#perl-on-windows
package:add("deps", "strawberry-perl", { system = false, private = true })
end
end
-- @note we must use package:is_plat() instead of is_plat in description for supporting add_deps("openssl", {host = true}) in python
@ -138,6 +143,12 @@ package("openssl")
end
local buildenvs = import("package.tools.autoconf").buildenvs(package)
if package:is_cross() then
if is_host("windows") and package:is_plat("android") then
buildenvs.CFLAGS = buildenvs.CFLAGS:gsub("\\", "/")
buildenvs.CXXFLAGS = buildenvs.CXXFLAGS:gsub("\\", "/")
buildenvs.CPPFLAGS = buildenvs.CPPFLAGS:gsub("\\", "/")
buildenvs.ASFLAGS = buildenvs.ASFLAGS:gsub("\\", "/")
end
os.vrunv("perl", table.join("./Configure", configs), {envs = buildenvs})
else
os.vrunv("./config", configs, {shell = true, envs = buildenvs})

Loading…
Cancel
Save