Merge change 8622 into donut

* changes:
  Fix LOCAL_CFLAGS/CPPFLAGS handling to match full Android build system.
This commit is contained in:
Android (Google) Code Review
2009-07-28 14:59:44 -07:00
5 changed files with 43 additions and 18 deletions

View File

@@ -371,9 +371,7 @@ $$(_OBJ): PRIVATE_CFLAGS := $$($$(my)CFLAGS) \
$$($$(my)$(LOCAL_ARM_MODE)_$(LOCAL_BUILD_MODE)_CFLAGS) \ $$($$(my)$(LOCAL_ARM_MODE)_$(LOCAL_BUILD_MODE)_CFLAGS) \
$$(LOCAL_C_INCLUDES:%=-I%) \ $$(LOCAL_C_INCLUDES:%=-I%) \
-I$$(LOCAL_PATH) \ -I$$(LOCAL_PATH) \
$$(LOCAL_CPPFLAGS) \
$$(LOCAL_CFLAGS) \ $$(LOCAL_CFLAGS) \
$$(NDK_APP_CPPFLAGS) \
$$(NDK_APP_CFLAGS) $$(NDK_APP_CFLAGS)
$$(_OBJ): $$(_SRC) $$(LOCAL_MAKEFILE) $$(NDK_APP_APPLICATION_MK) $$(_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) \ $$($$(my)$(LOCAL_ARM_MODE)_$(LOCAL_BUILD_MODE)_CFLAGS) \
$$(LOCAL_C_INCLUDES:%=-I%) \ $$(LOCAL_C_INCLUDES:%=-I%) \
-I$$(LOCAL_PATH) \ -I$$(LOCAL_PATH) \
$$(LOCAL_CFLAGS) \
$$(LOCAL_CPPFLAGS) \ $$(LOCAL_CPPFLAGS) \
$$(LOCAL_CXXFLAGS) \ $$(LOCAL_CXXFLAGS) \
$$(NDK_APP_CFLAGS) \
$$(NDK_APP_CPPFLAGS) \ $$(NDK_APP_CPPFLAGS) \
$$(NDK_APP_CXXFLAGS) \ $$(NDK_APP_CXXFLAGS) \

View File

@@ -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 common definitions
include build/core/definitions.mk 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 # Where all generated files will be stored during a build
NDK_OUT := out NDK_OUT := out

View File

@@ -337,11 +337,10 @@ LOCAL_C_INCLUDES
LOCAL_CFLAGS LOCAL_CFLAGS
An optional set of compiler flags that will be passed when building 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 This can be useful to specify additionnal macro definitions or
(relative to the top of the NDK directory), macro definitions compile options.
or compile options.
IMPORTANT: Try not to change the optimization/debugging level in IMPORTANT: Try not to change the optimization/debugging level in
your Android.mk, this can be handled automatically for your Android.mk, this can be handled automatically for
@@ -349,11 +348,24 @@ LOCAL_CFLAGS
your Application.mk, and will let the NDK generate your Application.mk, and will let the NDK generate
useful data files used during debugging. 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 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 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 LOCAL_STATIC_LIBRARIES
The list of static libraries modules (built with BUILD_STATIC_LIBRARY) The list of static libraries modules (built with BUILD_STATIC_LIBRARY)

View File

@@ -62,7 +62,7 @@ APP_OPTIM
the code difficult, stack traces may not be reliable, etc... the code difficult, stack traces may not be reliable, etc...
APP_CFLAGS 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 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 module depending on the application that needs it, instead of modifying
the Android.mk file itself. 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 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 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: A trivial Application.mk file would be:

View File

@@ -33,11 +33,14 @@ current version
- Fix compilation of assembler files (e.g. foo.S) - Fix compilation of assembler files (e.g. foo.S)
- Make LOCAL_CFLAGS / LOCAL_CXXFLAGS / LOCAL_CPPFLAGS work as advertized - Fix LOCAL_CFLAGS / LOCAL_CPPFLAGS to work as in the full Android build
by the documentation (previously, only LOCAL_CFLAGS did work for both C system. This means that:
*and* C++ sources, contrary to what the doc claimed).
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. android-ndk-1.5_r1 released.