Switch NDK from r10e to r12b
This CL completely removes --android_compiler option since we now only
support Clang toolchain for Android target binaries. GCC toolchain
bundled in Android NDK is going to be deprecated shortly [1].
This Cl also adds following build targets on Travis-CI.
- Android (arm64)
- Android (x86)
- Android (x86_64)
- Android (mips)
- Android (mips64)
Closes #273.
[1]: https://android.googlesource.com/platform/ndk.git/+/fb83ea8bf716ef262ca9f03b2102ebcbb147b38a
BUG=#273
TEST=compile
REF_BUG=
REF_CL=131555947,133352265,134314373
REF_TIME=2016-08-28T22:29:30-07:00
REF_TIME_RAW=1472448570 -0700
Yohei Yukawa
7 years ago
38 | 38 | compiler: clang |
39 | 39 | |
40 | 40 | env: |
41 | - TARGET_PLATFORM=Android | |
41 | - TARGET_PLATFORM=Android_arm | |
42 | - TARGET_PLATFORM=Android_arm64 | |
43 | - TARGET_PLATFORM=Android_x86 | |
44 | - TARGET_PLATFORM=Android_x86_64 | |
45 | - TARGET_PLATFORM=Android_mips | |
46 | - TARGET_PLATFORM=Android_mips64 | |
42 | 47 | - TARGET_PLATFORM=Linux |
43 | 48 | - TARGET_PLATFORM=NaCl |
44 | 49 | - TARGET_PLATFORM=Mac |
48 | 53 | - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y clang python pkg-config curl bzip2 unzip make; fi |
49 | 54 | - if [ $TARGET_PLATFORM == Linux ]; then sudo apt-get install -y libibus-1.0-dev libglib2.0-dev libqt4-dev libgtk2.0-dev libxcb-xfixes0-dev; fi |
50 | 55 | - if [ $TARGET_PLATFORM == NaCl ]; then sudo apt-get install -y libc6-i386 lib32stdc++6; fi |
51 | - if [ $TARGET_PLATFORM == Android ]; then sudo apt-get install --no-install-recommends openjdk-7-jdk openjdk-7-jre-headless libjsr305-java ant zip libc6-i386 lib32stdc++6 lib32ncurses5 lib32z1; fi | |
56 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then sudo apt-get install --no-install-recommends openjdk-7-jdk openjdk-7-jre-headless libjsr305-java ant zip libc6-i386 lib32stdc++6 lib32ncurses5 lib32z1; fi | |
52 | 57 | |
53 | 58 | install: |
54 | 59 | - if [ $TRAVIS_OS_NAME == linux ]; then git -C src/third_party clone https://chromium.googlesource.com/chromium/tools/depot_tools.git; fi |
58 | 63 | - if [ $TARGET_PLATFORM == Mac ]; then git -C src/third_party clone https://chromium.googlesource.com/chromium/tools/depot_tools.git; fi |
59 | 64 | - if [ $TARGET_PLATFORM == Mac ]; then export PATH="$PATH":`pwd`/src/third_party/depot_tools; fi |
60 | 65 | - if [ $TARGET_PLATFORM == NaCl ]; then cd src/third_party && curl -LO http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip && unzip nacl_sdk.zip && rm nacl_sdk.zip && cd nacl_sdk && ./naclsdk install pepper_45 && cd ../../../; fi |
61 | - if [ $TARGET_PLATFORM == Android ]; then jdk_switcher use openjdk7; fi | |
62 | - if [ $TARGET_PLATFORM == Android ]; then cd src/third_party && curl -L http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin -O && chmod u+x android-ndk-r10e-linux-x86_64.bin && ./android-ndk-r10e-linux-x86_64.bin > /dev/null && rm android-ndk-r10e-linux-x86_64.bin && curl -L http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz | tar -zx && cd ../../; fi | |
63 | - if [ $TARGET_PLATFORM == Android ]; then export ANDROID_NDK_HOME=`pwd`/src/third_party/android-ndk-r10e ; fi | |
64 | - if [ $TARGET_PLATFORM == Android ]; then export ANDROID_HOME=`pwd`/src/third_party/android-sdk-linux ; fi | |
65 | - if [ $TARGET_PLATFORM == Android ]; then export PATH="$PATH":${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_NDK_HOME}; fi | |
66 | - if [ $TARGET_PLATFORM == Android ]; then echo y | android update sdk --all --force --no-ui --filter android-22; fi | |
67 | - if [ $TARGET_PLATFORM == Android ]; then echo y | android update sdk --all --force --no-ui --filter build-tools-22.0.0; fi | |
68 | - if [ $TARGET_PLATFORM == Android ]; then echo y | android update sdk --all --force --no-ui --filter extra-android-support; fi | |
69 | - if [ $TARGET_PLATFORM == Android ]; then echo y | android update sdk --all --force --no-ui --filter platform-tool; fi | |
66 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then jdk_switcher use openjdk7; fi | |
67 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then cd src/third_party && curl -LO http://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip && unzip -q android-ndk-r12b-linux-x86_64.zip && rm android-ndk-r12b-linux-x86_64.zip && curl -L http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz | tar -zx && cd ../../; fi | |
68 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then export ANDROID_NDK_HOME=`pwd`/src/third_party/android-ndk-r12b ; fi | |
69 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then export ANDROID_HOME=`pwd`/src/third_party/android-sdk-linux ; fi | |
70 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then export PATH="$PATH":${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_NDK_HOME}; fi | |
71 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then echo y | android update sdk --all --force --no-ui --filter android-22; fi | |
72 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then echo y | android update sdk --all --force --no-ui --filter build-tools-22.0.0; fi | |
73 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then echo y | android update sdk --all --force --no-ui --filter extra-android-support; fi | |
74 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then echo y | android update sdk --all --force --no-ui --filter platform-tool; fi | |
70 | 75 | |
71 | 76 | script: |
72 | 77 | - cd ./src |
73 | - if [ $TARGET_PLATFORM == Android ]; then python build_mozc.py gyp --target_platform=Android; fi | |
74 | - if [ $TARGET_PLATFORM == Android ]; then python build_mozc.py build -c Release package; fi | |
78 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then python build_mozc.py gyp --target_platform=Android --android_arch=${TARGET_PLATFORM:8:6}; fi | |
79 | - if [ ${TARGET_PLATFORM:0:7} == Android ]; then python build_mozc.py build -c Release package; fi | |
75 | 80 | - if [ $TARGET_PLATFORM == Linux ]; then python build_mozc.py gyp --target_platform=Linux; fi |
76 | 81 | - if [ $TARGET_PLATFORM == Linux ]; then python build_mozc.py build -c Release package; fi |
77 | 82 | - if [ $TARGET_PLATFORM == Linux ]; then python build_mozc.py runtests -c Release; fi |
86 | 91 | - os: linux |
87 | 92 | env: TARGET_PLATFORM=Mac |
88 | 93 | - os: osx |
89 | env: TARGET_PLATFORM=Android | |
94 | env: TARGET_PLATFORM=Android_arm | |
95 | - os: osx | |
96 | env: TARGET_PLATFORM=Android_arm64 | |
97 | - os: osx | |
98 | env: TARGET_PLATFORM=Android_x86 | |
99 | - os: osx | |
100 | env: TARGET_PLATFORM=Android_x86_64 | |
101 | - os: osx | |
102 | env: TARGET_PLATFORM=Android_mips | |
103 | - os: osx | |
104 | env: TARGET_PLATFORM=Android_mips64 | |
90 | 105 | - os: osx |
91 | 106 | env: TARGET_PLATFORM=Linux |
92 | 107 | - os: osx |
52 | 52 | WORKDIR /home/mozc_builder/work |
53 | 53 | |
54 | 54 | ## Android SDK/NDK |
55 | RUN curl -L http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin -O && chmod u+x android-ndk-r10e-linux-x86_64.bin && ./android-ndk-r10e-linux-x86_64.bin && rm android-ndk-r10e-linux-x86_64.bin | |
55 | RUN curl -LO http://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip && unzip android-ndk-r12b-linux-x86_64.zip && rm android-ndk-r12b-linux-x86_64.zip | |
56 | 56 | RUN curl -L http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz | tar -zx |
57 | ENV ANDROID_NDK_HOME /home/mozc_builder/work/android-ndk-r10e | |
57 | ENV ANDROID_NDK_HOME /home/mozc_builder/work/android-ndk-r12b | |
58 | 58 | ENV ANDROID_HOME /home/mozc_builder/work/android-sdk-linux |
59 | 59 | ENV PATH $PATH:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_NDK_HOME} |
60 | 60 | RUN echo y | android update sdk --all --force --no-ui --filter android-22 |
233 | 233 | 'type': 'none', |
234 | 234 | 'variables': { |
235 | 235 | 'make_standalone_toolchain_commands': [ |
236 | 'bash', | |
237 | '<(android_ndk_home)/build/tools/make-standalone-toolchain.sh', | |
238 | '--toolchain=<(toolchain)', | |
239 | '--stl=libcxx', | |
236 | 'python', | |
237 | '<(android_ndk_home)/build/tools/make_standalone_toolchain.py', | |
238 | '--force', | |
239 | '--arch=<(android_arch)', | |
240 | '--stl=libc++', | |
240 | 241 | '--install-dir=<(mozc_build_tools_dir)/ndk-standalone-toolchain/<(android_arch)', |
241 | '--platform=<(platform)', | |
242 | '--api=<(ndk_target_api_level)', | |
242 | 243 | ], |
243 | 244 | 'make_standalone_toolchain_result': '<!(<(make_standalone_toolchain_commands))', |
244 | 245 | }, |
82 | 82 | 'font_dir': '<(third_party_dir)/noto_font', |
83 | 83 | }, |
84 | 84 | }], |
85 | ['android_arch=="arm" and android_compiler=="gcc"', { | |
85 | ['android_arch=="arm"', { | |
86 | 86 | 'variables': { |
87 | 87 | 'abi': 'armeabi-v7a', |
88 | 'toolchain': 'arm-linux-androideabi-4.9', | |
89 | 'platform': 'android-14', | |
88 | 'ndk_target_api_level': '14', | |
90 | 89 | }, |
91 | 90 | }], |
92 | ['android_arch=="arm" and android_compiler=="clang"', { | |
91 | ['android_arch=="x86"', { | |
93 | 92 | 'variables': { |
94 | 'abi': 'armeabi-v7a', | |
95 | 'toolchain': 'arm-linux-androideabi-clang3.5', | |
96 | 'platform': 'android-14', | |
93 | 'abi': 'x86', | |
94 | 'ndk_target_api_level': '14', | |
97 | 95 | }, |
98 | 96 | }], |
99 | ['android_arch=="x86" and android_compiler=="gcc"', { | |
97 | ['android_arch=="mips"', { | |
100 | 98 | 'variables': { |
101 | 'abi': 'x86', | |
102 | 'toolchain': 'x86-4.9', | |
103 | 'platform': 'android-14', | |
99 | 'abi': 'mips', | |
100 | 'ndk_target_api_level': '14', | |
104 | 101 | }, |
105 | 102 | }], |
106 | ['android_arch=="x86" and android_compiler=="clang"', { | |
103 | ['android_arch=="arm64"', { | |
107 | 104 | 'variables': { |
108 | 'abi': 'x86', | |
109 | 'toolchain': 'x86-clang3.5', | |
110 | 'platform': 'android-14', | |
105 | 'abi': 'arm64-v8a', | |
106 | 'ndk_target_api_level': '21', | |
111 | 107 | }, |
112 | 108 | }], |
113 | ['android_arch=="mips" and android_compiler=="gcc"', { | |
109 | ['android_arch=="x86_64"', { | |
114 | 110 | 'variables': { |
115 | 'abi': 'mips', | |
116 | 'toolchain': 'mipsel-linux-android-4.9', | |
117 | 'platform': 'android-14', | |
111 | 'abi': 'x86_64', | |
112 | 'ndk_target_api_level': '21', | |
118 | 113 | }, |
119 | 114 | }], |
120 | ['android_arch=="mips" and android_compiler=="clang"', { | |
121 | 'variables': { | |
122 | 'abi': 'mips', | |
123 | 'toolchain': 'mipsel-linux-android-clang3.5', | |
124 | 'platform': 'android-14', | |
125 | }, | |
126 | }], | |
127 | ['android_arch=="arm64" and android_compiler=="gcc"', { | |
128 | 'variables': { | |
129 | 'abi': 'arm64-v8a', | |
130 | 'toolchain': 'aarch64-linux-android-4.9', | |
131 | 'platform': 'android-21', | |
132 | }, | |
133 | }], | |
134 | ['android_arch=="arm64" and android_compiler=="clang"', { | |
135 | 'variables': { | |
136 | 'abi': 'arm64-v8a', | |
137 | 'toolchain': 'aarch64-linux-android-clang3.5', | |
138 | 'platform': 'android-21', | |
139 | }, | |
140 | }], | |
141 | ['android_arch=="x86_64" and android_compiler=="gcc"', { | |
142 | 'variables': { | |
143 | 'abi': 'x86_64', | |
144 | 'toolchain': 'x86_64-4.9', | |
145 | 'platform': 'android-21', | |
146 | }, | |
147 | }], | |
148 | ['android_arch=="x86_64" and android_compiler=="clang"', { | |
149 | 'variables': { | |
150 | 'abi': 'x86_64', | |
151 | 'toolchain': 'x86_64-clang3.5', | |
152 | 'platform': 'android-21', | |
153 | }, | |
154 | }], | |
155 | ['android_arch=="mips64" and android_compiler=="gcc"', { | |
115 | ['android_arch=="mips64"', { | |
156 | 116 | 'variables': { |
157 | 117 | 'abi': 'mips64', |
158 | 'toolchain': 'mips64el-linux-android-4.9', | |
159 | 'platform': 'android-21', | |
160 | }, | |
161 | }], | |
162 | ['android_arch=="mips64" and android_compiler=="clang"', { | |
163 | 'variables': { | |
164 | 'abi': 'mips64', | |
165 | 'toolchain': 'mips64el-linux-android-4.9', | |
166 | 'platform': 'android-21', | |
118 | 'ndk_target_api_level': '21', | |
167 | 119 | }, |
168 | 120 | }], |
169 | 121 | ], |
296 | 296 | default='arm', |
297 | 297 | help='[Android build only] Android architecture ' |
298 | 298 | '(arm, x86, mips)') |
299 | parser.add_option('--android_compiler', dest='android_compiler', | |
300 | type='choice', | |
301 | choices=('gcc', 'clang'), | |
302 | default='gcc', | |
303 | help='[Android build only] Compiler') | |
304 | 299 | parser.add_option('--android_application_id', dest='android_application_id', |
305 | 300 | default='org.mozc.android.inputmethod.japanese', |
306 | 301 | help='[Android build only] Android\'s application id' |
641 | 636 | |
642 | 637 | gyp_options.extend(['-D', 'android_home=%s' % android_home]) |
643 | 638 | gyp_options.extend(['-D', 'android_arch=%s' % options.android_arch]) |
644 | gyp_options.extend(['-D', 'android_compiler=%s' % options.android_compiler]) | |
645 | 639 | gyp_options.extend(['-D', 'android_ndk_home=%s' % android_ndk_home]) |
646 | 640 | gyp_options.extend(['-D', 'android_application_id=%s' % |
647 | 641 | options.android_application_id]) |
29 | 29 | |
30 | 30 | MAJOR=2 |
31 | 31 | MINOR=18 |
32 | BUILD=2598 | |
32 | BUILD=2599 | |
33 | 33 | REVISION=102 |
34 | 34 | # This version represents the version of Mozc IME engine (converter, predictor, |
35 | 35 | # etc.). This version info is included both in the Mozc server and in the Mozc |
114 | 114 | 'compiler_host': 'clang', |
115 | 115 | 'compiler_host_version_int': 303, # Clang 3.3 or higher |
116 | 116 | }], |
117 | ['target_platform=="Android" and android_compiler=="clang"', { | |
117 | ['target_platform=="Android"', { | |
118 | 118 | 'compiler_target': 'clang', |
119 | 'compiler_target_version_int': 305, # Clang 3.5 or higher | |
120 | 'compiler_host': 'clang', | |
121 | 'compiler_host_version_int': 304, # Clang 3.4 or higher | |
122 | }], | |
123 | ['target_platform=="Android" and android_compiler=="gcc"', { | |
124 | 'compiler_target': 'gcc', | |
125 | 'compiler_target_version_int': 409, # GCC 4.9 or higher | |
119 | 'compiler_target_version_int': 308, # Clang 3.8 or higher | |
126 | 120 | 'compiler_host': 'clang', |
127 | 121 | 'compiler_host_version_int': 304, # Clang 3.4 or higher |
128 | 122 | }], |
311 | 305 | ], |
312 | 306 | 'ldflags': [ |
313 | 307 | '-llog', |
308 | '-static-libstdc++', | |
314 | 309 | ], |
315 | 310 | 'conditions': [ |
316 | 311 | ['android_arch=="arm"', { |
493 | 488 | 'toolchain_prefix': 'mips64el-linux-android', |
494 | 489 | }, |
495 | 490 | }], |
496 | ['android_compiler=="gcc"', { | |
497 | 'variables': { | |
498 | 'c_compiler': 'gcc', | |
499 | 'cxx_compiler': 'g++', | |
500 | } | |
501 | }], | |
502 | ['android_compiler=="clang"', { | |
503 | 'variables': { | |
504 | 'c_compiler': 'clang', | |
505 | 'cxx_compiler': 'clang++', | |
506 | } | |
507 | }], | |
508 | 491 | ], |
509 | 492 | # To use clang only CC and CXX should point clang directly. |
510 | 493 | # c.f., https://android.googlesource.com/platform/ndk/+/tools_ndk_r9d/docs/text/STANDALONE-TOOLCHAIN.text |
511 | 494 | 'make_global_settings': [ |
512 | 495 | ['AR', '<(ndk_bin_dir)/<(toolchain_prefix)-ar'], |
513 | ['CC', '<(ndk_bin_dir)/<(toolchain_prefix)-<(c_compiler)'], | |
514 | ['CXX', '<(ndk_bin_dir)/<(toolchain_prefix)-<(cxx_compiler)'], | |
496 | ['CC', '<(ndk_bin_dir)/<(toolchain_prefix)-clang'], | |
497 | ['CXX', '<(ndk_bin_dir)/<(toolchain_prefix)-clang++'], | |
515 | 498 | ['LD', '<(ndk_bin_dir)/<(toolchain_prefix)-ld'], |
516 | 499 | ['NM', '<(ndk_bin_dir)/<(toolchain_prefix)-nm'], |
517 | 500 | ['READELF', '<(ndk_bin_dir)/<(toolchain_prefix)-readelf'], |