summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-03-23 00:20:35 +0800
committerruki <[email protected]>2022-03-23 00:20:35 +0800
commit5dde1b6d59fe11bbda684ed07d41834a0cb28039 (patch)
tree537a8d459f0b6e772ce386bca1430c0b4f1c5c91
parent8ee5d5856296e1439b478d19a7ecdfbcd17a46aa (diff)
improve autoconf
-rw-r--r--xmake/modules/package/tools/autoconf.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua
index cd5df4307..a960789ce 100644
--- a/xmake/modules/package/tools/autoconf.lua
+++ b/xmake/modules/package/tools/autoconf.lua
@@ -266,22 +266,29 @@ function buildenvs(package, opt)
end
end
- -- fix autoconf cannot use clang/clang++ as linker
+ -- we should use ld as linker
--
-- @see
-- https://github.com/xmake-io/xmake-repo/pull/1043
-- https://github.com/libexpat/libexpat/issues/312
+ -- https://github.com/xmake-io/xmake/issues/2195
local ld = envs.LD
- local cxx = envs.CXX
- if ld and package:has_tool("ld", "clangxx", "clang") then
+ if ld and package:has_tool("ld", "clang", "clangxx", "gcc", "gxx") then
local dir = path.directory(ld)
local name = path.filename(ld)
- name = name:gsub("clang%+%+", "ld")
- name = name:gsub("clang", "ld")
+ name = name:gsub("clang%+%+$", "ld")
+ name = name:gsub("clang%+%+%-%d+", "ld")
+ name = name:gsub("clang$", "ld")
+ name = name:gsub("clang%-%d+", "ld")
+ name = name:gsub("gcc$", "ld")
+ name = name:gsub("gcc-%d+", "ld")
+ name = name:gsub("g%+%+$", "ld")
+ name = name:gsub("g%+%+%-%d+", "ld")
envs.LD = dir and path.join(dir, name) or name
end
-- we need use clang++ as cxx, autoconf will use it as linker
-- https://github.com/xmake-io/xmake/issues/2170
+ local cxx = envs.CXX
if cxx and package:has_tool("cxx", "clang", "gcc") then
local dir = path.directory(cxx)
local name = path.filename(cxx)