@@ -77,17 +77,6 @@ function _get_msvc_runenvs(package)
77
77
return os .joinenvs (_get_msvc (package ):runenvs ())
78
78
end
79
79
80
- -- is cross compilation?
81
- function _is_cross_compilation (package )
82
- if not package :is_plat (os .subhost ()) then
83
- return true
84
- end
85
- if package :is_plat (" macosx" ) and not package :is_arch (os .subarch ()) then
86
- return true
87
- end
88
- return false
89
- end
90
-
91
80
-- get memcache
92
81
function _memcache ()
93
82
return memcache .cache (" package.tools.autoconf" )
@@ -115,7 +104,7 @@ function _get_configs(package, configs)
115
104
table.insert (configs , " --prefix=" .. _translate_paths (package :installdir ()))
116
105
117
106
-- add host for cross-complation
118
- if not configs .host and _is_cross_compilation ( package ) then
107
+ if not configs .host and package : is_cross ( ) then
119
108
if package :is_plat (" iphoneos" , " macosx" ) then
120
109
local triples =
121
110
{
@@ -150,6 +139,21 @@ function _get_configs(package, configs)
150
139
x86_64 = " x86_64-w64-mingw32"
151
140
}
152
141
table.insert (configs , " --host=" .. (triples [package :arch ()] or triples .i386 ))
142
+ elseif package :is_plat (" linux" ) then
143
+ local triples =
144
+ {
145
+ [" arm64-v8a" ] = " aarch64-linux-gnu" ,
146
+ arm64 = " aarch64-linux-gnu" ,
147
+ i386 = " i686-linux-gnu" ,
148
+ x86_64 = " x86_64-linux-gnu" ,
149
+ armv7 = " arm-linux-gnueabihf" ,
150
+ mips = " mips-linux-gnu" ,
151
+ mips64 = " mips64-linux-gnu" ,
152
+ mipsel = " mipsel-linux-gnu" ,
153
+ mips64el = " mips64el-linux-gnu" ,
154
+ loong64 = " loongarch64-linux-gnu"
155
+ }
156
+ table.insert (configs , " --host=" .. (triples [package :arch ()] or triples .i386 ))
153
157
elseif package :is_plat (" cross" ) and package :targetos () then
154
158
local host = package :arch ()
155
159
if package :is_arch (" arm64" ) then
@@ -240,7 +244,7 @@ function buildenvs(package, opt)
240
244
local envs = {}
241
245
local cross = false
242
246
local cflags , cxxflags , cppflags , asflags , ldflags , shflags , arflags
243
- if not _is_cross_compilation ( package ) and not package :config (" toolchains" ) then
247
+ if not package : is_cross ( ) and not package :config (" toolchains" ) then
244
248
cppflags = {}
245
249
cflags = table .join (table .wrap (package :config (" cxflags" )), package :config (" cflags" ))
246
250
cxxflags = table .join (table .wrap (package :config (" cxflags" )), package :config (" cxxflags" ))
0 commit comments