Browse files

This patch is to enable x86 android build.

patch includes two parts:
1. gyp files modification to include x86 android build.
2. add android config files for yasm which is copied from linux ones. enable android x86 build

This patch is cloned from the issue #10198027 for ownership issue. 
https://chromiumcodereview.appspot.com/10198027/

BUG=125160
TEST=


Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=135087

Review URL: http://codereview.chromium.org/10271039

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135110 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information...
1 parent 5752d8f commit c369bfb6d9cbc38d7ed0996c919e0a73593f4fd6 james.wei@intel.com committed May 3, 2012
View
7 base/base.gypi
@@ -686,6 +686,13 @@
],
}],
[ 'OS == "android" and _toolset == "target"', {
+ 'conditions': [
+ ['target_arch == "ia32"', {
+ 'sources/': [
+ ['include', '^atomicops_internals_x86_gcc\\.cc$'],
+ ],
+ }],
+ ],
'dependencies': [
'symbolize',
'../third_party/ashmem/ashmem.gyp:ashmem',
View
42 build/android/envsetup.sh
@@ -45,7 +45,25 @@ case "${host_os}" in
return 1
esac
-export ANDROID_TOOLCHAIN="${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/${toolchain_dir}/bin/"
+# The following defines will affect ARM code generation of both C/C++ compiler
+# and V8 mksnapshot.
+case "${TARGET_PRODUCT-full}" in
+ "full")
+ DEFINES=" target_arch=arm"
+ DEFINES+=" arm_neon=0 armv7=1 arm_thumb=1 arm_fpu=vfpv3-d16"
+ toolchain_arch="arm-linux-androideabi-4.4.3"
+ ;;
+ *x86*)
+ DEFINES=" target_arch=ia32 use_libffmpeg=0"
+ toolchain_arch="x86-4.4.3"
+ ;;
+ *)
+ echo "TARGET_PRODUCT: ${TARGET_PRODUCT} is not supported." >& 2
+ return 1
+esac
+
+toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}/prebuilt/"
+export ANDROID_TOOLCHAIN="${toolchain_path}/${toolchain_dir}/bin/"
export ANDROID_SDK_VERSION="15"
@@ -97,7 +115,7 @@ export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip)
# The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories
# to canonicalize them (remove double '/', remove trailing '/', etc).
-DEFINES="OS=android"
+DEFINES+=" OS=android"
DEFINES+=" android_build_type=0" # Currently, Only '0' is supportted.
DEFINES+=" host_os=${host_os}"
DEFINES+=" linux_fpic=1"
@@ -113,26 +131,6 @@ DEFINES+=" build_ffmpegsumo=0"
DEFINES+=" gtest_target_type=executable"
DEFINES+=" branding=Chromium"
-# If the TARGET_PRODUCT wasn't set, use 'full' by default.
-if [ -z "${TARGET_PRODUCT}" ]; then
- TARGET_PRODUCT="full"
-fi
-
-# The following defines will affect ARM code generation of both C/C++ compiler
-# and V8 mksnapshot.
-case "${TARGET_PRODUCT}" in
- "full")
- DEFINES+=" target_arch=arm"
- DEFINES+=" arm_neon=0 armv7=1 arm_thumb=1 arm_fpu=vfpv3-d16"
- ;;
- *x86*)
- DEFINES+=" target_arch=ia32 use_libffmpeg=0"
- ;;
- *)
- echo "TARGET_PRODUCT: ${TARGET_PRODUCT} is not supported." >& 2
- return 1
-esac
-
export GYP_DEFINES="${DEFINES}"
# Use the "android" flavor of the Makefile generator for both Linux and OS X.
View
20 build/common.gypi
@@ -823,7 +823,16 @@
'variables': {
'variables': {
'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)',
- 'target_arch%': 'arm', # target_arch in android terms.
+ # Android uses x86 instead of ia32 for their target_arch
+ # designation.
+ # TODO(wistoch): Adjust the target_arch naming scheme to avoid
+ # confusion.
+ # http://crbug.com/125329
+ 'conditions': [
+ ['target_arch == "ia32"', {
+ 'target_arch': 'x86',
+ }],
+ ],
# Switch between different build types, currently only '0' is
# supported.
@@ -978,7 +987,7 @@
],
}],
- ['os_posix==1 and chromeos==0 and target_arch!="arm"', {
+ ['os_posix==1 and chromeos==0 and OS!="android"', {
'use_cups%': 1,
}, {
'use_cups%': 0,
@@ -2381,7 +2390,6 @@
'ldflags': [
'-nostdlib',
'-Wl,--no-undefined',
- '-Wl,--icf=safe', # Enable identical code folding to reduce size
# Don't export symbols from statically linked libraries.
'-Wl,--exclude-libs=ALL',
],
@@ -2400,6 +2408,12 @@
'--sysroot=<(android_ndk_sysroot)',
],
}],
+ ['target_arch == "arm"', {
+ 'ldflags': [
+ # Enable identical code folding to reduce size.
+ '-Wl,--icf=safe',
+ ],
+ }],
# NOTE: The stlport header include paths below are specified in
# cflags rather than include_dirs because they need to come
# after include_dirs. Think of them like system headers, but
View
9 skia/skia.gyp
@@ -1099,8 +1099,13 @@
'../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp',
'../third_party/skia/src/opts/SkUtils_opts_SSE2.cpp',
],
- 'dependencies': [
- 'skia_opts_ssse3',
+ 'conditions': [
+ # x86 Android doesn't support SSSE3 instructions.
+ [ 'OS != "android"', {
+ 'dependencies': [
+ 'skia_opts_ssse3',
+ ],
+ }],
],
},
{ # arm
View
3 third_party/yasm/README.chromium
@@ -32,7 +32,8 @@ Instructions for recreating the yasm.gyp file.
compiler warnings.
5) Grab the generated Makefile, libyasm-stdint.h, config.h, and put into
- the correct platform location.
+ the correct platform location. For android platform, copy the files
+ generated for linux.
src/third_party/yasm/source/config/[platform]
View
3,822 third_party/yasm/source/config/android/Makefile
3,822 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
176 third_party/yasm/source/config/android/config.h
@@ -0,0 +1,176 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Command name to run C preprocessor */
+#define CPP_PROG "gcc -E"
+
+/* */
+#define ENABLE_NLS 1
+
+/* Define to 1 if you have the `abort' function. */
+#define HAVE_ABORT 1
+
+/* */
+/* #undef HAVE_CATGETS */
+
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#define HAVE_DCGETTEXT 1
+
+/* Define to 1 if you have the <direct.h> header file. */
+/* #undef HAVE_DIRECT_H */
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* */
+#define HAVE_GETTEXT 1
+
+/* Define to 1 if you have the GNU C Library */
+#define HAVE_GNU_C_LIBRARY 1
+
+/* Define if you have the iconv() function. */
+/* #undef HAVE_ICONV */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* */
+/* #undef HAVE_LC_MESSAGES */
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#define HAVE_LIBGEN_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mergesort' function. */
+/* #undef HAVE_MERGESORT */
+
+/* Define to 1 if you have the `popen' function. */
+#define HAVE_POPEN 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* */
+/* #undef HAVE_STPCPY */
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the `strcmpi' function. */
+/* #undef HAVE_STRCMPI */
+
+/* Define to 1 if you have the `stricmp' function. */
+/* #undef HAVE_STRICMP */
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define to 1 if you have the `strsep' function. */
+#define HAVE_STRSEP 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the `toascii' function. */
+#define HAVE_TOASCII 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `_stricmp' function. */
+/* #undef HAVE__STRICMP */
+
+/* Name of package */
+#define PACKAGE "yasm"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "bug-yasm@tortall.net"
+
+/* Define to build version of this package. */
+#define PACKAGE_BUILD "HEAD"
+
+/* Define to internal version of this package. */
+#define PACKAGE_INTVER "0.7.99"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "yasm"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "yasm HEAD"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "yasm"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "HEAD"
+
+/* Define to 1 if the C compiler supports function prototypes. */
+#define PROTOTYPES 1
+
+/* The size of `char', as computed by sizeof. */
+/* #undef SIZEOF_CHAR */
+
+/* The size of `int', as computed by sizeof. */
+/* #undef SIZEOF_INT */
+
+/* The size of `long', as computed by sizeof. */
+/* #undef SIZEOF_LONG */
+
+/* The size of `short', as computed by sizeof. */
+/* #undef SIZEOF_SHORT */
+
+/* The size of `void*', as computed by sizeof. */
+/* #undef SIZEOF_VOIDP */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "HEAD"
+
+/* Define if using the dmalloc debugging malloc package */
+/* #undef WITH_DMALLOC */
+
+/* Define like PROTOTYPES; this can be used by system headers. */
+#define __PROTOTYPES 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
View
9 third_party/yasm/source/config/android/libyasm-stdint.h
@@ -0,0 +1,9 @@
+#ifndef _YASM_LIBYASM_STDINT_H
+#define _YASM_LIBYASM_STDINT_H 1
+#ifndef _GENERATED_STDINT_H
+#define _GENERATED_STDINT_H "yasm HEAD"
+/* generated using gcc -std=gnu99 */
+#define _STDINT_HAVE_STDINT_H 1
+#include <stdint.h>
+#endif
+#endif

0 comments on commit c369bfb

Please sign in to comment.