summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2020-09-21 11:16:53 +0800
committerGitHub <[email protected]>2020-09-21 11:16:53 +0800
commit210974e9f6482597253e314f976c8c207d899d76 (patch)
tree53fc2e3a49b91c006adff34a7e6e4379bdf5f633 /xmake
parent151998405503c71004ef7e6642c6d2dbd94fd39b (diff)
parentefaa9772486494e755f962accb9e4d828812b0c2 (diff)
Merge pull request #959 from xmake-io/luajit-v2.1
update to luajit v2.1/master and support armv7/mips64
Diffstat (limited to 'xmake')
-rw-r--r--xmake/actions/config/configfiles.lua4
-rw-r--r--xmake/modules/lib/detect/pkg_config.lua41
2 files changed, 21 insertions, 24 deletions
diff --git a/xmake/actions/config/configfiles.lua b/xmake/actions/config/configfiles.lua
index 30e40d1f5..42b7a87ea 100644
--- a/xmake/actions/config/configfiles.lua
+++ b/xmake/actions/config/configfiles.lua
@@ -99,9 +99,11 @@ function _get_builtinvars_global()
, debug = is_mode("debug") and 1 or 0
, os = platform.os()
}
+ local builtinvars_upper = {}
for name, value in pairs(builtinvars) do
- builtinvars[name:upper()] = type(value) == "string" and value:upper() or value
+ builtinvars_upper[name:upper()] = type(value) == "string" and value:upper() or value
end
+ table.join2(builtinvars, builtinvars_upper)
_g.builtinvars_global = builtinvars
end
return builtinvars
diff --git a/xmake/modules/lib/detect/pkg_config.lua b/xmake/modules/lib/detect/pkg_config.lua
index 4935f0c1e..059c25570 100644
--- a/xmake/modules/lib/detect/pkg_config.lua
+++ b/xmake/modules/lib/detect/pkg_config.lua
@@ -147,30 +147,27 @@ function libinfo(name, opt)
-- init result
result = {}
- for _, flag in ipairs(flags:split('%s')) do
-
- -- get links
- local link = flag:match("%-l(.*)")
- if link and not link:find(path.sep(), 1, true) then
+ for _, flag in ipairs(os.argv(flags)) do
+ if flag:startswith("-L") and #flag > 2 then
+ -- get linkdirs
+ local linkdir = flag:sub(3)
+ if linkdir and os.isdir(linkdir) then
+ result.linkdirs = result.linkdirs or {}
+ table.insert(result.linkdirs, linkdir)
+ end
+ elseif flag:startswith("-I") and #flag > 2 then
+ -- get includedirs
+ local includedir = flag:sub(3)
+ if includedir and os.isdir(includedir) then
+ result.includedirs = result.includedirs or {}
+ table.insert(result.includedirs, includedir)
+ end
+ elseif flag:startswith("-l") and #flag > 2 then
+ -- get links
+ local link = flag:sub(3)
result.links = result.links or {}
table.insert(result.links, link)
end
-
- -- get linkdirs
- local linkdirs = nil
- local linkdir = flag:match("%-L(.*)")
- if linkdir and os.isdir(linkdir) then
- result.linkdirs = result.linkdirs or {}
- table.insert(result.linkdirs, linkdir)
- end
-
- -- get includedirs
- local includedirs = nil
- local includedir = flag:match("%-I(.*)")
- if includedir and os.isdir(includedir) then
- result.includedirs = result.includedirs or {}
- table.insert(result.includedirs, includedir)
- end
end
end
@@ -185,8 +182,6 @@ function libinfo(name, opt)
if configdirs_old then
os.setenv("PKG_CONFIG_PATH", configdirs_old)
end
-
- -- ok?
return result
end