# Add target-specific source files.
'conditions': [
- # FIXME (msarett): Reenable yasm on Android for x86 and x86_64
- # https://code.google.com/p/skia/issues/detail?id=4028
- [ 'skia_os == "android" and "x86" in skia_arch_type', {
- 'sources': [
- '../third_party/externals/libjpeg-turbo/jsimd_none.c',
- ],
+ # TODO (msarett): Is it possible to enable cross compiling for Android on other platforms?
+ [ 'skia_os == "android" and host_os != "linux" and "x86" in skia_arch_type', {
+ 'sources': [
+ '../third_party/externals/libjpeg-turbo/jsimd_none.c',
+ ],
}],
- [ 'skia_arch_type == "x86" and skia_os != "android"', {
+ [ 'skia_arch_type == "x86" and (skia_os != "android" or host_os == "linux")', {
'sources': [
'../third_party/externals/libjpeg-turbo/simd/jsimd_i386.c',
'../third_party/externals/libjpeg-turbo/simd/jccolor-mmx.asm',
'../third_party/externals/libjpeg-turbo/simd/jsimdcpu.asm',
],
}],
- [ 'skia_arch_type == "x86_64" and skia_os != "android"', {
+ [ 'skia_arch_type == "x86_64" and (skia_os != "android" or host_os == "linux")', {
'sources': [
'../third_party/externals/libjpeg-turbo/simd/jsimd_x86_64.c',
'../third_party/externals/libjpeg-turbo/simd/jccolor-sse2-64.asm',
],
},
}],
- [ 'skia_os == "android" and (skia_arch_type == "x86" or skia_arch_type == "x86_64")', {
+ [ 'skia_os == "android" and host_os == "linux" and \
+ (skia_arch_type == "x86" or skia_arch_type == "x86_64")', {
+ 'dependencies': [
+ 'yasm.gyp:yasm#host',
+ ],
'variables': {
- 'yasm_path': '../third_party/yasm/config/android/yasm',
+ 'yasm_path': '<(PRODUCT_DIR)/yasm',
'conditions': [
[ 'skia_arch_type == "x86"', {
'yasm_format': '-felf',
+# Copyright 2015 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
#!/bin/bash
#
# setup_toolchain.sh: Sets toolchain environment variables used by other scripts.
CCACHE=${ANDROID_MAKE_CCACHE-$(which ccache || true)}
-if [ -z $USE_CLANG ]; then
- exportVar CC "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
- exportVar CXX "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-g++"
- exportVar LINK "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
+# Cross compiling Android on Mac is not currently supported by gyp.
+# It doesn't appear to be supported on Windows either.
+# As of now, we will only support cross compiling on Linux.
+# libjpeg-turbo assembly code for x86 and x86-64 Android devices
+# must be disabled for Android on non-Linux platforms because
+# of this issue. We still support compiling on Mac and other
+# variants for local development, but shipping versions of Skia
+# should be compiled on Linux for performance reasons.
+# TODO (msarett): Collect more information about this.
+if [ $(uname) == "Linux" ]; then
+ if [ -z $USE_CLANG ]; then
+ exportVar CC_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
+ exportVar CXX_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-g++"
+ exportVar LINK_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
+ exportVar CC_host "$CCACHE cc"
+ exportVar CXX_host "$CCACHE c++"
+ exportVar LINK_host "$CCACHE cc"
+ else
+ # temporarily disable ccache as it is generating errors
+ CCACHE=""
+ exportVar CC_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
+ exportVar CXX_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang++"
+ exportVar LINK_target "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
+ exportVar CC_host "$CCACHE clang"
+ exportVar CXX_host "$CCACHE clang++"
+ exportVar LINK_host "$CCACHE clang"
+ fi
+
+ exportVar AR_target "$ANDROID_TOOLCHAIN_PREFIX-ar"
+ exportVar RANLIB_target "$ANDROID_TOOLCHAIN_PREFIX-ranlib"
+ exportVar OBJCOPY_target "$ANDROID_TOOLCHAIN_PREFIX-objcopy"
+ exportVar STRIP_target "$ANDROID_TOOLCHAIN_PREFIX-strip"
+ exportVar AR_host "ar"
+ exportVar RANLIB_host "ranlib"
+ exportVar OBJCOPY_host "objcopy"
+ exportVar STRIP_host "strip"
else
- # temporarily disable ccache as it is generating errors
- CCACHE=""
- exportVar CC "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
- exportVar CXX "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang++"
- exportVar LINK "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
-fi
+ if [ -z $USE_CLANG ]; then
+ exportVar CC "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
+ exportVar CXX "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-g++"
+ exportVar LINK "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-gcc"
+ else
+ # temporarily disable ccache as it is generating errors
+ CCACHE=""
+ exportVar CC "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
+ exportVar CXX "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang++"
+ exportVar LINK "$CCACHE $ANDROID_TOOLCHAIN_PREFIX-clang"
+ fi
-exportVar AR "$ANDROID_TOOLCHAIN_PREFIX-ar"
-exportVar RANLIB "$ANDROID_TOOLCHAIN_PREFIX-ranlib"
-exportVar OBJCOPY "$ANDROID_TOOLCHAIN_PREFIX-objcopy"
-exportVar STRIP "$ANDROID_TOOLCHAIN_PREFIX-strip"
+ exportVar AR "$ANDROID_TOOLCHAIN_PREFIX-ar"
+ exportVar RANLIB "$ANDROID_TOOLCHAIN_PREFIX-ranlib"
+ exportVar OBJCOPY "$ANDROID_TOOLCHAIN_PREFIX-objcopy"
+ exportVar STRIP "$ANDROID_TOOLCHAIN_PREFIX-strip"
+fi
# Create symlinks for nm & readelf and add them to the path so that the ninja
# build uses them instead of attempting to use the one on the system.