diff options
| -rw-r--r-- | xmake/modules/package/tools/autoconf.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index b9339fcb7..9559a2ad7 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -449,7 +449,14 @@ function buildenvs(package, opt) 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 + if os.isfile(path.join(dir, name)) then + envs.LD = path.join(dir, name) + else + local ld = find_tool("ld") + if ld and path.filename(ld.program) == name then + envs.LD = ld.program + end + end end -- we need use clang++ as cxx, autoconf will use it as linker -- https://github.com/xmake-io/xmake/issues/2170 |
