Commit graph

204 commits

Author SHA1 Message Date
Ying Wang
c23f4efdbb Add transform-d-to-p-args
This new indirection allows us too to output .P files when we are
generating non-.o files, such as .s or .S files.
Bug: 7127743

Change-Id: I9e46c417031764fefc9909ba4a3eb63885f34f9e
2012-09-07 17:04:06 -07:00
Joe Onorato
529302d912 Remove support for user tags in the build system.
It is not forbidden to say LOCAL_MODULE_TAGS := user,
and if you don't say LOCAL_MODULE_TAGS, it now defaults
to optional.

Change-Id: I0a0b200bb6f1c7bf1fe3a89cdc8f69678617526c
2012-08-16 22:36:41 -07:00
Joe Onorato
f85cb7c936 Don't give the user tag to host modules automatically.
Change-Id: I12d0a84786e5bf2224efd8684526b6097e6105d7
2012-08-16 22:36:40 -07:00
Andrew Boie
85f3b21971 definitions.mk: Don't use GCC '@' parameter
This parameter (which causes GCC to pull additional command line
parameters out of a file) is incompatible with ccache.

- With ccache 2.x, ccache will ignore this parameters, and potentially
compute invalid command line hashes since it is not reading the
parameter file

- With ccache 3.x, ccache will refuse to cache the files and error
with 'Unsupported compiler option'.

We still use the parameter file, but Make expands it instead.

Change-Id: I070c3877cbe2d058e1cf4754bac535e7f3498861
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2012-07-26 10:21:04 -07:00
Ying Wang
ae25ec1bcd More flexibility to keep/remove R.class in static Java library
- Usually you don't need to set LOCAL_JAR_EXCLUDE_FILES in your
  Android.mk, if your static library is directly used by an app.
- If your library will be included by another library that need
  reference the R/Manifest class, you can set
  LOCAL_JAR_EXCLUDE_FILES := none
  to keep the generated classes.
- If your library includes another static library that has Android
  resource and you want to remove the generated classes carried by
  the static library, set:
  LOCAL_JAR_EXCLUDE_FILES := $(ANDROID_RESOURCE_GENERATED_CLASSES)

With the LOCAL_JAR_EXCLUDE_FILES value "none", deprecate the old
long variable LOCAL_KEEP_R_CLASS_IN_STATIC_JAVA_LIBRARY.

Change-Id: I3b9ad5d66f0262f784feb09bc1537c5b01256258
2012-06-19 10:40:37 -07:00
Ying Wang
3ceecfa3da Check the well-formedness of an xml file before copying.
Bug: 6491991
Change-Id: I3dbf9a7e1fefd9fea2636c78a85bae63ea8391b8
2012-05-14 14:40:58 -07:00
Ying Wang
000e89a5b9 Strengthen dependencies on LOCAL_REQUIRED_MODULES
Bug: 6418863
This change expands the PRODUCT_PACKAGES with the required modules.
Before this change, since the required modules are not in the
PRODUCT_PACKAGES, they are not directly depended on by the image files.
If the dependent is not to be included in the image but the required
modules are to be included, the dependency of the image on the required
modules gets lost!
That would lead to build race condition.

Change-Id: I0b656db1538ca43d3785dbf17364ffa88b80ac41
2012-04-30 16:32:25 -07:00
Ying Wang
68f1c77a8d Make export_includes depend on the module's definition makefile.
Bug: 6383397

Note that LOCAL_MODULE_MAKEFILE is calculated in the macro my-dir,
which must be called at the beginning of your Android.mk to calculate
 LOCAL_PATH.

Change-Id: I7aa079e37253fbda25ffb85c2e5bbf0663340e27
2012-04-23 21:29:18 -07:00
Ying Wang
4394aaef7e Merge "Build system support to export include paths" 2012-04-09 12:43:09 -07:00
Doug Zongker
9296f09277 optional cross-check between OTA radio images and board-info.txt
Adds a python script which checks the version of each radio image
added with the new add-radio-file-checked macro against a file
containing sha-1 -> version string mappings and the contents of
board-info.txt, so that the build can fail if board-info.txt and the
OTA images are out of sync.

