diff options
author | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 22:08:06 +0000 |
---|---|---|
committer | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 22:08:06 +0000 |
commit | d0245a13c45c5542b51c4eb2c9958c19917e09a7 (patch) | |
tree | e618fe039d733fa1f880dbd583eded8c0def8bf0 | |
parent | 25320604c11e0313ef5663bff8553b2c9febc9f6 (diff) | |
download | chromium_src-d0245a13c45c5542b51c4eb2c9958c19917e09a7.zip chromium_src-d0245a13c45c5542b51c4eb2c9958c19917e09a7.tar.gz chromium_src-d0245a13c45c5542b51c4eb2c9958c19917e09a7.tar.bz2 |
Removed CXX_target for Android
Don't rely on compiler_version.py, we pass in the gcc_version for Android
Also revert the previous compiler_version.py change.
BUG=143889
Review URL: https://chromiumcodereview.appspot.com/11185059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162808 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | build/android/envsetup.sh | 16 | ||||
-rwxr-xr-x | build/android/envsetup_functions.sh | 4 | ||||
-rwxr-xr-x | build/compiler_version.py | 49 |
3 files changed, 20 insertions, 49 deletions
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh index f94ca65..e381ac5 100755 --- a/build/android/envsetup.sh +++ b/build/android/envsetup.sh @@ -107,24 +107,12 @@ export ANDROID_GOMA_WRAPPER # Declare Android are cross compile. export GYP_CROSSCOMPILE=1 -export CXX_target="${ANDROID_GOMA_WRAPPER} \ - $(echo -n ${ANDROID_TOOLCHAIN}/*-g++)" - # Performs a gyp_chromium run to convert gyp->Makefile for android code. android_gyp() { + # This is just a simple wrapper of gyp_chromium, please don't add anything + # in this function. echo "GYP_GENERATORS set to '$GYP_GENERATORS'" - # http://crbug.com/143889. - # In case we are doing a Clang build, we have to unset CC_target and - # CXX_target. Otherwise GYP ends up generating a gcc build (although we set - # 'clang' to 1). This behavior was introduced by - # 54d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83f in GYP. ( - # Fork to avoid side effects on the user's environment variables. - if echo "$GYP_DEFINES" | grep -qE '(clang|asan)'; then - if echo "$CXX_target" | grep -q g++; then - unset CXX_target - fi - fi "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" ) } diff --git a/build/android/envsetup_functions.sh b/build/android/envsetup_functions.sh index da8a4ee..f91e5da 100755 --- a/build/android/envsetup_functions.sh +++ b/build/android/envsetup_functions.sh @@ -33,6 +33,9 @@ common_vars_defines() { fi toolchain_version="4.6" + # We directly set the gcc_version since we know what we use, and it should + # be set to xx instead of x.x. Refer the output of compiler_version.py. + gcc_version="46" toolchain_target=$(basename \ ${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}-${toolchain_version}) toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_target}"\ @@ -70,6 +73,7 @@ common_vars_defines() { # to canonicalize them (remove double '/', remove trailing '/', etc). DEFINES="OS=android" DEFINES+=" host_os=${host_os}" + DEFINES+=" gcc_version=${gcc_version}" if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then DEFINES+=" branding=Chrome" diff --git a/build/compiler_version.py b/build/compiler_version.py index eae7b17..b349199 100755 --- a/build/compiler_version.py +++ b/build/compiler_version.py @@ -33,42 +33,21 @@ def GetVersion(compiler): print >> sys.stderr, e return "" -def GetVersionFromEnvironment(compiler_env): - """ Returns the version of compiler - - If the compiler was set by the given environment variable and exists, - return its version, otherwise None is returned. - """ - cxx = os.getenv(compiler_env, None) - if cxx: - cxx_version = GetVersion(cxx) - if cxx_version != "": - return cxx_version - return None - def main(): - # Check if CXX_target or CXX environment variable exists an if it does use - # that compiler. - # TODO: Fix ninja (see http://crbug.com/140900) instead and remove this code - # In ninja's cross compile mode, the CXX_target is target compiler, while - # the CXX is host. The CXX_target needs be checked first, though the target - # and host compiler have different version, there seems no issue to use the - # target compiler's version number as gcc_version in Android. - cxx_version = GetVersionFromEnvironment("CXX_target") - if cxx_version: - print cxx_version - return 0 - - cxx_version = GetVersionFromEnvironment("CXX") - if cxx_version: - print cxx_version - return 0 - - # Otherwise we check the g++ version. - gccversion = GetVersion("g++") - if gccversion != "": - print gccversion - return 0 + # Check if CXX environment variable exists and + # if it does use that compiler. + cxx = os.getenv("CXX", None) + if cxx: + cxxversion = GetVersion(cxx) + if cxxversion != "": + print cxxversion + return 0 + else: + # Otherwise we check the g++ version. + gccversion = GetVersion("g++") + if gccversion != "": + print gccversion + return 0 return 1 |