display: get unifdef explicitly
Change-Id: Iab81cd0ed9791e7426719fbc1b43d9ccafc89bb7 Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
a49d0d9ce1
commit
0d40f1505f
@@ -13,7 +13,10 @@ display_headers_out = [
|
|||||||
display_kernel_headers_verbose = "--verbose "
|
display_kernel_headers_verbose = "--verbose "
|
||||||
genrule {
|
genrule {
|
||||||
name: "qti_generate_display_kernel_headers",
|
name: "qti_generate_display_kernel_headers",
|
||||||
tools: ["headers_install.sh"],
|
tools: [
|
||||||
|
"headers_install.sh",
|
||||||
|
"unifdef"
|
||||||
|
],
|
||||||
tool_files: [
|
tool_files: [
|
||||||
"display_kernel_headers.py",
|
"display_kernel_headers.py",
|
||||||
],
|
],
|
||||||
@@ -23,6 +26,7 @@ genrule {
|
|||||||
"--header_arch arm64 " +
|
"--header_arch arm64 " +
|
||||||
"--gen_dir $(genDir) " +
|
"--gen_dir $(genDir) " +
|
||||||
"--display_include_uapi $(locations include/uapi/*/**/*.h) " +
|
"--display_include_uapi $(locations include/uapi/*/**/*.h) " +
|
||||||
|
"--unifdef $(location unifdef) " +
|
||||||
"--headers_install $(location headers_install.sh)",
|
"--headers_install $(location headers_install.sh)",
|
||||||
out: display_headers_out,
|
out: display_headers_out,
|
||||||
}
|
}
|
||||||
|
@@ -19,31 +19,33 @@ import re
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def run_headers_install(verbose, gen_dir, headers_install, prefix, h):
|
def run_headers_install(verbose, gen_dir, headers_install, unifdef, prefix, h):
|
||||||
if not h.startswith(prefix):
|
if not h.startswith(prefix):
|
||||||
print('error: expected prefix [%s] on header [%s]' % (prefix, h))
|
print('error: expected prefix [%s] on header [%s]' % (prefix, h))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
out_h = os.path.join(gen_dir, h[len(prefix):])
|
out_h = os.path.join(gen_dir, h[len(prefix):])
|
||||||
(out_h_dirname, out_h_basename) = os.path.split(out_h)
|
(out_h_dirname, out_h_basename) = os.path.split(out_h)
|
||||||
cmd = ["bash", headers_install, h, out_h]
|
env = os.environ.copy()
|
||||||
|
env["LOC_UNIFDEF"] = unifdef
|
||||||
|
cmd = ["sh", headers_install, h, out_h]
|
||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print('run_headers_install: cmd is %s' % cmd)
|
print('run_headers_install: cmd is %s' % cmd)
|
||||||
|
|
||||||
result = subprocess.call(cmd)
|
result = subprocess.call(cmd, env=env)
|
||||||
|
|
||||||
if result != 0:
|
if result != 0:
|
||||||
print('error: run_headers_install: cmd %s failed %d' % (cmd, result))
|
print('error: run_headers_install: cmd %s failed %d' % (cmd, result))
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def gen_display_headers(verbose, gen_dir, headers_install, display_include_uapi):
|
def gen_display_headers(verbose, gen_dir, headers_install, unifdef, display_include_uapi):
|
||||||
error_count = 0
|
error_count = 0
|
||||||
for h in display_include_uapi:
|
for h in display_include_uapi:
|
||||||
display_uapi_include_prefix = os.path.join(h.split('/include/uapi')[0], 'include', 'uapi') + os.sep
|
display_uapi_include_prefix = os.path.join(h.split('/include/uapi')[0], 'include', 'uapi') + os.sep
|
||||||
if not run_headers_install(
|
if not run_headers_install(
|
||||||
verbose, gen_dir, headers_install,
|
verbose, gen_dir, headers_install, unifdef,
|
||||||
display_uapi_include_prefix, h): error_count += 1
|
display_uapi_include_prefix, h): error_count += 1
|
||||||
return error_count
|
return error_count
|
||||||
|
|
||||||
@@ -69,6 +71,10 @@ def main():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--headers_install', required=True,
|
'--headers_install', required=True,
|
||||||
help='The headers_install tool to process input headers.')
|
help='The headers_install tool to process input headers.')
|
||||||
|
parser.add_argument(
|
||||||
|
'--unifdef',
|
||||||
|
required=True,
|
||||||
|
help='The unifdef tool used by headers_install.')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -77,9 +83,10 @@ def main():
|
|||||||
print('gen_dir [%s]' % args.gen_dir)
|
print('gen_dir [%s]' % args.gen_dir)
|
||||||
print('display_include_uapi [%s]' % args.display_include_uapi)
|
print('display_include_uapi [%s]' % args.display_include_uapi)
|
||||||
print('headers_install [%s]' % args.headers_install)
|
print('headers_install [%s]' % args.headers_install)
|
||||||
|
print('unifdef [%s]' % args.unifdef)
|
||||||
|
|
||||||
return gen_display_headers(args.verbose, args.gen_dir,
|
return gen_display_headers(args.verbose, args.gen_dir,
|
||||||
args.headers_install, args.display_include_uapi)
|
args.headers_install, args.unifdef, args.display_include_uapi)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
Reference in New Issue
Block a user