From 7a156e25b9663fbcb3fcd0e938d2d6c967e427fa Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 30 Mar 2022 22:47:07 +0800 Subject: improve autoconf --- xmake/modules/package/tools/autoconf.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index a960789ce..5ec69aaf8 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -261,7 +261,12 @@ function buildenvs(package, opt) elseif package:is_plat("cross") or package:has_tool("ar", "ar") then -- only for cross-toolchain envs.CXX = package:build_getenv("cxx") - if not envs.ARFLAGS or envs.ARFLAGS == "" then + local ar = envs.AR + if ar then + ar = path.filename(ar) + end + -- only for cross-xxx-ar, @see https://github.com/xmake-io/xmake-repo/pull/1119 + if ar and ar:find('-', 1, true) and (not envs.ARFLAGS or envs.ARFLAGS == "") then envs.ARFLAGS = "-cr" end end -- cgit v1.3.1 From 05565caefb431b6897a9fd9c538c97eeb4e50add Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 30 Mar 2022 23:06:38 +0800 Subject: revert ar --- xmake/modules/package/tools/autoconf.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index 5ec69aaf8..a960789ce 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -261,12 +261,7 @@ function buildenvs(package, opt) elseif package:is_plat("cross") or package:has_tool("ar", "ar") then -- only for cross-toolchain envs.CXX = package:build_getenv("cxx") - local ar = envs.AR - if ar then - ar = path.filename(ar) - end - -- only for cross-xxx-ar, @see https://github.com/xmake-io/xmake-repo/pull/1119 - if ar and ar:find('-', 1, true) and (not envs.ARFLAGS or envs.ARFLAGS == "") then + if not envs.ARFLAGS or envs.ARFLAGS == "" then envs.ARFLAGS = "-cr" end end -- cgit v1.3.1