Skip to content

Commit

Permalink
Merge pull request #5671 from xmake-io/autoconf
Browse files Browse the repository at this point in the history
improve host
  • Loading branch information
waruqi committed Sep 27, 2024
2 parents 9738030 + a5cd98b commit 8f6bce1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions xmake/modules/package/tools/autoconf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,11 @@ end

-- get configs
function _get_configs(package, configs)

-- add prefix
local configs = configs or {}
table.insert(configs, "--prefix=" .. _translate_paths(package:installdir()))

-- add host for cross-complation
if not configs.host and package:is_cross() then
if package:is_plat("iphoneos", "macosx") then
if not configs.host then
if package:is_plat("iphoneos", "macosx") and package:is_cross() then
local triples =
{
arm64 = "aarch64-apple-darwin",
Expand All @@ -132,14 +129,14 @@ function _get_configs(package, configs)
mips64 = "mips64-linux-android" -- removed in ndk r17
}
table.insert(configs, "--host=" .. (triples[package:arch()] or triples["armeabi-v7a"]))
elseif package:is_plat("mingw") then
elseif package:is_plat("mingw") then -- we always add host for mingw
local triples =
{
i386 = "i686-w64-mingw32",
x86_64 = "x86_64-w64-mingw32"
}
table.insert(configs, "--host=" .. (triples[package:arch()] or triples.i386))
elseif package:is_plat("linux") then
elseif package:is_plat("linux") and package:is_cross() then
local triples =
{
["arm64-v8a"] = "aarch64-linux-gnu",
Expand Down

0 comments on commit 8f6bce1

Please sign in to comment.