Commit graph

134 commits

Author SHA1 Message Date
Ying Wang
feb75860ff Allow module to specify LOCAL_INSTALLED_MODULE_STEM
With this change, you can install a shared library with module name foo
as bar.so to the system.img with:
LOCAL_INSTALLED_MODULE_STEM := bar.so
Note that we in general still disallow a static/shared library to
specify LOCAL_MODULE_STEM or LOCAL_BUILT_MODULE_STEM, because the build
system uses LOCAL_MODULE to compute build time dependencies, such as
export_includes, the -l linker flag etc.
Also, if you use LOCAL_INSTALLED_MODULE_STEM to change the installed
file name and if any other module links against this library, you may
run into runtime error: the library name baked in to the binary is not
the same as file name in the system image.

Change-Id: I55b571c8139c3bda07a4a0e50cea0f20d8d6c168
2013-09-24 16:09:54 -07:00
Andrew Hsieh
69e339d783 am 246daf75: resolved conflicts for merge of 2b5d2c55 to klp-dev-plus-aosp
* commit '246daf755a6607db575b5bef13d5cc761d4ebbb0':
  Add "WITH_STATIC_ANALYZER=1 m/mm/mmm/mma/mmma ..."
2013-09-10 19:34:10 -07:00
Andrew Hsieh
246daf755a resolved conflicts for merge of 2b5d2c55 to klp-dev-plus-aosp
Change-Id: Icd9d5eff3f9acba042c100f694309f902c9d56cf
2013-09-10 18:07:23 -07:00
Andrew Hsieh
906cb78168 Add "WITH_STATIC_ANALYZER=1 m/mm/mmm/mma/mmma ..."
The new option WITH_STATIC_ANALYZER=1 instructs build system to
run static analyzer via "clang --analyze" on a successful build.
If analyzer finds any issue, instruction to open report is displayed.
See http://clang-analyzer.llvm.org/scan-build.html for details.

WITH_STATIC_ANALYZER trumps WITH_SYNTAX_CHECK if both exist.

Project use lots of GCC extensions (eg. nested function) not supported
by clang may opt out by adding LOCAL_NO_STATIC_ANALYZER:=true

Change-Id: I9970560560bd52ce5f0fd7129c3488629627c735
2013-09-10 17:37:14 +08:00
Andrew Hsieh
129847526a resolved conflicts for merge of fcdf653a to klp-dev-plus-aosp
Change-Id: I1d831bbb4649b2ddc89cdfb71e3b76712bc6469e
2013-09-04 17:14:33 -07:00
Andrew Hsieh
5dcf1eeb06 Merge "Add "WITH_SYNTAX_CHECK=1 make ..."" 2013-09-04 23:45:57 +00:00
Andrew Hsieh
a62334edaf Merge "Add "WITH_SYNTAX_CHECK=1 make ..."" 2013-09-04 21:57:52 +00:00
Ying Wang
b107cc3c4e am 1be5fb67: am 25f39b2f: am 62cd88d0: Merge "FDO: Only support locally"
* commit '1be5fb675ac24e493b3712be6488848d6b4fae4b':
  FDO: Only support locally
2013-09-04 11:57:29 -07:00
Ying Wang
1be5fb675a am 25f39b2f: am 62cd88d0: Merge "FDO: Only support locally"
* commit '25f39b2fbe9dee8ec6c680569c22c71fce9e595c':
  FDO: Only support locally
2013-09-04 11:56:03 -07:00
Andrew Hsieh
6cea59a4b9 Add "WITH_SYNTAX_CHECK=1 make ..."
The new option WITH_SYNTAX_CHECK=1 instructs build system to invoke
"clang -fsyntax-only" to utilize clang's better diagnostics before calling
LOCAL_CC/LOCAL_CXX for code generation.  The compilation time is slightly
longer, and the generated object file should be the same as w/o WITH_SYNTAX_CHECK

Project use lots of GCC extensions (eg. nested function) not supported
by clang may opt out by adding LOCAL_NO_SYNTAX_CHECK:=true

Change-Id: I5689586788ef049bd967364f71f31f1e359bd121
2013-09-04 09:26:25 +08:00
Andrew Hsieh
e7c2d14e5a Add "WITH_SYNTAX_CHECK=1 make ..."
The new option WITH_SYNTAX_CHECK=1 instructs build system to invoke
"clang -fsyntax-only" to utilize clang's better diagnostics before calling
LOCAL_CC/LOCAL_CXX for code generation.  The compilation time is slightly
longer, and the generated object file should be the same as w/o WITH_SYNTAX_CHECK

