summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/autoconf.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-15 22:34:08 +0800
committerruki <[email protected]>2020-12-15 22:34:08 +0800
commit69613eacabc6c50e0a4ca34b1907d74ec03861b9 (patch)
tree6a5e071269e27724b67eff6b8cb33cbf2366a2c3 /xmake/modules/package/tools/autoconf.lua
parent3b15b1fde067b3a1dc577566b5144e622e9d948a (diff)
improve tools/autoconf
Diffstat (limited to 'xmake/modules/package/tools/autoconf.lua')
-rw-r--r--xmake/modules/package/tools/autoconf.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua
index e55a0e08d..907b91539 100644
--- a/xmake/modules/package/tools/autoconf.lua
+++ b/xmake/modules/package/tools/autoconf.lua
@@ -116,6 +116,7 @@ function buildenvs(package, opt)
table.join2(cxxflags, opt.cxxflags)
table.join2(cxxflags, opt.cxflags)
table.join2(asflags, opt.asflags)
+ table.join2(ldflags, opt.ldflags)
envs.CFLAGS = table.concat(cflags, ' ')
envs.CXXFLAGS = table.concat(cxxflags, ' ')
envs.ASFLAGS = table.concat(asflags, ' ')
@@ -123,12 +124,16 @@ function buildenvs(package, opt)
else
local cflags = table.join(table.wrap(package:build_getenv("cxflags")), package:build_getenv("cflags"))
local cxxflags = table.join(table.wrap(package:build_getenv("cxflags")), package:build_getenv("cxxflags"))
- local asflags = table.wrap(package:build_getenv("asflags"))
+ local asflags = table.copy(table.wrap(package:build_getenv("asflags")))
+ local ldflags = table.copy(table.wrap(package:build_getenv("ldflags")))
+ local shflags = table.copy(table.wrap(package:build_getenv("shflags")))
table.join2(cflags, opt.cflags)
table.join2(cflags, opt.cxflags)
table.join2(cxxflags, opt.cxxflags)
table.join2(cxxflags, opt.cxflags)
table.join2(asflags, opt.asflags)
+ table.join2(ldflags, opt.ldflags)
+ table.join2(shflags, opt.shflags)
envs.CC = package:build_getenv("cc")
envs.AS = package:build_getenv("as")
envs.AR = package:build_getenv("ar")
@@ -140,8 +145,8 @@ function buildenvs(package, opt)
envs.CXXFLAGS = table.concat(cxxflags, ' ')
envs.ASFLAGS = table.concat(asflags, ' ')
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")), ' ')
+ envs.LDFLAGS = table.concat(ldflags, ' ')
+ envs.SHFLAGS = table.concat(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