From 56021b09ccfadde89756298c7d9afd688c896d21 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 14 Sep 2019 00:34:10 +0800 Subject: fix autoconf for mingw --- xmake/modules/package/tools/autoconf.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index 349b2c5b5..f32c64805 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -93,6 +93,19 @@ function buildenvs(package) envs.ARFLAGS = table.concat(table.wrap(package:build_getenv("arflags")), ' ') envs.LDFLAGS = table.concat(table.wrap(package:build_getenv("ldflags")), ' ') envs.SHFLAGS = table.concat(table.wrap(package:build_getenv("shflags")), ' ') + if package:is_plat("mingw") then + -- fix linker error, @see https://github.com/xmake-io/xmake/issues/574 + -- libtool: line 1855: lib: command not found + envs.ARFLAGS = nil + local ld = envs.LD + if ld then + if ld:endswith("x86_64-w64-mingw32-g++") then + envs.LD = path.join(path.directory(ld), "x86_64-w64-mingw32-ld") + elseif ld:endswith("i686-w64-mingw32-g++") then + envs.LD = path.join(path.directory(ld), "i686-w64-mingw32-ld") + end + end + end end local ACLOCAL_PATH = {} local PKG_CONFIG_PATH = {} -- cgit v1.3.1