From 45969bdf3890c1ee4d1614efd1eb9e9d9adc9093 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 18 May 2021 23:45:56 +0800 Subject: improve tools/autoconf --- xmake/modules/package/tools/autoconf.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xmake/modules/package/tools/autoconf.lua') diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index 768ee20db..4536580ae 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -139,6 +139,7 @@ function buildenvs(package, opt) local asflags = table.copy(table.wrap(package:build_getenv("asflags"))) local ldflags = table.copy(table.wrap(package:build_getenv("ldflags"))) local shflags = table.copy(table.wrap(package:build_getenv("shflags"))) + local arflags = table.copy(table.wrap(package:build_getenv("arflags"))) local defines = package:build_getenv("defines") local includedirs = package:build_getenv("includedirs") local sysincludedirs = package:build_getenv("sysincludedirs") @@ -177,7 +178,7 @@ function buildenvs(package, opt) envs.CFLAGS = table.concat(cflags, ' ') envs.CXXFLAGS = table.concat(cxxflags, ' ') envs.ASFLAGS = table.concat(asflags, ' ') - envs.ARFLAGS = table.concat(table.wrap(package:build_getenv("arflags")), ' ') + envs.ARFLAGS = table.concat(arflags, ' ') envs.LDFLAGS = table.concat(ldflags, ' ') envs.SHFLAGS = table.concat(shflags, ' ') if package:is_plat("mingw") then @@ -204,6 +205,9 @@ function buildenvs(package, opt) elseif package:is_plat("cross") then -- only for cross-toolchain envs.CXX = package:build_getenv("cxx") + if not envs.ARFLAGS or envs.ARFLAGS == "" then + envs.ARFLAGS = "-cr" + end end end local ACLOCAL_PATH = {} -- cgit v1.3.1