Project use lots of GCC extensions (eg. nested function) not supported
by clang may opt out by adding LOCAL_NO_SYNTAX_CHECK:=true

Change-Id: Iaeedd07d5719f9df9675ab57e307e28a9c855c1b
2013-09-04 09:20:38 +08:00
synergydev
7c4674205c FDO: Only support locally
The issues:
  - The size increase from utilizing FDO is quite large while
    utilizing runtime profiles in build.
  - By default, FDO is utilized globally if the target arch variant
    profiles exist.
  - Not all modules can show statistical significance in
    performance comparison, yet still suffer the size increase.

The solution:
  - Only enable FDO locally with LOCAL_FDO_SUPPORT
    for modules which may benefit enough to justify the size
    tradeoff.

Solution notes:
  - I've noted statistical significance in libwebcore and libskia
    thus far from utilizing FDO.
  - Analysis included sunspider, drawcanvas benchmarks, as
    well as gooda analysis on both arm and x86
  - To support runtime profile generation in modules which have
    LOCAL_FDO_SUPPORT specified,
    BUILD_FDO_INSTRUMENTATION is still used. Otherwise,
    if the target arch variant profiles exist, FDO is utilized for
    specified modules.

Change-Id: I7e95266943ff47c7d82b02e6200fd09911d0bb57
2013-09-03 20:53:20 +00:00
Ying Wang
e260b24cde am 670a7a63: am c5b72527: am ec3c15e5: am 04c4d34d: am 7311a344: Make it easier to enable obfuscation and optimization.
* commit '670a7a6389948c325399ae9bb3dc6a678f9982f8':
  Make it easier to enable obfuscation and optimization.
2013-08-23 10:20:28 -07:00
Ying Wang
c5b72527d3 am ec3c15e5: am 04c4d34d: am 7311a344: Make it easier to enable obfuscation and optimization.
* commit 'ec3c15e5c7c11cf3a831898f286c7eb7c216e50f':
  Make it easier to enable obfuscation and optimization.
2013-08-23 10:12:26 -07:00
Ying Wang
ec3c15e5c7 am 04c4d34d: am 7311a344: Make it easier to enable obfuscation and optimization.
* commit '04c4d34d4fdb56c824abf39239d2c87806706b7e':
  Make it easier to enable obfuscation and optimization.
2013-08-23 10:09:27 -07:00
Ying Wang
7311a344be Make it easier to enable obfuscation and optimization.
With this change, use:
* LOCAL_PROGUARD_ENABLED := obfuscation  # to enable obfuscation
* LOCAL_PROGUARD_ENABLED := optimization # to enable optimization
* LOCAL_PROGUARD_ENABLED := obfuscation optimization # to enable both

Now the meaning of the LOCAL_PROGUARD_ENABLED options:
* full:
    Use the build system's default configurations:
    with shrink but no obfuscation or optimization,
    global proguard flags in build/core/proguard.flags
    are applied.
* custom:
    The same as "full" except no aapt-generated resource-related
    proguard flags.
* nosystem:
    Don't use any build system's default configurations; but
    aapt-generated proguard flags are still applied. You are
    responsible for any other flags.
* disabled:
    Disable proguard.
* obfuscation:
    The same as "full" but with obfuscation enabled.
* optimization:
    The same as "full" but with optimization enabled.
* no value (the default):
    The build system chooses the proper value: "full" if it's an
    app; "disabled" if it's a library.

You can use more than 1 of them in a meaningful combination,
for example:
LOCAL_PROGUARD_ENABLED := obfuscation optimization

Bug: 10307372
Change-Id: Id248caca3048e99547f16559fae74f4afe85c354
2013-08-22 17:12:38 -07:00
Ying Wang
a3b7593546 Support to optionally run rmtypedefs.
Bug: 10330586
Change-Id: I6ddfca2ec986cf2c82b0942b7a5360508f095e9a
2013-08-14 18:20:54 -07:00
Ying Wang
285045bd83 Support for LOCAL_HAL_STATIC_LIBRARIES
Now you can have a board config variable BOARD_HAL_STATIC_LIBRARIES,
which is a list of board-specific HAL static library names with pattern
"lib<library_name>.<board_specific_suffix>". LOCAL_HAL_STATIC_LIBRARIES
is a list of "lib<library_name>" and any matched
BOARD_HAL_STATIC_LIBRARIES will be added to the LOCAL_STATIC_LIBRARIES;
if no match is found, lib<library_name>.default will be used.

