improve libelf and linux-tools

pull/328/head
ruki 4 years ago
parent 42dcf4e490
commit 1feba52b41
No known key found for this signature in database
GPG Key ID: 809EF06AD42725BD
  1. 9
      packages/l/libelf/xmake.lua
  2. 10
      packages/l/linux-tools/modules/headers.lua
  3. 1
      packages/l/linux-tools/xmake.lua

@ -18,15 +18,18 @@ package("libelf")
if package:debug() then
table.insert(configs, "--enable-debug")
end
local cxflags
local cxflags = {}
if package:config("pic") ~= false then
cxflags = "-fPIC"
table.insert(cxflags, "-fPIC")
end
if package:is_plat("android") then
io.replace("./configure", "#define off_t long", "")
io.replace("lib/private.h", "HAVE_MEMMOVE", "1")
io.replace("lib/private.h", "HAVE_MEMCPY", "1")
cxflags = (cxflags or "") .. " -D__LIBELF64=1 -D__LIBELF64_LINUX=1 -D__libelf_u64_t=uint64_t -D__libelf_i64_t=int64_t"
table.insert(cxflags, "-D__LIBELF64=1")
table.insert(cxflags, "-D__LIBELF64_LINUX=1")
table.insert(cxflags, "-D__libelf_u64_t=uint64_t")
table.insert(cxflags, "-D__libelf_i64_t=int64_t")
package:add("defines", "__LIBELF64=1")
package:add("defines", "__LIBELF64_LINUX=1")
package:add("defines", "__libelf_u64_t=uint64_t")

@ -0,0 +1,10 @@
function load(package)
end
function install(package)
os.vrunv("make", {"headers_install", "INSTALL_HDR_PATH=" .. package:installdir()})
end
function test(package)
assert(package:has_cincludes("linux/version.h"))
end

@ -15,6 +15,7 @@ package("linux-tools")
add_configs("bpftool", { description = "Enable bpftool.", default = true, type = "boolean"})
add_configs("libbpf", { description = "Enable libbpf library.", default = false, type = "boolean"})
add_configs("headers", { description = "Enable linux headers.", default = false, type = "boolean"})
local modules = {"bpftool", "libbpf"}

Loading…
Cancel
Save