mirror of https://git.wownero.com/dsc/mxe.git
Merge pull request #874 from LuaAndC/build-pkg-nm-and-predownload
build-pkg: pre-download all packages and check *.a with nm
This commit is contained in:
commit
b8e6addbcf
|
@ -135,6 +135,15 @@ local function shell(cmd)
|
||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function execute(cmd)
|
||||||
|
if _VERSION == 'Lua 5.1' then
|
||||||
|
return os.execute(cmd) == 0
|
||||||
|
else
|
||||||
|
-- Lua >= 5.2
|
||||||
|
return os.execute(cmd)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function fileExists(name)
|
local function fileExists(name)
|
||||||
local f = io.open(name, "r")
|
local f = io.open(name, "r")
|
||||||
if f ~= nil then
|
if f ~= nil then
|
||||||
|
@ -279,6 +288,11 @@ local function gitCommit(message)
|
||||||
os.execute(cmd:format(message))
|
os.execute(cmd:format(message))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function isValidBinary(file)
|
||||||
|
local cmd = './usr/bin/%s-objdump -t %s > /dev/null 2>&1'
|
||||||
|
return execute(cmd:format(target, file))
|
||||||
|
end
|
||||||
|
|
||||||
local function checkFile(file, pkg)
|
local function checkFile(file, pkg)
|
||||||
-- if it is PE32 file, it must have '.exe' in name
|
-- if it is PE32 file, it must have '.exe' in name
|
||||||
local ext = file:sub(-4):lower()
|
local ext = file:sub(-4):lower()
|
||||||
|
@ -311,6 +325,14 @@ local function checkFile(file, pkg)
|
||||||
if file:match('/lib/.*%.dll$') then
|
if file:match('/lib/.*%.dll$') then
|
||||||
log('File %s (%s): DLL in /lib/', file, pkg)
|
log('File %s (%s): DLL in /lib/', file, pkg)
|
||||||
end
|
end
|
||||||
|
if file:match('%.dll$') or file:match('%.a$') then
|
||||||
|
if file:find(target, 1, true) then -- not common
|
||||||
|
if not isValidBinary(file) then
|
||||||
|
log('File %s (%s): not recognized library',
|
||||||
|
file, pkg)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- builds package, returns list of new files
|
-- builds package, returns list of new files
|
||||||
|
@ -601,6 +623,8 @@ end
|
||||||
|
|
||||||
assert(trim(shell('pwd')) == MXE_DIR,
|
assert(trim(shell('pwd')) == MXE_DIR,
|
||||||
"Clone MXE to " .. MXE_DIR)
|
"Clone MXE to " .. MXE_DIR)
|
||||||
|
while not execute('make download -j 6 -k') do
|
||||||
|
end
|
||||||
gitInit()
|
gitInit()
|
||||||
local file2pkg = {}
|
local file2pkg = {}
|
||||||
for _, t in ipairs(TARGETS) do
|
for _, t in ipairs(TARGETS) do
|
||||||
|
|
Loading…
Reference in New Issue