Skip to content

Commit

Permalink
kernel_headers: kernel headers library package
Browse files Browse the repository at this point in the history
This change is foundational for converting many modules that
depend on kernel headers built via the platform build system.

Bug: 143567008
Change-Id: I5808a8464ed30287b75baac9a74285bff5825fe2
[[email protected]: add logic to iterate over mandatory headers
 and only generate these headers if not already present in
 usr/include/asm.]
Signed-off-by: Rishabh Bhatnagar <[email protected]>
Signed-off-by: Prateek Sood <[email protected]>
  • Loading branch information
KAGA-KOKO committed Jan 22, 2020
1 parent 11ae02d commit fc100c8
Show file tree
Hide file tree
Showing 4 changed files with 2,968 additions and 15 deletions.
48 changes: 33 additions & 15 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,43 @@ cc_binary_host {
srcs: ["scripts/unifdef.c"],
sanitize: {
never: true,
}
},
}

gensrcs {
name: "qseecom-kernel-includes",

// move to out/ as root for header generation because of scripts/unifdef
// storage - at the expense of extra ../ references
cmd: "pushd out && mkdir -p scripts && rm -f scripts/unifdef && ln -s ../../$(location unifdef) scripts/unifdef && ../$(location scripts/headers_install.sh) `dirname ../$(out)` ../ $(in) && popd",

genrule {
name: "gen-headers_install.sh",
srcs: ["scripts/headers_install.sh"],
tools: ["unifdef"],
tool_files: ["scripts/headers_install.sh"],
export_include_dirs: ["include/uapi"],
srcs: ["include/uapi/linux/qseecom.h"],
output_extension: "h",
out: ["headers_install.sh"],
cmd: "sed 's+scripts/unifdef+$(location unifdef)+g' $(in) > $(out)",
}

cc_prebuilt_binary {
name: "headers_install.sh",
device_supported: false,
host_supported: true,
srcs: [":gen-headers_install.sh"],
}

// Use the following for verbose output from kernel_headers.py.
// kernel_headers_verbose = "--verbose "
// Use the following for minimal output from kernel_headers.py.
kernel_headers_verbose = ""

build = ["gen_headers_arm.bp", "gen_headers_arm64.bp"]

cc_library_headers {
name: "qseecom-kernel-headers",
generated_headers: ["qseecom-kernel-includes"],
export_generated_headers: ["qseecom-kernel-includes"],
name: "qti_kernel_headers",
arch: {
arm: {
generated_headers: ["qti_generate_kernel_headers_arm"],
export_generated_headers: ["qti_generate_kernel_headers_arm"],
},
arm64: {
generated_headers: ["qti_generate_kernel_headers_arm64"],
export_generated_headers: ["qti_generate_kernel_headers_arm64"],
},
},
vendor: true,
recovery_available: true,
}
Loading

0 comments on commit fc100c8

Please sign in to comment.