Bug: 10262105
Change-Id: Ic89d8d417d1dd65a227e4187a157fd3b77c4af34
2013-08-13 13:48:04 -07:00
Ying Wang
5efaa72ac1 am 51aab877: am 5d1db8b4: Merge "Allow proto builds to pass in java proto params."
* commit '51aab8775ab86990abef411d00f5686e41022eee':
  Allow proto builds to pass in java proto params.
2013-07-25 17:04:20 -07:00
Ulas Kirazci
6e485b545a Allow proto builds to pass in java proto params.
Change-Id: I65fe0cd96f818f59267da6159e6bd2ad28f07a11
2013-07-25 13:40:53 -07:00
Ulas Kirazci
24c7289d24 Revert "Allow proto builds to pass in java proto params."
This reverts commit 28b46fc16c.

Change-Id: Iaca9fa749c6f460911cc46e08e6b3ae2555b8bcc
2013-07-25 19:35:28 +00:00
Ben Murdoch
fc2bad5c36 Revert "Allow proto builds to pass in java proto params."
This reverts commit 28b46fc16c.

Speculative fix for master builds. I cannot repro the break the bots
are seeing locally, but it seems related to building protobufs and this
CL was in the first broken build.
2013-07-25 11:44:53 +01:00
Ulas Kirazci
dd3d8f4ca9 am 6a5fc54f: am a825aa13: Merge "Allow proto builds to pass in java proto params."
* commit '6a5fc54fe9904214a7df1d34c9d48ad0310d867e':
  Allow proto builds to pass in java proto params.
2013-07-25 00:47:09 -07:00
Ulas Kirazci
28b46fc16c Allow proto builds to pass in java proto params.
Also source files which have dependencies need to be bundled together
(at least the way the build system is set up now). Move
--proto_path=$(TOP) to the end so that it does not take precedence
over user-supplied --proto_path flags.

Change-Id: Ia532647fe8811d39230a23ba3671685b0388cbe0
2013-07-24 18:02:57 -07:00
Jeff Brown
ae859f9b64 Split framework jar.
Change-Id: I38c68ac169a4ea10e4640b5d8e24298a6caaf441
2013-07-17 21:08:18 -07:00
Ying Wang
5338fbfaca Install to TARGET_OUT_APPS_PRIVILEGED if LOCAL_PRIVILEGED_MODULE is true
Change-Id: I268b8652f18034aa3fdd3126ebf6196f78c4bbb2
2013-05-08 15:49:08 -07:00
Ying Wang
3e55609134 Support to dist unbundled files for bundled build
Usage:
LOCAL_DIST_BUNDLED_BINARIES := true
The dist files will include the jni shared libraries and the apk with
jni libraries stripped.

Bug: 8181626
Change-Id: I4a047d786ad35b948b4ad7a51adf37321dbe395c
2013-04-10 22:06:02 -07:00
Ulas Kirazci
bde274ef83 Add a "nano" option to LOCAL_PROTOC_OPTIMIZE_TYPE.
Change-Id: I7429015b3c5f7f38b7be01eb2d4927f7a9999c80
2013-04-03 13:37:07 -07:00
Dianne Hackborn
a1fece009f Add LOCAL_APK_LIBRARIES argument.
This allows you to build apks that link against other
apks using the framework's new shared library apk feature.

Also if you are using LOCAL_APK_LIBRARIES, then LOCAL_DEX_PREOPT
will not be allowed.  This is because using preopt means the
apk is stripped of its dex file, so the pre-installed apk can't
be redexed if its associated library changes.  (Even if the build
system didn't strip the dex, Dalvik still has issues because it
assumes a pre-odex file is always valid.)

Change-Id: I952c0d24f8975f75aff67f78b5faeec91144c3e7
2013-03-12 10:50:28 -07:00
Dirk Dougherty
9d38ec786d am 54096df3: am 1f7c3cb3: am 061c758c: am 9fdf671d: Add LOCAL_ADDITIONAL_HTML_DIR to clear_vars for devsite docs builds.
# Via Android Git Automerger (3) and Dirk Dougherty (1)
* commit '54096df340b52254b8fe873d43f4de76806b788b':
  Add LOCAL_ADDITIONAL_HTML_DIR to clear_vars for devsite docs builds.
