Skip to content

Commit 89f9fc3

Browse files
committed
Fixed Arch use of command_prefix
1 parent 8e23ede commit 89f9fc3

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

pythonforandroid/archs.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,34 @@ def get_env(self):
4747

4848
toolchain_prefix = self.ctx.toolchain_prefix
4949
toolchain_version = self.ctx.toolchain_version
50+
command_prefix = self.command_prefix
5051

5152
env['TOOLCHAIN_PREFIX'] = toolchain_prefix
5253
env['TOOLCHAIN_VERSION'] = toolchain_version
5354

54-
if toolchain_prefix == 'x86':
55-
toolchain_prefix = 'i686-linux-android'
5655
print('path is', environ['PATH'])
57-
cc = find_executable('{toolchain_prefix}-gcc'.format(
58-
toolchain_prefix=toolchain_prefix), path=environ['PATH'])
56+
cc = find_executable('{command_prefix}-gcc'.format(
57+
command_prefix=command_prefix), path=environ['PATH'])
5958
if cc is None:
6059
warning('Couldn\'t find executable for CC. This indicates a '
6160
'problem locating the {} executable in the Android '
6261
'NDK, not that you don\'t have a normal compiler '
6362
'installed. Exiting.')
6463
exit(1)
6564

66-
env['CC'] = '{toolchain_prefix}-gcc {cflags}'.format(
67-
toolchain_prefix=toolchain_prefix,
65+
env['CC'] = '{command_prefix}-gcc {cflags}'.format(
66+
command_prefix=command_prefix,
6867
cflags=env['CFLAGS'])
69-
env['CXX'] = '{toolchain_prefix}-g++ {cxxflags}'.format(
70-
toolchain_prefix=toolchain_prefix,
68+
env['CXX'] = '{command_prefix}-g++ {cxxflags}'.format(
69+
command_prefix=command_prefix,
7170
cxxflags=env['CXXFLAGS'])
7271

73-
env['AR'] = '{}-ar'.format(toolchain_prefix)
74-
env['RANLIB'] = '{}-ranlib'.format(toolchain_prefix)
75-
env['LD'] = '{}-ld'.format(toolchain_prefix)
76-
env['STRIP'] = '{}-strip --strip-unneeded'.format(toolchain_prefix)
72+
env['AR'] = '{}-ar'.format(command_prefix)
73+
env['RANLIB'] = '{}-ranlib'.format(command_prefix)
74+
env['LD'] = '{}-ld'.format(command_prefix)
75+
env['STRIP'] = '{}-strip --strip-unneeded'.format(command_prefix)
7776
env['MAKE'] = 'make -j5'
78-
env['READELF'] = '{}-readelf'.format(toolchain_prefix)
77+
env['READELF'] = '{}-readelf'.format(command_prefix)
7978

8079
hostpython_recipe = Recipe.get_recipe('hostpython2', self.ctx)
8180

pythonforandroid/toolchain.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
573573
arch = self.archs[0]
574574
platform_dir = arch.platform_dir
575575
toolchain_prefix = arch.toolchain_prefix
576-
command_prefix = arch.command_prefix
577576
self.ndk_platform = join(
578577
self.ndk_dir,
579578
'platforms',

0 commit comments

Comments
 (0)