-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing Linux platform triples in autoconf tool. #5548
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,17 +77,6 @@ function _get_msvc_runenvs(package) | |
return os.joinenvs(_get_msvc(package):runenvs()) | ||
end | ||
|
||
-- is cross compilation? | ||
function _is_cross_compilation(package) | ||
if not package:is_plat(os.subhost()) then | ||
return true | ||
end | ||
if package:is_plat("macosx") and not package:is_arch(os.subarch()) then | ||
return true | ||
end | ||
return false | ||
end | ||
|
||
-- get memcache | ||
function _memcache() | ||
return memcache.cache("package.tools.autoconf") | ||
|
@@ -115,7 +104,7 @@ function _get_configs(package, configs) | |
table.insert(configs, "--prefix=" .. _translate_paths(package:installdir())) | ||
|
||
-- add host for cross-complation | ||
if not configs.host and _is_cross_compilation(package) then | ||
if not configs.host and package:is_cross() then | ||
if package:is_plat("iphoneos", "macosx") then | ||
local triples = | ||
{ | ||
|
@@ -150,6 +139,20 @@ function _get_configs(package, configs) | |
x86_64 = "x86_64-w64-mingw32" | ||
} | ||
table.insert(configs, "--host=" .. (triples[package:arch()] or triples.i386)) | ||
elseif package:is_plat("linux") then | ||
local triples = | ||
{ | ||
["arm64-v8a"] = "aarch64-linux-gnu", | ||
i386 = "i686-linux-gnu", | ||
x86_64 = "x86_64-linux-gnu", | ||
armv7 = "arm-linux-gnueabihf", | ||
mips = "mips-linux-gnu", | ||
mips64 = "mips64-linux-gnu", | ||
mipsel = "mipsel-linux-gnu", | ||
mips64el = "mips64el-linux-gnu", | ||
loong64 = "loongarch64-linux-gnu" | ||
} | ||
table.insert(configs, "--host=" .. (triples[package:arch()] or triples.i386)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 现在 i386 很少用了,默认改成 x86_64 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 看上面写的都是 i386 所以就写 i386 了,要不都改过来? |
||
elseif package:is_plat("cross") and package:targetos() then | ||
local host = package:arch() | ||
if package:is_arch("arm64") then | ||
|
@@ -240,7 +243,7 @@ function buildenvs(package, opt) | |
local envs = {} | ||
local cross = false | ||
local cflags, cxxflags, cppflags, asflags, ldflags, shflags, arflags | ||
if not _is_cross_compilation(package) and not package:config("toolchains") then | ||
if not package:is_cross() and not package:config("toolchains") then | ||
cppflags = {} | ||
cflags = table.join(table.wrap(package:config("cxflags")), package:config("cflags")) | ||
cxxflags = table.join(table.wrap(package:config("cxflags")), package:config("cxxflags")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有 arm64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xmake/xmake/platforms/linux/xmake.lua
Line 24 in 47e72b2
linux 下面好像并没有叫 arm64 的处理器架构,只有 arm64-v8a。