Skip to content

Commit 49e4b29

Browse files
committed
Removed toolchain check duplicate
1 parent 6751593 commit 49e4b29

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

pythonforandroid/toolchain.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def shprint(command, *args, **kwargs):
8383
command_string = command_path[-1]
8484
# if len(command_path) > 1:
8585
# command_string = '.../' + command_string
86-
print('args are', args)
8786
string = ' '.join(['running', Style.DIM, command_string] + list(args))
8887

8988
# If logging is not in DEBUG mode, trim the command if necessary
@@ -303,25 +302,15 @@ def get_env(self):
303302
if py_platform in ['linux2', 'linux3']:
304303
py_platform = 'linux'
305304

306-
if self.ctx.ndk_ver == 'r5b':
307-
toolchain_prefix = 'arm-eabi'
308-
toolchain_version = '4.4.0'
309-
elif self.ctx.ndk_ver[:2] in ('r7', 'r8'):
310-
toolchain_prefix = 'arm-linux-androideabi'
311-
toolchain_version = '4.4.3'
312-
elif self.ctx.ndk_ver[:2] == 'r9':
313-
toolchain_prefix = 'arm-linux-androideabi'
314-
toolchain_version = '4.9'
315-
elif self.ctx.ndk_ver[:3] == 'r10':
316-
toolchain_prefix = 'arm-linux-androideabi'
317-
toolchain_version = '4.9'
318-
else:
319-
warning('Error: NDK not supported by these tools?')
320-
exit(1)
305+
toolchain_prefix = self.ctx.toolchain_prefix
306+
toolchain_version = self.ctx.toolchain_version
321307

322308
env['TOOLCHAIN_PREFIX'] = toolchain_prefix
323309
env['TOOLCHAIN_VERSION'] = toolchain_version
324310

311+
print('prefix, version', toolchain_prefix, toolchain_version)
312+
print('looking for {toolchain_prefix}-gcc'.format(toolchain_prefix-toolchain_prefix))
313+
print('in the path', environ['PATH'])
325314
cc = find_executable('{toolchain_prefix}-gcc'.format(
326315
toolchain_prefix=toolchain_prefix), path=environ['PATH'])
327316
if cc is None:
@@ -717,6 +706,8 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
717706
else:
718707
warning('Error: NDK not supported by these tools?')
719708
exit(1)
709+
self.toolchain_prefix = toolchain_prefix
710+
self.toolchain_version = toolchain_version
720711
environ['PATH'] = ('{ndk_dir}/toolchains/{toolchain_prefix}-{toolchain_version}/'
721712
'prebuilt/{py_platform}-x86/bin/:{ndk_dir}/toolchains/'
722713
'{toolchain_prefix}-{toolchain_version}/prebuilt/'

0 commit comments

Comments
 (0)