support iphoneos for openssl (#5959)

* support iphoneos for openssl

* support iphoneos for openssl3
pull/5963/head
ruki 2 months ago committed by GitHub
parent c7ddddf458
commit 1c4a5226d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      packages/o/openssl/xmake.lua
  2. 25
      packages/o/openssl3/xmake.lua

@ -123,7 +123,7 @@ package("openssl")
import("package.tools.make").make(package, {"install_sw"})
end)
on_install("linux", "macosx", "bsd", "cross", "android", function (package)
on_install("linux", "macosx", "bsd", "cross", "android", "iphoneos", function (package)
-- https://wiki.openssl.org/index.php/Compilation_and_Installation#PREFIX_and_OPENSSLDIR
local configs = {}
if package:is_cross() then
@ -131,6 +131,20 @@ package("openssl")
if package:is_plat("macosx") then
target_plat = "darwin64"
target_arch = package:is_arch("arm64") and "arm64-cc" or "x86_64-cc"
elseif package:is_plat("iphoneos") then
local xcode = package:toolchain("xcode")
local simulator = xcode and xcode:config("appledev") == "simulator"
if simulator then
target_plat = "iossimulator"
target_arch = "xcrun"
else
if package:is_arch("arm64", "x86_64") then
target_plat = "ios64"
else
target_plat = "ios"
end
target_arch = "cross"
end
else
target_plat = "linux"
if package:is_arch("x86_64") then

@ -77,7 +77,7 @@ package("openssl3")
table.insert(configs, package:config("shared") and "shared" or "no-shared")
table.insert(configs, "--prefix=" .. package:installdir())
table.insert(configs, "--openssldir=" .. package:installdir())
if package:config("md2") then
table.insert(configs, "enable-md2")
end
@ -108,7 +108,7 @@ package("openssl3")
end
table.insert(configs, "--prefix=" .. installdir)
table.insert(configs, "--openssldir=" .. installdir)
if package:config("md2") then
table.insert(configs, "enable-md2")
end
@ -140,7 +140,7 @@ package("openssl3")
if package:debug() then
table.insert(configs, "--debug")
end
if package:config("md2") then
table.insert(configs, "enable-md2")
end
@ -154,8 +154,7 @@ package("openssl3")
end
end)
on_install("cross", "android", function (package)
on_install("cross", "android", "iphoneos", function (package)
local target_arch = "generic32"
if package:is_arch("x86_64") then
target_arch = "x86_64"
@ -173,6 +172,20 @@ package("openssl3")
if package:is_plat("macosx") then
target_plat = "darwin64"
target_arch = "x86_64-cc"
elseif package:is_plat("iphoneos") then
local xcode = package:toolchain("xcode")
local simulator = xcode and xcode:config("appledev") == "simulator"
if simulator then
target_plat = "iossimulator"
target_arch = "xcrun"
else
if package:is_arch("arm64", "x86_64") then
target_plat = "ios64"
else
target_plat = "ios"
end
target_arch = "cross"
end
end
local target = target_plat .. "-" .. target_arch
@ -182,7 +195,7 @@ package("openssl3")
"no-threads",
"--openssldir=" .. package:installdir():gsub("\\", "/"),
"--prefix=" .. package:installdir():gsub("\\", "/")}
if package:config("md2") then
table.insert(configs, "enable-md2")
end

Loading…
Cancel
Save