Change-Id: Icb61dc2adefc240ced9059941582c23b629089c0
2012-03-21 09:18:15 -07:00
Wink Saville
8d5610cd1b Merge "Increase java heap size." 2012-01-30 15:42:28 -08:00
Wink Saville
29b3afaf79 Increase java heap size.
I got an Out of memory while compiling, Andreas Huber suggested that
increasing the heap size, which worked.

Change-Id: Id8293ef100ef814b0fe13aa6e1b891a36a2ee853
2012-01-30 15:30:10 -08:00
Ying Wang
707328a3ef Build should fail if any proto file fails compiling
When compile multipling proto files to Java in a for loop.

Change-Id: Ie6a9d3972401b0ad6406bf911db916fcbf88037b
2012-01-30 11:56:07 -08:00
Conley Owens
015c7885e0 Merge "Get build system to work with Make 3.82" 2011-12-22 15:14:01 -08:00
Conley Owens
d7a1a9b49b Get build system to work with Make 3.82
Note: `sort` can't seem to handle newlines in 3.82.

Change-Id: Ieeaee1d19688688a02e396bbc5b4dea26e7f6943
2011-12-22 09:56:18 -08:00
Atte Peltomaki
5846050fd4 am 05e98055: am 60fe963c: build: explicitly define dependency files
* commit '05e98055fdb1d48bac80790cb719838598b687e8':
  build: explicitly define dependency files
2011-12-21 16:46:36 -08:00
Atte Peltomaki
60fe963c63 build: explicitly define dependency files
Groundwork for distcc support in Android build system,
see distcc FAQ for details on why -MF is needed:
http://distcc.googlecode.com/svn/trunk/doc/web/faq.html
2011-12-21 09:24:09 -08:00
Ying Wang
4b9d4ea2e2 Merge "Collect the GPL source files." 2011-12-16 17:00:46 -08:00
Ying Wang
5758b8ed96 Remove the R/Manifest classes when building the static Java library
Bug: 5448433

Instead of deferring the removal to building the app.
In that case any R/Manifest classes in any static Java libraries will be
deleted, no matter if they are generated from Android resource, or just
source R.java/Manifest.java in the source tree by accident.

Change-Id: I656f45e3cbc3796c5d4832363231480b3f1dc5b8
2011-12-15 16:36:55 -08:00
Ying Wang
bf6c611cae Don't remove R class to fix the build.
Unfortunately there is R.java checked in the source tree that gets built
into static library.
So we have to find a way to delete classes from R.java generated by the
build system on the fly.

Change-Id: I2d82d28234cecbf6dd5b02b2dd4f7dbd47e3b626
2011-12-15 15:10:04 -08:00
Ying Wang
20e2083ea0 Support to build static Java library with Android resource
Bug: 5714516

The rationale behind this change:
- the library is compiled into a jar file, but its R class is generated
  making the constant not constant (static, not final static) (aapt
  option --non-constant-id). Also the jar file does not contain the R
  class.
- this allows the integer value to not be inlined in the compiled
  class files. Note that this prevents using switch statements.
- the main project use this jar file as a normal static library: it will
  add all the class files except the R.class.
