mrubyを超漢字で動作させる
Revisão | ae926e08026f31666b384337ba33898f67bfa4a7 (tree) |
---|---|
Hora | 2015-10-12 20:44:40 |
Autor | Yukihiro "Matz" Matsumoto <matz@ruby...> |
Commiter | Yukihiro "Matz" Matsumoto |
Merge pull request #2988 from crimsonwoods/update_androidndk_rake
Update androidndk.rake to add support 64bit architectures.
@@ -53,7 +53,20 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter | ||
53 | 53 | params.fetch(:toolchain_version) do |
54 | 54 | test = case toolchain |
55 | 55 | when :gcc |
56 | - 'arm-linux-androideabi-*' | |
56 | + case arch | |
57 | + when /armeabi/ | |
58 | + 'arm-linux-androideabi-*' | |
59 | + when /arm64/ | |
60 | + 'aarch64-linux-android-*' | |
61 | + when /mips64/ | |
62 | + 'mips64el-linux-android-*' | |
63 | + when /mips/ | |
64 | + 'mipsel-linux-android-*' | |
65 | + when /x86_64/ | |
66 | + 'x86_64-*' | |
67 | + when /x86/ | |
68 | + 'x86-*' | |
69 | + end | |
57 | 70 | when :clang |
58 | 71 | 'llvm-*' |
59 | 72 | end |
@@ -67,9 +80,12 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter | ||
67 | 80 | when :clang then 'llvm-' |
68 | 81 | when :gcc |
69 | 82 | case arch |
70 | - when /arm/ then 'arm-linux-androideabi-' | |
71 | - when /x86/ then 'x86-' | |
72 | - when /mips/ then 'mipsel-linux-android-' | |
83 | + when /armeabi/ then 'arm-linux-androideabi-' | |
84 | + when /arm64/ then 'aarch64-linux-android-' | |
85 | + when /x86_64/ then 'x86_64-' | |
86 | + when /x86/ then 'x86-' | |
87 | + when /mips64/ then 'mips64el-linux-android-' | |
88 | + when /mips/ then 'mipsel-linux-android-' | |
73 | 89 | end |
74 | 90 | end |
75 | 91 | home_path.join('toolchains', prefix + toolchain_version.to_s, 'prebuilt', host_platform) |
@@ -77,9 +93,12 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter | ||
77 | 93 | |
78 | 94 | def sysroot |
79 | 95 | path = case arch |
80 | - when /arm/ then 'arch-arm' | |
81 | - when /x86/ then 'arch-x86' | |
82 | - when /mips/ then 'arch-mips' | |
96 | + when /armeabi/ then 'arch-arm' | |
97 | + when /arm64/ then 'arch-arm64' | |
98 | + when /x86_64/ then 'arch-x86_64' | |
99 | + when /x86/ then 'arch-x86' | |
100 | + when /mips64/ then 'arch-mips64' | |
101 | + when /mips/ then 'arch-mips' | |
83 | 102 | end |
84 | 103 | |
85 | 104 | home_path.join('platforms', platform, path).to_s |
@@ -90,9 +109,12 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter | ||
90 | 109 | |
91 | 110 | if toolchain == :gcc |
92 | 111 | command = case arch |
93 | - when /arm/ then 'arm-linux-androideabi-' | |
94 | - when /x86/ then 'i686-linux-android-' | |
95 | - when /mips/ then 'mipsel-linux-android-' | |
112 | + when /armeabi/ then 'arm-linux-androideabi-' | |
113 | + when /arm64/ then 'aarch64-linux-android-' | |
114 | + when /x86_64/ then 'x86_64-linux-android-' | |
115 | + when /x86/ then 'i686-linux-android-' | |
116 | + when /mips64/ then 'mips64el-linux-android-' | |
117 | + when /mips/ then 'mipsel-linux-android-' | |
96 | 118 | end + command |
97 | 119 | end |
98 | 120 |
@@ -111,15 +133,21 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter | ||
111 | 133 | |
112 | 134 | case toolchain |
113 | 135 | when :gcc |
114 | - flags += %W(-ffunction-sections -funwind-tables -fstack-protector) | |
136 | + flags += %W(-ffunction-sections -funwind-tables -no-canonical-prefixes) | |
115 | 137 | flags += %W(-D__android__ -mandroid --sysroot="#{sysroot}") |
116 | 138 | case arch |
139 | + when /arm64/ | |
140 | + flags += %W(-fpic -fstack-protector-strong) | |
141 | + when 'armeabi-v7a-hard' | |
142 | + flags += %W(-fpic -fstack-protector-strong -march=armv7-a -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=vfpv3-d16) | |
117 | 143 | when 'armeabi-v7a' |
118 | - flags += %W(-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16) | |
144 | + flags += %W(-fpic -fstack-protector-strong -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16) | |
119 | 145 | when /arm/ |
120 | - flags += %W(-march=armv5te -mtune=xscale -msoft-float) | |
146 | + flags += %W(-fpic -fstack-protector-strong -march=armv5te -mtune=xscale -msoft-float) | |
121 | 147 | when /mips/ |
122 | 148 | flags += %W(-fpic -fno-strict-aliasing -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers) |
149 | + when /x86/ | |
150 | + flags += %W(-fstack-protector-strong) | |
123 | 151 | end |
124 | 152 | when :clang |
125 | 153 | end |
@@ -132,7 +160,18 @@ Set ANDROID_NDK_HOME environment variable or set :ndk_home parameter | ||
132 | 160 | end |
133 | 161 | |
134 | 162 | def ldflags |
135 | - %W(-D__android__ -mandroid --sysroot="#{sysroot}") | |
163 | + flags = [] | |
164 | + case toolchain | |
165 | + when :gcc | |
166 | + flags += %W(-no-canonical-prefixes) | |
167 | + flags += %W(-D__android__ -mandroid --sysroot="#{sysroot}") | |
168 | + case arch | |
169 | + when 'armeabi-v7a-hard' | |
170 | + flags += %W(-march=armv7-a -Wl,--fix-cortex-a8 -Wl,--no-warn-mismatch -lm_hard) | |
171 | + when 'armeabi-v7a' | |
172 | + flags += %W(-march=armv7-a -Wl,--fix-cortex-a8) | |
173 | + end | |
174 | + end | |
136 | 175 | end |
137 | 176 | |
138 | 177 | def ar |