Tools used when generating headers_install.sh are run from within a sandbox. The location of unifdef changes from headers_install.sh generation time to usage time. Instead, allow calling headers_install.py to specify the location of unifdef with LOC_UNIFDEF environment variable. If this environment variable is unset, unifdef is assumed to live in same directory as generated headers_install.sh script. This assumption allows smooth transition for users of headers_install.sh since main build is not broken by this change. Change-Id: Id23865dd3e25aa179e0bc6d3d6c549e0b93a6717 Signed-off-by: Elliot Berman <eberman@codeaurora.org>
22 lines
474 B
Plaintext
22 lines
474 B
Plaintext
cc_binary_host {
|
|
name: "unifdef",
|
|
srcs: ["scripts/unifdef.c"],
|
|
sanitize: {
|
|
never: true,
|
|
},
|
|
}
|
|
|
|
genrule {
|
|
name: "gen-headers_install.sh",
|
|
srcs: ["scripts/headers_install.sh"],
|
|
tools: ["unifdef"],
|
|
out: ["headers_install.sh"],
|
|
cmd: "sed 's+scripts/unifdef+$${LOC_UNIFDEF:-$$(dirname $$0)/unifdef}+g' $(in) > $(out)",
|
|
}
|
|
|
|
sh_binary_host {
|
|
name: "headers_install.sh",
|
|
src: ":gen-headers_install.sh",
|
|
required: ["unifdef"],
|
|
}
|