The existing behavior of using the build directory as the working
directory is useful if you want to move/copy the output directory around
and SRCDIR still refers the the source. But, it's more useful to have
the source directory be the working directory. Tools like cpp(__FILE__)
and other debug prints embed relative paths from the working directory.
We also have tools that expect the working directory to be $TOP.
Change-Id: Ia0f1d3c6b7df72d61cf5628efa2baa98bd19775b
The usecase here is system/core/liblog, which wants to turn off
sanitizer only for the target module, since the target sanitizers depend
on liblog.
Change-Id: I99141574a1c4c4847aa8a72bdcc88901fd9b01cd
Store product variables in pointers so that we can only apply the
properties if the product variable was set to a value. Also only apply
bool properties if they are true, adn rearrange the code to do the
cheapest checks first.
Remove device_uses_logd, it doesn't exist any more.
Change-Id: Icf42408f57bd611746f8d985bfceb50c7f95ea59
Any reads after the deps are saved won't show up as dependencies later.
So panic if new environment variables are read after saving deps.
Change-Id: Ia51deaf750804d3b99e69c001939a104c2d8c9f2
Instead of using this hardcoded list, use the blueprint plugin
infrastructure to find them at build time and load them.
Bug: 23567252
Change-Id: Iae87e8c9bf020f4beb42c418b9a6bf8b0fe8b601
Refactor the soong.config loading code to support reading in
product variables from soong.variables.
Change-Id: I389e6bb5c501b53167267d5f5d0d25557811cf72
Allow modules to vary their properties based on product variables.
For now, DEVICE_USES_LOGD, DEVICE_USES_JEMALLOC, and DEVICE_USES_DLMALLOC,
and BOARD_MALLOC_ALIGNMENT are supported.
Product variables can provide a value (only bool and int supported for
now), and if any of the product variable properties contains a "%d"
then Sprintf will be called with the property value as the format
and the product variable value convert to an int as the only argument.
For example:
product_variables: {
dlmalloc_alignment: {
cflags: ["-DMALLOC_ALIGNMENT=%d"],
},
},
will cause -DMALLOC_ALIGNMENT=16 to be added to any top level
properties called "cflags".
Change-Id: I74882a6ab4914d3e222f8d06cfac371b7b829ae5
ARCH_X86_HAVE_SSE* should not have second_arch set, they always
apply to x86 regardless of TARGET_ARCH vs. TARGET_2ND_ARCH.
Change-Id: I21fa4c88e9c966a7181f3b17c95c06080b678556
The source path was being appended to the module out directory
to create the file list file, which was resulting in .. in the
source path moving the file list file up the directory tree.
Use SrcDirRelPath to convert the globbed resource directories
to be relatiave to $srcDir before appending them.
Also do the same fix to generated aidl, logtags, yacc, and lex
files.
Change-Id: I2e636bd30abf03bc1d80a897951a9812cc3e09ef
If resources and java files were compiled from the same directory,
ctx.Glob could try to create a glob file that had the same name
as the directory containing another glob file. Namespace each
call to ctx.Glob so they never conflict.
Change-Id: I4db73af568a2ff2e708e9db64798073b1ed2ff61
-mthumb-interwork was missing from the beginning.
The Clang cflags copy was only a shallow copy, so our clang-specific
fixups were affecting the GCC cflags as well.
The cortex-a15 replacement was removed from build/core with this change:
https://android-review.googlesource.com/#/c/143851
Change-Id: Ib6300e064f6ec4f6a7174d5e2aeacad1c359f7ea
Instead of putting all the blueprint registrations in soong_build,
put them all in init() functions. This puts the registration next
to the implementation.
Change-Id: Ide1a749518f5e9d1367a18ab3bb1d91da3310c76
Add nested properties that can vary based on the specific cpu type,
for example cortex-a9 or cortex-a15.
Change-Id: I107d6e30527c11d0bdd9bf17fb29513ffb07f9cc
Refactor calls to standardProperties and rewriteProperties into
translateSingleProperty that can be used for normal, suffix, and
target properties.
Change-Id: I04e060588d4feeba1da7802d68622fe9b20e2c8b
If the cflags are identical, and there aren't extra sources in the
static version of a cc_library, then we can re-use the static library in
the build of the shared library.
Change-Id: I54c59aa3edcc47bc777132461b8e6a84cef0587e
During mutation, make deep copies of the blueprint modules, then start
modifying the property lists to apply the static/shared properties.
Change-Id: Idc7063f4d1cf7d173ae10418e3437f3e2b914f59
To align with the current make build system, add exclude_srcs and
exclude_java_resource_dirs. These replace the functionality of
arch_subtract and glob exclusions that use "-file" to exclude a file.
Change-Id: I91c23d5e3c9409f2d9f7921f950153a03a68ad61
include_dirs and local_include_dirs properties both translate to
LOCAL_C_INCLUDES. Use += for both assignments so they don't
clobber eachother.
Change-Id: Ie9e5e28ecd5a7ca76ab2a981e7d50d2c9b93ad92
Translation is getting complicated because the expressions supported
by Blueprint are difficult to support in Make. Modify androidbp
to use context aware parsing so it can evaluate all expressions at
parse time, so it only needs to deal with constant values.
Change-Id: I57047645fb48475baecd0361f78a93ec0a26011e
bootstrap_go_binary and bootstrap_go_package modules are part
of Blueprint and don't need to be translated.
toolchain_library modules are used by Soong to wrap gcc-provided
libraries are don't need to be translated.
Change-Id: I1602849060b6c85a43fc1ffb8e98c752d9d1512b
Parse the comment block above each module or assignment looking
for directives in the form:
Android.mk:<directive>
If a block delimited by start and end directives is found, use it
as the Android.mk translation instead of trying to automatically
translate. If an ignore directive is found, ignore the module
completely.
Change-Id: I34fe392899ed27ce3f640a2a71fbbaaedea67169
Instead of putting errors into the translated Android.mk file where
they are unlikely to be seen and may cause strange build behavior,
make all errors fatal. Also buffer to a byte buffer and then write
to the output file once we are sure there are no errors.
Change-Id: I247f405dd0a7c1d14c2681f86c7ac626e035ac2c
A bad recommendation from me lead to structuring the androidbp code
in a way that can't handle comments interspersed with module
definitions. Since the translated Android.mk files don't really
need to be human readable, just strip all the comments.
Change-Id: I23e3f1860730bcb43b5e00a305267aa426ed80aa