+function checklib(fullpathexe, wantedlib)
+ local fs = require "nixio.fs"
+ local haveldd = fs.access('/usr/bin/ldd')
+ local haveexe = fs.access(fullpathexe)
+ if not haveldd or not haveexe then
+ return false
+ end
+ local libs = exec(string.format("/usr/bin/ldd %s", shellquote(fullpathexe)))
+ if not libs then
+ return false
+ end
+ for k, v in ipairs(split(libs)) do
+ if v:find(wantedlib) then
+ return true
+ end
+ end
+ return false
+end