2013-02-08 16:33:09 -08:00
Dirk Dougherty
1f7c3cb3c2 am 061c758c: am 9fdf671d: Add LOCAL_ADDITIONAL_HTML_DIR to clear_vars for devsite docs builds.
# Via Android Git Automerger (1) and Dirk Dougherty (1)
* commit '061c758cfa5409035854804efa1e0c4d32d2f007':
  Add LOCAL_ADDITIONAL_HTML_DIR to clear_vars for devsite docs builds.
2013-02-08 16:27:11 -08:00
Dirk Dougherty
9fdf671d7f Add LOCAL_ADDITIONAL_HTML_DIR to clear_vars for devsite docs builds.
Change-Id: Ib75e776d0220a86a08ddd5d7e09edd069af05da1
2013-02-08 15:45:45 -08:00
Stephen Hines
3b0fa1083e Copy RS compatibility libraries to /system/lib/ for bundled builds.
Bug: 8138884
Change-Id: I74fb0c5835974af3c6e34fcd2d9ebfc2e7b08b4d
2013-02-06 20:16:22 -08:00
Ying Wang
e56605ada2 Add LOCAL_POST_INSTALL_CMD
With this support, you can piggy-back some symlinks when a module gets
installed.
This is especially helpful if the target of the symlink doesn't exist on
the build machine.

Change-Id: I48af7a90ce67475bc49b72f94a8753b94da98edd
2013-02-06 11:44:41 -08:00
Ying Wang
2ce71aa062 Add new LOCAL_PROGUARD_ENABLED option "nosystem"
With which we don't include proguard flags defined by the build system.
Bug: 7990659

Change-Id: I78384d2fbaccdd714d646e1b648417195bbd8dde
2013-01-11 15:31:45 -08:00
Ying Wang
63d94fa305 Build from source or prebuilt
With this change, you can easily switch between building from source
code and prebuilt.
Set LOCAL_PREBUILT_MODULE_FILE to the path of the prebuilt file,
relative to the top of the source tree, in the usual module definition.
The prebuilt will be used unless any of the followings satisfied:
1) ANDROID_BUILD_FROM_SOURCE is "true", which disable prebuilt globally;
2) The module name is in ANDROID_NO_PREBUILT_MODULES;
3) The LOCAL_PATH is prefixed by any of ANDROID_NO_PREBUILT_PATHS.
A developer can set ANDROID_NO_PREBUILT_MODULES or
ANDROID_NO_PREBUILT_PATHS to build only his own module(s) from source,
while build other modules from prebuilts.
You can set ANDROID_BUILD_FROM_SOURCE to true to build everything from
source.
Those variables can be set with shell environmental variable or in your
buildspec.mk.

Sometimes module B is able to be built from source only if module A is
also
built from source, for example, if B is the test apk of A.
In that case, you can use the macro include-if-build-from-source to
include B's Android.mk only if A is built from source too, or
if-build-from-source to conditionally include the definition of module
B,
if their module definitions are in the same Android.mk.

Support host-executable-hook and host-shared-library-hook.

Change-Id: Icab7cf028c87eaba0dd7efc2a7749fd6f32b44e4
2012-12-14 14:48:00 -08:00
Stephen Hines
e719f28d93 Build rules for Renderscript compatibility library.
Bug: 7419958
Change-Id: I2e0f0bb632e6ff22b2cf1a1b96b28364637995cc
2012-12-12 14:58:02 -08:00
Ying Wang
31df068b38 Additional certificates support for an apk.
Change-Id: I5b35d5728ba9d65f7ece956127270a9ca2ea0efe
2012-11-13 10:56:04 -08:00
Joe Onorato
8858d2a731 Add a tool to let you enforce layering between packages in a java module.
And build system support for it too.

Change-Id: I4dd5ed0b9edab6e8884b0d00cfeeae5fa38d967a
2012-10-20 17:25:55 -07:00
Joe Onorato
0eccce99d7 Add a tool to let you enforce layering between packages in a java module.
And build system support for it too.

