OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # IMPORTANT: | 5 # IMPORTANT: |
6 # Please don't directly include this file if you are building via gyp_chromium, | 6 # Please don't directly include this file if you are building via gyp_chromium, |
7 # since gyp_chromium is automatically forcing its inclusion. | 7 # since gyp_chromium is automatically forcing its inclusion. |
8 { | 8 { |
9 # Variables expected to be overriden on the GYP command line (-D) or by | 9 # Variables expected to be overriden on the GYP command line (-D) or by |
10 # ~/.gyp/include.gypi. | 10 # ~/.gyp/include.gypi. |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 'android_app_abi%': 'armeabi-v7a', | 903 'android_app_abi%': 'armeabi-v7a', |
904 }], | 904 }], |
905 ], | 905 ], |
906 | 906 |
907 # Sets whether we're building with the Android SDK/NDK (and hence | 907 # Sets whether we're building with the Android SDK/NDK (and hence |
908 # with Ant, value 0), or as part of the Android system (and hence | 908 # with Ant, value 0), or as part of the Android system (and hence |
909 # with the Android build system, value 1). | 909 # with the Android build system, value 1). |
910 'android_build_type%': 0, | 910 'android_build_type%': 0, |
911 }, | 911 }, |
912 'android_ndk_root%': '<(android_ndk_root)', | 912 'android_ndk_root%': '<(android_ndk_root)', |
913 'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-9/arch-
<(target_arch)', | 913 'android_ndk_sysroot': '<(android_ndk_root)/platforms/android-9/arch-<
(target_arch)', |
914 'android_build_type%': '<(android_build_type)', | 914 'android_build_type%': '<(android_build_type)', |
915 'android_app_abi%': '<(android_app_abi)', | 915 'android_app_abi%': '<(android_app_abi)', |
916 }, | 916 }, |
917 'android_ndk_root%': '<(android_ndk_root)', | 917 'android_ndk_root%': '<(android_ndk_root)', |
918 'android_ndk_sysroot': '<(android_ndk_sysroot)', | 918 'android_ndk_sysroot': '<(android_ndk_sysroot)', |
919 'android_ndk_include': '<(android_ndk_sysroot)/usr/include', | 919 'android_ndk_include': '<(android_ndk_sysroot)/usr/include', |
920 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib', | 920 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib', |
921 'android_app_abi%': '<(android_app_abi)', | 921 'android_app_abi%': '<(android_app_abi)', |
922 | 922 |
923 # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used | 923 # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 'use_libffmpeg%': '0', | 969 'use_libffmpeg%': '0', |
970 | 970 |
971 # Always use the chromium skia. The use_system_harfbuzz needs to | 971 # Always use the chromium skia. The use_system_harfbuzz needs to |
972 # match use_system_skia. | 972 # match use_system_skia. |
973 'use_system_skia%': '0', | 973 'use_system_skia%': '0', |
974 'use_system_harfbuzz%': '0', | 974 'use_system_harfbuzz%': '0', |
975 | 975 |
976 # Always use the system zlib. | 976 # Always use the system zlib. |
977 'use_system_zlib%': 1, | 977 'use_system_zlib%': 1, |
978 | 978 |
979 # Configure crash reporting and build options based on release type. | |
980 'conditions': [ | 979 'conditions': [ |
| 980 # Determine whether or not to use breakpad crash reporting for native |
| 981 # code. Java code stacktraces will be collected by GoogleFeedback when |
| 982 # chrome is installed by either market or bazaar where the installer |
| 983 # package is automatically set to AndroidFeedback. |
981 ['buildtype=="Official"', { | 984 ['buildtype=="Official"', { |
982 # Only report crash dumps for Official builds. | |
983 'linux_breakpad%': 1, | 985 'linux_breakpad%': 1, |
984 }, { | 986 }, { |
985 'linux_breakpad%': 0, | 987 'linux_breakpad%': 0, |
986 }], | 988 }], |
987 ], | 989 ], |
988 | 990 |
989 # When building as part of the Android system, use system libraries | 991 # When building as part of the Android system, use system libraries |
990 # where possible to reduce ROM size. | 992 # where possible to reduce ROM size. |
991 # TODO(steveblock): Investigate using the system version of sqlite. | 993 # TODO(steveblock): Investigate using the system version of sqlite. |
992 'use_system_sqlite%': 0, # '<(android_build_type)', | 994 'use_system_sqlite%': 0, # '<(android_build_type)', |
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2189 'conditions': [ | 2191 'conditions': [ |
2190 ['arm_thumb==1', { | 2192 ['arm_thumb==1', { |
2191 'cflags': [ | 2193 'cflags': [ |
2192 '-mthumb', | 2194 '-mthumb', |
2193 ] | 2195 ] |
2194 }], | 2196 }], |
2195 ['armv7==1', { | 2197 ['armv7==1', { |
2196 'cflags': [ | 2198 'cflags': [ |
2197 '-march=armv7-a', | 2199 '-march=armv7-a', |
2198 '-mtune=cortex-a8', | 2200 '-mtune=cortex-a8', |
| 2201 '-mfloat-abi=<(arm_float_abi)', |
2199 ], | 2202 ], |
2200 'conditions': [ | 2203 'conditions': [ |
2201 ['arm_neon==1', { | 2204 ['arm_neon==1', { |
2202 'cflags': [ '-mfpu=neon', ], | 2205 'cflags': [ '-mfpu=neon', ], |
2203 }, { | 2206 }, { |
2204 'cflags': [ '-mfpu=<(arm_fpu)', ], | 2207 'cflags': [ '-mfpu=<(arm_fpu)', ], |
2205 }], | |
2206 ['clang==1', { | |
2207 'cflags': [ '-mfloat-abi=soft', ], | |
2208 'cflags!': [ | |
2209 # -mfpu handling in Clang is broken. | |
2210 '-mfpu=neon', | |
2211 '-mfpu=<(arm_fpu)', | |
2212 # Clang does not support the following options. | |
2213 '-mthumb-interwork', | |
2214 '-finline-limit=64', | |
2215 '-fno-tree-sra', | |
2216 '-Wno-psabi', | |
2217 ], | |
2218 }, { | |
2219 'cflags': [ '-mfloat-abi=softfp', ], | |
2220 }] | 2208 }] |
2221 ], | 2209 ], |
2222 }], | 2210 }], |
2223 ['OS=="android"', { | 2211 ['OS=="android"', { |
2224 # Most of the following flags are derived from what Android | 2212 # Most of the following flags are derived from what Android |
2225 # uses by default when building for arm, reference for which | 2213 # uses by default when building for arm, reference for which |
2226 # can be found in the following file in the Android NDK: | 2214 # can be found in the following file in the Android NDK: |
2227 # toolchains/arm-linux-androideabi-4.4.3/setup.mk | 2215 # toolchains/arm-linux-androideabi-4.4.3/setup.mk |
2228 'cflags': [ | 2216 'cflags': [ |
2229 # The tree-sra optimization (scalar replacement for | 2217 # The tree-sra optimization (scalar replacement for |
2230 # aggregates enabling subsequent optimizations) leads to | 2218 # aggregates enabling subsequent optimizations) leads to |
2231 # invalid code generation when using the Android NDK's | 2219 # invalid code generation when using the Android NDK's |
2232 # compiler (r5-r7). This can be verified using | 2220 # compiler (r5-r7). This can be verified using |
2233 # TestWebKitAPI's WTF.Checked_int8_t test. | 2221 # TestWebKitAPI's WTF.Checked_int8_t test. |
2234 '-fno-tree-sra', | 2222 '-fno-tree-sra', |
2235 '-Wno-psabi', | 2223 '-Wno-psabi', |
2236 ], | 2224 ], |
2237 'cflags_cc': [ | |
2238 # TODO(beverloo): WebKit warns about using the "nullptr" | |
2239 # identifier in NullPtr.h, which actually is valid usage. | |
2240 # We should remove this flag once we know why the warning | |
2241 # suddenly shows up on JellyBean. (crbug/138166) | |
2242 '-Wno-c++0x-compat', | |
2243 ], | |
2244 # Android now supports .relro sections properly. | 2225 # Android now supports .relro sections properly. |
2245 # NOTE: While these flags enable the generation of .relro | 2226 # NOTE: While these flags enable the generation of .relro |
2246 # sections, the generated libraries can still be loaded on | 2227 # sections, the generated libraries can still be loaded on |
2247 # older Android platform versions. | 2228 # older Android platform versions. |
2248 'ldflags': [ | 2229 'ldflags': [ |
2249 '-Wl,-z,relro', | 2230 '-Wl,-z,relro', |
2250 '-Wl,-z,now', | 2231 '-Wl,-z,now', |
2251 ], | 2232 ], |
2252 'conditions': [ | 2233 'conditions': [ |
2253 ['arm_thumb == 1', { | 2234 ['arm_thumb == 1', { |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2535 # libgcc.a to the start of libraries which puts it in the | 2516 # libgcc.a to the start of libraries which puts it in the |
2536 # proper spot after .o and .a files get linked in. | 2517 # proper spot after .o and .a files get linked in. |
2537 # | 2518 # |
2538 # TODO: The proper thing to do longer-tem would be proper gyp | 2519 # TODO: The proper thing to do longer-tem would be proper gyp |
2539 # support for a custom link command line. | 2520 # support for a custom link command line. |
2540 ['_toolset=="target"', { | 2521 ['_toolset=="target"', { |
2541 'cflags!': [ | 2522 'cflags!': [ |
2542 '-pthread', # Not supported by Android toolchain. | 2523 '-pthread', # Not supported by Android toolchain. |
2543 ], | 2524 ], |
2544 'cflags': [ | 2525 'cflags': [ |
| 2526 '-U__linux__', # Don't allow toolchain to claim -D__linux__ |
2545 '-ffunction-sections', | 2527 '-ffunction-sections', |
2546 '-funwind-tables', | 2528 '-funwind-tables', |
2547 '-g', | 2529 '-g', |
2548 '-fstack-protector', | 2530 '-fstack-protector', |
2549 '-fno-short-enums', | 2531 '-fno-short-enums', |
2550 '-finline-limit=64', | 2532 '-finline-limit=64', |
2551 '-Wa,--noexecstack', | 2533 '-Wa,--noexecstack', |
| 2534 '-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings. |
2552 '<@(release_extra_cflags)', | 2535 '<@(release_extra_cflags)', |
| 2536 # Note: This include is in cflags to ensure that it comes after |
| 2537 # all of the includes. |
| 2538 '-I<(android_ndk_include)', |
2553 ], | 2539 ], |
2554 'defines': [ | 2540 'defines': [ |
2555 'ANDROID', | 2541 'ANDROID', |
2556 '__GNU_SOURCE=1', # Necessary for clone() | 2542 '__GNU_SOURCE=1', # Necessary for clone() |
2557 'USE_STLPORT=1', | 2543 'USE_STLPORT=1', |
2558 '_STLP_USE_PTR_SPECIALIZATIONS=1', | 2544 '_STLP_USE_PTR_SPECIALIZATIONS=1', |
| 2545 'HAVE_SYS_UIO_H', |
| 2546 'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize
. |
2559 ], | 2547 ], |
2560 'ldflags!': [ | 2548 'ldflags!': [ |
2561 '-pthread', # Not supported by Android toolchain. | 2549 '-pthread', # Not supported by Android toolchain. |
2562 ], | 2550 ], |
2563 'ldflags': [ | 2551 'ldflags': [ |
2564 '-nostdlib', | 2552 '-nostdlib', |
2565 '-Wl,--no-undefined', | 2553 '-Wl,--no-undefined', |
2566 # Don't export symbols from statically linked libraries. | 2554 # Don't export symbols from statically linked libraries. |
2567 '-Wl,--exclude-libs=ALL', | 2555 '-Wl,--exclude-libs=ALL', |
2568 ], | 2556 ], |
2569 'libraries': [ | 2557 'libraries': [ |
2570 '-l<(android_stlport_library)', | 2558 '-l<(android_stlport_library)', |
2571 # Manually link the libgcc.a that the cross compiler uses. | 2559 # Manually link the libgcc.a that the cross compiler uses. |
2572 '<!(${ANDROID_TOOLCHAIN}/*-gcc -print-libgcc-file-name)', | 2560 '<!(${ANDROID_TOOLCHAIN}/*-gcc -print-libgcc-file-name)', |
2573 '-lc', | 2561 '-lc', |
2574 '-ldl', | 2562 '-ldl', |
2575 '-lstdc++', | 2563 '-lstdc++', |
2576 '-lm', | 2564 '-lm', |
2577 ], | 2565 ], |
2578 'conditions': [ | 2566 'conditions': [ |
2579 ['android_upstream_bringup==1', { | 2567 ['android_upstream_bringup==1', { |
2580 'defines': ['ANDROID_UPSTREAM_BRINGUP=1',], | 2568 'defines': ['ANDROID_UPSTREAM_BRINGUP=1',], |
2581 }], | 2569 }], |
2582 ['asan==1', { | |
2583 'ldflags!': [ | |
2584 # On Android, we link ASan runtime explicitly and | |
2585 # don't need -faddress-sanitizer in link flags. | |
2586 '-faddress-sanitizer', | |
2587 ], | |
2588 'libraries': [ | |
2589 '<(android_lib)/libasan_preload.so', | |
2590 ], | |
2591 'cflags': [ | |
2592 # Clang relies on -Wl,--gc-sections removing unreachable code. | |
2593 # ASan instrumentation for globals inhibits this and results | |
2594 # in a library with unresolvable relocations. | |
2595 # TODO(eugenis): find a way to reenable this. | |
2596 '-mllvm -asan-globals=0', | |
2597 # Asan uses a zero-based sandbox on Android. The following | |
2598 # option can be removed once Clang is updated past r157318 | |
2599 '-mllvm -asan-mapping-offset-log=0', | |
2600 ], | |
2601 }], | |
2602 ['android_build_type==0', { | 2570 ['android_build_type==0', { |
2603 'defines': [ | 2571 'defines': [ |
2604 # The NDK has these things, but doesn't define the constants | 2572 'HAVE_OFF64_T', |
2605 # to say that it does. Define them here instead. | |
2606 'HAVE_SYS_UIO_H', | |
2607 ], | |
2608 'cflags': [ | |
2609 '--sysroot=<(android_ndk_sysroot)', | |
2610 ], | 2573 ], |
2611 'ldflags': [ | 2574 'ldflags': [ |
2612 '--sysroot=<(android_ndk_sysroot)', | 2575 '--sysroot=<(android_ndk_sysroot)', |
2613 ], | 2576 ], |
2614 }], | 2577 }], |
2615 ['target_arch == "arm"', { | 2578 ['target_arch == "arm"', { |
2616 'ldflags': [ | 2579 'ldflags': [ |
2617 # Enable identical code folding to reduce size. | 2580 # Enable identical code folding to reduce size. |
2618 '-Wl,--icf=safe', | 2581 '-Wl,--icf=safe', |
2619 ], | 2582 ], |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2670 '-Wl,--gc-sections', | 2633 '-Wl,--gc-sections', |
2671 '-Wl,-z,nocopyreloc', | 2634 '-Wl,-z,nocopyreloc', |
2672 # crtbegin_dynamic.o should be the last item in ldflags. | 2635 # crtbegin_dynamic.o should be the last item in ldflags. |
2673 '<(android_ndk_lib)/crtbegin_dynamic.o', | 2636 '<(android_ndk_lib)/crtbegin_dynamic.o', |
2674 ], | 2637 ], |
2675 'libraries': [ | 2638 'libraries': [ |
2676 # crtend_android.o needs to be the last item in libraries. | 2639 # crtend_android.o needs to be the last item in libraries. |
2677 # Do not add any libraries after this! | 2640 # Do not add any libraries after this! |
2678 '<(android_ndk_lib)/crtend_android.o', | 2641 '<(android_ndk_lib)/crtend_android.o', |
2679 ], | 2642 ], |
2680 'conditions': [ | |
2681 ['asan==1', { | |
2682 'libraries': [ | |
2683 '<(android_static_lib)/libasan_intermediates/libasan.a', | |
2684 ], | |
2685 'cflags': [ | |
2686 '-fPIE', | |
2687 ], | |
2688 'ldflags': [ | |
2689 '-Wl,-u,__asan_preinit', | |
2690 '-pie', | |
2691 ], | |
2692 }], | |
2693 ], | |
2694 }], | 2643 }], |
2695 ['_type=="shared_library" or _type=="loadable_module"', { | 2644 ['_type=="shared_library"', { |
2696 'ldflags': [ | 2645 'ldflags': [ |
2697 '-Wl,-shared,-Bsymbolic', | 2646 '-Wl,-shared,-Bsymbolic', |
2698 # crtbegin_so.o should be the last item in ldflags. | 2647 # crtbegin_so.o should be the last item in ldflags. |
2699 '<(android_ndk_lib)/crtbegin_so.o', | 2648 '<(android_ndk_lib)/crtbegin_so.o', |
2700 ], | 2649 ], |
2701 'libraries': [ | 2650 'libraries': [ |
2702 # crtend_so.o needs to be the last item in libraries. | 2651 # crtend_so.o needs to be the last item in libraries. |
2703 # Do not add any libraries after this! | 2652 # Do not add any libraries after this! |
2704 '<(android_ndk_lib)/crtend_so.o', | 2653 '<(android_ndk_lib)/crtend_so.o', |
2705 ], | 2654 ], |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3320 ['CXX', '<(make_clang_dir)/bin/clang++'], | 3269 ['CXX', '<(make_clang_dir)/bin/clang++'], |
3321 ['LINK', '$(CXX)'], | 3270 ['LINK', '$(CXX)'], |
3322 ['CC.host', '$(CC)'], | 3271 ['CC.host', '$(CC)'], |
3323 ['CXX.host', '$(CXX)'], | 3272 ['CXX.host', '$(CXX)'], |
3324 ['LINK.host', '$(LINK)'], | 3273 ['LINK.host', '$(LINK)'], |
3325 ], | 3274 ], |
3326 }], | 3275 }], |
3327 ['OS=="android" and "<(GENERATOR)"!="ninja"', { | 3276 ['OS=="android" and "<(GENERATOR)"!="ninja"', { |
3328 # Hardcode the compiler names in the Makefile so that | 3277 # Hardcode the compiler names in the Makefile so that |
3329 # it won't depend on the environment at make time. | 3278 # it won't depend on the environment at make time. |
3330 'conditions': [ | 3279 'make_global_settings': [ |
3331 ['clang==1', { | 3280 ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-g
cc)'], |
3332 'make_global_settings': [ | 3281 ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*-
g++)'], |
3333 ['CC', '<!(/bin/echo -n $CROSS_CC)'], | 3282 ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}/*
-gcc)'], |
3334 ['CXX', '<!(/bin/echo -n $CROSS_CXX)'], | 3283 ['CC.host', '<!(which gcc)'], |
3335 ['LINK', '<!(/bin/echo -n $CROSS_LINK)'], | 3284 ['CXX.host', '<!(which g++)'], |
3336 ['CC.host', '<!(/bin/echo -n $HOST_CC)'], | 3285 ['LINK.host', '<!(which g++)'], |
3337 ['CXX.host', '<!(/bin/echo -n $HOST_CXX)'], | |
3338 ['LINK.host', '<!(/bin/echo -n $HOST_LINK)'], | |
3339 ], | |
3340 }, { | |
3341 'make_global_settings': [ | |
3342 ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN}
/*-gcc)'], | |
3343 ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAIN
}/*-g++)'], | |
3344 ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${ANDROID_TOOLCHAI
N}/*-gcc)'], | |
3345 ['CC.host', '<!(which gcc)'], | |
3346 ['CXX.host', '<!(which g++)'], | |
3347 ['LINK.host', '<!(which g++)'], | |
3348 ], | |
3349 }, | |
3350 ], | |
3351 ], | 3286 ], |
3352 }], | 3287 }], |
3353 ], | 3288 ], |
3354 'xcode_settings': { | 3289 'xcode_settings': { |
3355 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! | 3290 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! |
3356 # This block adds *project-wide* configuration settings to each project | 3291 # This block adds *project-wide* configuration settings to each project |
3357 # file. It's almost always wrong to put things here. Specify your | 3292 # file. It's almost always wrong to put things here. Specify your |
3358 # custom xcode_settings in target_defaults to add them to targets instead. | 3293 # custom xcode_settings in target_defaults to add them to targets instead. |
3359 | 3294 |
3360 'conditions': [ | 3295 'conditions': [ |
(...skipping 21 matching lines...) Expand all Loading... |
3382 # settings in target dicts. SYMROOT is a special case, because many other | 3317 # settings in target dicts. SYMROOT is a special case, because many other |
3383 # Xcode variables depend on it, including variables such as | 3318 # Xcode variables depend on it, including variables such as |
3384 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something | 3319 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something |
3385 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the | 3320 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the |
3386 # files to appear (when present) in the UI as actual files and not red | 3321 # files to appear (when present) in the UI as actual files and not red |
3387 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, | 3322 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, |
3388 # and therefore SYMROOT, needs to be set at the project level. | 3323 # and therefore SYMROOT, needs to be set at the project level. |
3389 'SYMROOT': '<(DEPTH)/xcodebuild', | 3324 'SYMROOT': '<(DEPTH)/xcodebuild', |
3390 }, | 3325 }, |
3391 } | 3326 } |
OLD | NEW |