summaryrefslogtreecommitdiffstats
path: root/tools/build-pkg.lua
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2015-09-18 20:07:31 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2015-09-20 23:57:45 (GMT)
commitb5311afb506543565ed9db7f316382199599011a (patch)
treeabb4e373b6323e436696f993e9ebd4530e4912c6 /tools/build-pkg.lua
parenta4d62eb91b4045849031a379d7399a89df9fb853 (diff)
downloadmxe-b5311afb506543565ed9db7f316382199599011a.zip
mxe-b5311afb506543565ed9db7f316382199599011a.tar.gz
mxe-b5311afb506543565ed9db7f316382199599011a.tar.bz2
build-pkg: check *.a files with nm
close #858 see #854
Diffstat (limited to 'tools/build-pkg.lua')
-rwxr-xr-xtools/build-pkg.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua
index fdfa577..0039846 100755
--- a/tools/build-pkg.lua
+++ b/tools/build-pkg.lua
@@ -288,6 +288,11 @@ local function gitCommit(message)
os.execute(cmd:format(message))
end
+local function isValidBinary(file)
+ local cmd = './usr/bin/%s-objdump -t %s > /dev/null 2>&1'
+ return testCommand(cmd:format(target, file))
+end
+
local function checkFile(file, pkg)
-- if it is PE32 file, it must have '.exe' in name
local ext = file:sub(-4):lower()
@@ -320,6 +325,14 @@ local function checkFile(file, pkg)
if file:match('/lib/.*%.dll$') then
log('File %s (%s): DLL in /lib/', file, pkg)
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
-- builds package, returns list of new files