diff options
author | David 'Digit' Turner <digit@google.com> | 2009-07-27 12:24:58 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-07-27 12:24:58 +0200 |
commit | 61697d20c6e38ce007db1243aebf0a89836c440e (patch) | |
tree | fd408050e9921c7402aa8f0f2a194a2a571acf8c | |
parent | 6d2417bd4870aa1415d764da3f09f7144465b73a (diff) | |
download | ndk-61697d20c6e38ce007db1243aebf0a89836c440e.tar.gz |
Fix LOCAL_CFLAGS/CPPFLAGS handling to match full Android build system.
Also improve BUILD_SYSTEM directory detection logic in build/core/main.mk
-rw-r--r-- | build/core/definitions.mk | 4 | ||||
-rw-r--r-- | build/core/main.mk | 7 | ||||
-rw-r--r-- | docs/ANDROID-MK.TXT | 24 | ||||
-rw-r--r-- | docs/APPLICATION-MK.TXT | 15 | ||||
-rw-r--r-- | docs/CHANGES.TXT | 11 |
5 files changed, 43 insertions, 18 deletions
diff --git a/build/core/definitions.mk b/build/core/definitions.mk index 22725427e..fa223b0e3 100644 --- a/build/core/definitions.mk +++ b/build/core/definitions.mk @@ -371,9 +371,7 @@ $$(_OBJ): PRIVATE_CFLAGS := $$($$(my)CFLAGS) \ $$($$(my)$(LOCAL_ARM_MODE)_$(LOCAL_BUILD_MODE)_CFLAGS) \ $$(LOCAL_C_INCLUDES:%=-I%) \ -I$$(LOCAL_PATH) \ - $$(LOCAL_CPPFLAGS) \ $$(LOCAL_CFLAGS) \ - $$(NDK_APP_CPPFLAGS) \ $$(NDK_APP_CFLAGS) $$(_OBJ): $$(_SRC) $$(LOCAL_MAKEFILE) $$(NDK_APP_APPLICATION_MK) @@ -431,8 +429,10 @@ $$(_OBJ): PRIVATE_CXXFLAGS := $$($$(my)CXXFLAGS) \ $$($$(my)$(LOCAL_ARM_MODE)_$(LOCAL_BUILD_MODE)_CFLAGS) \ $$(LOCAL_C_INCLUDES:%=-I%) \ -I$$(LOCAL_PATH) \ + $$(LOCAL_CFLAGS) \ $$(LOCAL_CPPFLAGS) \ $$(LOCAL_CXXFLAGS) \ + $$(NDK_APP_CFLAGS) \ $$(NDK_APP_CPPFLAGS) \ $$(NDK_APP_CXXFLAGS) \ diff --git a/build/core/main.mk b/build/core/main.mk index c4ac8fe1b..5edd217c1 100644 --- a/build/core/main.mk +++ b/build/core/main.mk @@ -20,12 +20,13 @@ # # ==================================================================== +# The location of the build system files +BUILD_SYSTEM := $(strip $(dir $(lastword $(MAKEFILE_LIST)))) +BUILD_SYSTEM := $(BUILD_SYSTEM:%/=%) + # Include common definitions include build/core/definitions.mk -# The location of the build system files -BUILD_SYSTEM := build/core - # Where all generated files will be stored during a build NDK_OUT := out diff --git a/docs/ANDROID-MK.TXT b/docs/ANDROID-MK.TXT index 9a77ab199..6dd5e80ae 100644 --- a/docs/ANDROID-MK.TXT +++ b/docs/ANDROID-MK.TXT @@ -337,11 +337,10 @@ LOCAL_C_INCLUDES LOCAL_CFLAGS An optional set of compiler flags that will be passed when building - C source files (*not* C++ sources). + C *and* C++ source files. - This can be useful to specify an additionnal include path - (relative to the top of the NDK directory), macro definitions - or compile options. + This can be useful to specify additionnal macro definitions or + compile options. IMPORTANT: Try not to change the optimization/debugging level in your Android.mk, this can be handled automatically for @@ -349,11 +348,24 @@ LOCAL_CFLAGS your Application.mk, and will let the NDK generate useful data files used during debugging. + NOTE: In android-ndk-1.5_r1, the corresponding flags only applied + to C source files, not C++ ones. This has been corrected to + match the full Android build system behaviour. (You can use + LOCAL_CPPFLAGS to specify flags for C++ sources only now). + LOCAL_CXXFLAGS - Same as LOCAL_CFLAGS for C++ source files + An alias for LOCAL_CPPFLAGS. Note that use of this flag is obsolete + as it may disappear in future releases of the NDK. LOCAL_CPPFLAGS - Same as LOCAL_CFLAGS but used for both C and C++ source files + An optional set of compiler flags that will be passed when building + C++ source files *only*. They will appear after the LOCAL_CFLAGS + on the compiler's command-line. + + NOTE: In android-ndk-1.5_r1, the corresponding flags applied to + both C and C++ sources. This has been corrected to match the + full Android build system. (You can use LOCAL_CFLAGS to specify + flags for both C and C++ sources now). LOCAL_STATIC_LIBRARIES The list of static libraries modules (built with BUILD_STATIC_LIBRARY) diff --git a/docs/APPLICATION-MK.TXT b/docs/APPLICATION-MK.TXT index 6f84da9c6..7016c4db8 100644 --- a/docs/APPLICATION-MK.TXT +++ b/docs/APPLICATION-MK.TXT @@ -62,7 +62,7 @@ APP_OPTIM the code difficult, stack traces may not be reliable, etc... APP_CFLAGS - A set of C compiler flags passed when compiling any C source code + A set of C compiler flags passed when compiling any C or C++ source code of any of the modules. This can be used to change the build of a given module depending on the application that needs it, instead of modifying the Android.mk file itself. @@ -89,11 +89,20 @@ APP_CFLAGS + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + NOTE: In android-ndk-1.5_r1, this only applied to C sources, not C++ ones. + This has been corrected to match the full Android build system. + APP_CXXFLAGS - Same as APP_CFLAGS for C++ sources. + An alias for APP_CPPFLAGS, to be considered obsolete as it may disappear + in a future release of the NDK. APP_CPPFLAGS - Same as APP_CFLAGS but will be passed to both C and C++ sources + A set of C++ compiler flags passed when building C++ sources *only*. + + NOTE: In android-ndk-1.5_r1, this applied to both C and C++ sources. + This has been corrected to match the full Android build system. + You can now use APP_CFLAGS for flags that shall apply to C and + C++ souces. A trivial Application.mk file would be: diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT index 411fe567d..2cccadc42 100644 --- a/docs/CHANGES.TXT +++ b/docs/CHANGES.TXT @@ -33,11 +33,14 @@ current version - Fix compilation of assembler files (e.g. foo.S) -- Make LOCAL_CFLAGS / LOCAL_CXXFLAGS / LOCAL_CPPFLAGS work as advertized - by the documentation (previously, only LOCAL_CFLAGS did work for both C - *and* C++ sources, contrary to what the doc claimed). +- Fix LOCAL_CFLAGS / LOCAL_CPPFLAGS to work as in the full Android build + system. This means that: - Note that APP_CPPFLAGS / APP_CFLAGS / APP_CXXFLAGS continue to work. + - LOCAL_CFLAGS is used for both C and C++ sources + - LOCAL_CPPFLAGS is used for C++ sources only + - LOCAL_CXXFLAGS is used like LOCAL_CPPFLAGS but is considered obsolete. + + Also fixed APP_CPPFLAGS / APP_CFLAGS / APP_CXXFLAGS. ------------------------------------------------------------------------------- android-ndk-1.5_r1 released. |