summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/autoconf.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-03-18 00:16:34 +0800
committerruki <[email protected]>2022-03-18 00:16:34 +0800
commit6675ca4e481faf8c799069763259bb78d07aeddf (patch)
treead5d3ceb461535b7323ac87dc03714ddc8de2ed9 /xmake/modules/package/tools/autoconf.lua
parentf6f371ae572e8076fee71006622598b33b14f11e (diff)
improve autoconf
Diffstat (limited to 'xmake/modules/package/tools/autoconf.lua')
-rw-r--r--xmake/modules/package/tools/autoconf.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua
index 2cd0c33f9..52fa22415 100644
--- a/xmake/modules/package/tools/autoconf.lua
+++ b/xmake/modules/package/tools/autoconf.lua
@@ -272,6 +272,7 @@ function buildenvs(package, opt)
-- https://github.com/xmake-io/xmake-repo/pull/1043
-- https://github.com/libexpat/libexpat/issues/312
local ld = envs.LD
+ local cxx = envs.CXX
if ld and package:has_tool("ld", "clangxx", "clang") then
local dir = path.directory(ld)
local name = path.filename(ld)
@@ -279,6 +280,14 @@ function buildenvs(package, opt)
name = name:gsub("clang", "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
+ if cxx and package:has_tool("cxx", "clang") then
+ local dir = path.directory(cxx)
+ local name = path.filename(cxx)
+ name = name:gsub("clang$", "clang++")
+ envs.CXX = dir and path.join(dir, name) or name
+ end
end
local ACLOCAL_PATH = {}
local PKG_CONFIG_PATH = {}