OSDN Git Service

Refactor use of __ANDROID__ macro
authorBilyan Borisov <bilyan.borisov@linaro.org>
Mon, 4 Apr 2016 15:27:32 +0000 (16:27 +0100)
committerBilyan Borisov <bilyan.borisov@linaro.org>
Fri, 22 Apr 2016 12:33:30 +0000 (13:33 +0100)
commitbb661c0f0cb72d4bbfc2e251f6ded6949a713292
tree4fe7e66f3385b1955934d3ec6f02e00bde6e13b8
parentf7cda8088ec57ab1422f85f08df78e217a9f7094
Refactor use of __ANDROID__ macro

We use the __ANDROID__ macro, which is provided by the toolchain, in
numerous places. This patch refactors the usage of this by defining a
new macro, ART_TARGET_ANDROID, that is being passed during build to
ART_TARGET_CFLAGS in Android.common_build.mk on the same line as
ART_TARGET. The codebase currently assumes that the existence of the
__ANDROID__ macro implies that we are compiling art for an android
target device. This is because, currently, target builds are compiled
with target toolchains that provide the macro, while host toolchains
do not.  With this change this assumption is still preserved. However,
in a future patch we will add the ability to compile art for a linux
target, and in that case the ART_TARGET_ANDROID macro won't be passed
anymore.

Change-Id:  I1f3a811aa735c87087d812da27fc6b08f01bad51
28 files changed:
build/Android.common_build.mk
compiler/debug/dwarf/dwarf_test.cc
compiler/jit/jit_compiler.cc
compiler/jni/jni_cfi_test.cc
compiler/optimizing/optimizing_cfi_test.cc
compiler/utils/assembler_thumb_test.cc
compiler/utils/x86_64/assembler_x86_64_test.cc
runtime/arch/arm/instruction_set_features_arm.cc
runtime/arch/instruction_set_features_test.cc
runtime/base/logging.cc
runtime/gc/allocation_record.cc
runtime/gc/allocator/dlmalloc.h
runtime/gc/allocator/rosalloc.cc
runtime/jdwp/jdwp_adb.cc
runtime/jdwp/jdwp_main.cc
runtime/native/dalvik_system_VMRuntime.cc
runtime/oat_file.cc
runtime/openjdkjvm/OpenjdkJvm.cc
runtime/prebuilt_tools_test.cc
runtime/runtime.cc
runtime/thread-inl.h
runtime/thread.cc
runtime/thread_linux.cc
runtime/thread_list.cc
runtime/thread_pool.cc
sigchainlib/sigchain.cc
sigchainlib/sigchain_dummy.cc
test/051-thread/thread_test.cc