Change-Id: I4dd5ed0b9edab6e8884b0d00cfeeae5fa38d967a
2012-10-18 10:21:46 -07:00
Ying Wang
9f31a2bc1b am 57dfd515: am 6a44471c: am abc9d6f2: Merge "Delete the unused LOCAL_POST_PROCESS_COMMAND." into jb-mr1-dev
* commit '57dfd515c33bbab26c820c812ebb4bc69c36a38f':
  Delete the unused LOCAL_POST_PROCESS_COMMAND.
2012-10-12 11:10:16 -07:00
Ying Wang
c58b194e78 Delete the unused LOCAL_POST_PROCESS_COMMAND.
Change-Id: I77785dff6c7b2236880232522d6ed5bc01d5f0ce
2012-10-11 17:26:07 -07:00
Ying Wang
fb12f71fe7 am 18c8d9eb: am 3a6f7589: Add LOCAL_DONT_DELETE_JAR_META_INF
* commit '18c8d9eb1e0c0776862d554f0834e7ee3018375a':
  Add LOCAL_DONT_DELETE_JAR_META_INF
2012-08-30 14:16:31 -07:00
Ying Wang
3a6f7589e8 Add LOCAL_DONT_DELETE_JAR_META_INF
To support to not delete META_INF directory from the static Java
libraries.

Change-Id: I720bfa059c43dd457a74a0c60bb6797aa408ecaf
2012-08-30 12:59:42 -07:00
Ying Wang
3ea0a81c2b am d19511a6: am c3a4cfe9: Merge "Support EMMA_INSTRUMENT in both full and unbundled builds." into jb-mr1-dev
* commit 'd19511a6657efc7f1a7e544df04f076223f8fe65':
  Support EMMA_INSTRUMENT in both full and unbundled builds.
2012-08-22 15:27:37 -07:00
Ying Wang
af4800c8a6 Support EMMA_INSTRUMENT in both full and unbundled builds.
Bug: 6987838
- With this change, use "EMMA_INSTRUMENT=true" to enable emma in full or
  unbundled build.
- You don't need to add "LOCAL_STATIC_JAVA_LIBRARIES += emma" any more for
  unbundled apps.
- Now a single var LOCAL_EMMA_INSTRUMENT replaces the previous
  LOCAL_NO_EMMA_INSTRUMENT and LOCAL_NO_EMMA_COMPILE.
- By default, if EMMA_INSTRUMENT is true, emma is enabled for only
  non-test apps.
- A new global var EMMA_INSTRUMENT_STATIC. It enables EMMA_INSTRUMENT
  and builds emma into apk/jar as static library, instead of using emma
  as part of shared library core.jar.

Change-Id: I0aa219e83074879ececc159b5b07c39eb07ccc00
2012-08-22 12:11:01 -07:00
Ying Wang
7429e21c2e Add LOCAL_CONLYFLAGS.
To pass compiler flags
LOCAL_CFLAGS: to both C and C++ files;
LOCAL_CONLYFLAGS: to only C files but not C++ files;
LOCAL_CPPFLAGS: to only C++ file.
LOCAL_CPPFLAGS and LOCAL_CONLYFLAGS can override flags in LOCAL_CFLAGS.

Bug: 6967573
Change-Id: I88d9de0980e451b94bc7ae8c741ea2030eada3e1
2012-08-15 11:02:28 -07:00
Ying Wang
54fdb473b6 Retire LOCAL_NDK_VERSION.
We are now unifying the NDK versions of unbundled native code to always
use the latest NDK.
We don't need the variable LOCAL_NDK_VERSION now.
To build native code with NDK, you need set just LOCAL_SDK_VERSION.

Bug: 6932421
Change-Id: I86f05a264249cda6bae97b4b1616f03700cd9dfa
2012-08-14 11:58:13 -07:00
Ying Wang
848020f22a Retire LOCAL_NDK_VERSION.
We are now unifying the NDK versions of unbundled native code to always
use the latest NDK.
We don't need the variable LOCAL_NDK_VERSION now.
To build native code with NDK, you need set just LOCAL_SDK_VERSION.

Bug: 6932421
Change-Id: I86f05a264249cda6bae97b4b1616f03700cd9dfa
2012-08-14 10:16:02 -07:00
Ying Wang
9f42af5bbc resolved conflicts for merge of a8df6091 to master
Change-Id: I2d088c09738b34f72c2efa030304fca28ad0e791
2012-07-23 19:49:48 -07:00