Skip to content

Commit

Permalink
Example kernel headers header_lib 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: I998890ed427104ed835000e421756981e0f24ab5
[[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]>
  • Loading branch information
Justin DeMartino authored and Rishabh Bhatnagar committed Jan 18, 2020
1 parent fd8f045 commit cc39738
Show file tree
Hide file tree
Showing 4 changed files with 2,973 additions and 31 deletions.
49 changes: 18 additions & 31 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ cc_binary_host {
},
}

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

cc_prebuilt_binary {
Expand All @@ -21,38 +21,25 @@ cc_prebuilt_binary {
srcs: [":gen-headers_install.sh"],
}

gensrcs {
name: "qcom-kernel-includes",
cmd: "$(location headers_install.sh) `dirname $(out)` `dirname $(in)` `basename $(in)`",
tools: ["headers_install.sh"],
export_include_dirs: ["include/uapi"],
srcs: [
"include/uapi/**/*.h",
],
output_extension: "h",
}

gensrcs {
name: "qseecom-kernel-includes",
cmd: "$(location headers_install.sh) `dirname $(out)` `dirname $(in)` `basename $(in)`",
tools: ["headers_install.sh"],
export_include_dirs: ["include/uapi"],
srcs: [
"include/uapi/linux/qseecom.h",
],
output_extension: "h",
}
// 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 = ""

cc_library_headers {
name: "qseecom-kernel-headers",
generated_headers: ["qseecom-kernel-includes"],
export_generated_headers: ["qseecom-kernel-includes"],
}
build = ["gen_headers_arm.bp", "gen_headers_arm64.bp"]

cc_library_headers {
name: "qcom_kernel_headers",
generated_headers: ["qcom-kernel-includes"],
export_generated_headers: ["qcom-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 cc39738

Please sign in to comment.