- the main project uses the library res folder as a resource
  folder with lower priority than the main project (basically the
  main project is an overlay. This is accomplished using aapt's
  --auto-add-overlay to handle resources only in the main project
  (which the normal overlay mechanism doesn't allow).
- the main project creates R classes in the main project's
  package but also in the library's package. This is done with
  aapt's --extra-packages which accept as many packages as
  needed, separated by a :.
- manifest merging is not done yet, so
  activities/services/permissions/etc... have to be manually declared in
  the main app.

To use a static library with Android resource in your app,
1. Add the library's resource dir to your app as an overlay:
LOCAL_RESOURCE_DIR := <app_resource_dir> <static_library_resource_dirs>
2. Set the proper aapt flags:
LOCAL_AAPT_FLAGS := <apps_own_flags> --auto-add-overlay \
  --extra-packages <lib1_package_name>:<lib2_package_name>:...

Change-Id: Ifb4d2300b952ea4aaee74da1bb0c6c72ea0698a3
2011-12-14 16:04:59 -08:00
Ying Wang
e109a1d08d Allow to build Java module from mere static Java libraries.
With this change, we can easily turn a static Java library to a shared
Java library.

Change-Id: I9915992cd19879846511d6272483d7a0a934e7eb
2011-12-12 17:52:03 -08:00
Ying Wang
fd626f2d21 Collect the GPL source files.
Bug: 5693205
Change-Id: I045b83949f8b29d7c5cf5c0ab32c5b83cf398e71
2011-12-12 12:57:38 -08:00
Stephen Hines
914f7a2990 Enable -Wall/-Werror with LOCAL_RENDERSCRIPT_FLAGS.
Change-Id: Ia2a058e6711839d89072c2e96f0c60aa4cedda6b
2011-12-07 11:41:28 -08:00
Ying Wang
99bcbeb355 Print more info of the image size stats.
Bug: 5620615
Before this change it only reports the limit if the real size exceeeds
or approaches the limit.

Change-Id: Ie1737d6ba2dc2d57ad82c487990e109882526d6e
2011-12-02 10:34:45 -08:00
Jeff Hamilton
293f9392ba Bypass alias for grep in the tapas command.
Change-Id: I82705535bda927ddc7e9aebb9610d712b68a50d2
2011-11-18 17:24:13 -06:00
Ying Wang
5f074803fb Build system support to export include paths
Bug: 5573756
With this change, we can set LOCAL_EXPORT_C_INCLUDE_DIRS in the module
definition to export include dir paths.
Paths in LOCAL_EXPORT_C_INCLUDE_DIRS should be relative to the top dir
of the source tree.
If a library (shared or static) exports some include paths, any module
using it will import the include paths and add them to the compiler
command line.

Change-Id: I49aabc589d2cf214044d13ccd5532ef68209adf0
2011-11-17 10:52:32 -08:00
Conley Owens
e04c2c21ee am e915ab45: Place linker arguments after objects for gcc
* commit 'e915ab45a11f88c4fa5f2561c1aaca4b7d3d7593':
  Place linker arguments after objects for gcc
2011-11-10 19:01:36 +00:00
Conley Owens
e915ab45a1 Place linker arguments after objects for gcc
gcc 4.6.1 does not properly link if libraries are specified before
objects.

Change-Id: Iabe3eac831fe597abe8a93a946ab7a22d584db46
2011-11-10 10:55:13 -08:00
Conley Owens
d9e7d25741 Place linker arguments after objects for gcc
gcc 4.6.1 does not properly link if libraries are specified before
objects.

Change-Id: Iabe3eac831fe597abe8a93a946ab7a22d584db46
2011-11-10 09:57:40 -08:00
Bjorn Bringert
cec077521e Merge "Compile each proto file separately" 2011-10-18 09:48:20 -07:00
Bjorn Bringert
20f5efd82c Compile each proto file separately
Before, if a module had several proto source files,
they would all be compiled in a single invocation
of aprotoc. If any of the files imported one of the
other files, you got an aprotoc error about duplicates.
And if you removed the files that were imported
from the list of source files, no Java code
would be generated for the imported files,
causing a Java compile time error.

This changes compiles each proto file separately, which
avoids both of the problems above. It's slightly more
inefficient, but aprotoc is really fast.

Change-Id: I7bd8092ec2953c20269367a1c68ff84acceea3be
2011-10-18 16:08:27 +01:00
Dianne Hackborn
9baabf8d7e am a0f464a8: New PRODUCT_AAPT_PREF_CONFIG.
* commit 'a0f464a8e7f006177db084df7e925bbb8e5ffed3':
  New PRODUCT_AAPT_PREF_CONFIG.
2011-10-17 11:31:38 -07:00
Dianne Hackborn
a0f464a8e7 New PRODUCT_AAPT_PREF_CONFIG.
To use the new aapt --preferred-configurations option.  For use with Prime
to be able to strip everything but xhdpi density bitmaps selectively,
not stripping when this would result in no data for the resource.

Change-Id: I4e1012929b8f9b0b1e79c06496647f69661ba1f2
2011-10-14 19:37:57 -07:00
Ying Wang
d89452976b Merge "Use shell variable to eliminate $(eval) in commands." 2011-10-11 10:11:44 -07:00
Ying Wang
f1054bf22e Merge "Discard hidden files when rounding up resource." 2011-09-08 14:16:23 -07:00
Stephen Hines
c963eae72c Update build to properly use prebuilt llvm-rs-cc.
Change-Id: I52a83066b6c08d05d69db4f93631eeaf9c0b41c6
2011-08-10 17:01:43 -07:00
Ying Wang
6ab5d6aa16 Discard hidden files when rounding up resource.
Aapt will discard the hidden files anyway.
With this change, we can avoid unnecessary rebuild if a module has only
hidden files in its resource dir.

Change-Id: Iaf0a13e038cca5fb60012c550cc90f7abbe967e1
2011-08-10 16:05:51 -07:00
Ying Wang
6e7db38de7 Use shell variable to eliminate $(eval) in commands.
$(eval) in the commands does not evaulate in the same order in emake as
in gmake. Using shell vars work in both makes.

Change-Id: I4e95adb2bc6f4600e29b9a8524275a099f47a401
2011-07-27 12:57:37 -07:00
Ying Wang
7e8d442ca4 Uniq the system properties.
If multiple items with the same key appear in a config variable,
only the first item is taken.

Change-Id: Icf57befafb36ec35dd4d48c8c3ec595f353f68e7
2011-06-17 17:10:04 -07:00
Ying Wang
194a8ec8ae Use arg list file to pass arguments to jar.
To fix error "/bin/bash: Argument list too long"

Change-Id: Ie336b18f9a7eba38d94a6e32c07a88589ce9f1fd
2011-06-06 14:34:52 -07:00
Ying Wang
4387dc3ee1 am 823f6389: am 3487736b: am 7d83ef8f: Support custom RenderScript compiler
* commit '823f63894fb4ad5c1280a5ee7eb004792223a488':
  Support custom RenderScript compiler
2011-06-02 16:49:33 -07:00
Doug Kwan
e804fc92ec Merge "Allow enabling RTTI in a module." 2011-06-01 11:23:20 -07:00
Joe Onorato
149dd914b8 Switch the java encoding from ascii to utf8.
Change-Id: Iee0972df68b44fc8c653812cf165b57350a7ec5d
2011-05-31 18:21:07 -07:00
Ying Wang
823f63894f am 3487736b: am 7d83ef8f: Support custom RenderScript compiler
* commit '3487736bac5625bef8ff9bc4ef311b29348055d9':
  Support custom RenderScript compiler
2011-05-27 15:38:10 -07:00
Ying Wang
7d83ef8ff7 Support custom RenderScript compiler
Change-Id: I85e38e84565e04f99dd26217f280274883dc322d
2011-05-27 13:47:17 -07:00
Doug Kwan
9a8ecf970b Allow enabling RTTI in a module.
Change-Id: Ie8ce920e3ccb7e53bdf917d8ac5a386df3e7836a
2011-05-10 21:50:58 -07:00
Ying Wang
fcdabd4bdb Add LOCAL_GROUP_STATIC_LIBRARIES
Set LOCAL_GROUP_STATIC_LIBRARIES := true to group the static libraries,
in case we need gcc flags "-Wl,--start-group" and "-Wl,--end-group" to
fix circular references.

Change-Id: I03c4901670112fcdd2bb0fe660b6924e5776fcf8
2011-04-25 14:22:41 -07:00
Ying Wang
ddbcad8c85 Add TARGET_PROJECT_INCLUDES as system includes
And do the same to host modules.

Bug: 4279745
Change-Id: I5b0cd0e13e0e61b5051537b5834eba48e5f822f8
2011-04-18 11:45:44 -07:00
Ying Wang
4761e56a71 Pass TARGET_C_INCLUDES as system include directories to gcc
So warnings from those headers can be suppressed.
Bug: 4279745

Change-Id: Id69b253c5566de53153b87ef69eff15b8a47c832
2011-04-12 12:49:04 -07:00