@@ -486,6 +486,9 @@ def get_env(self):
486486 env ['TOOLCHAIN_PREFIX' ] = toolchain_prefix
487487 env ['TOOLCHAIN_VERSION' ] = toolchain_version
488488
489+ if toolchain_prefix == 'x86' :
490+ toolchain_prefix = 'i686-linux-android'
491+ print ('path is' , environ ['PATH' ])
489492 cc = find_executable ('{toolchain_prefix}-gcc' .format (
490493 toolchain_prefix = toolchain_prefix ), path = environ ['PATH' ])
491494 if cc is None :
@@ -986,7 +989,7 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
986989 self .ndk_dir ,
987990 'platforms' ,
988991 'android-{}' .format (self .android_api ),
989- 'arch-arm' )
992+ compiler_dir )
990993 if not exists (self .ndk_platform ):
991994 warning ('ndk_platform doesn\' t exist' )
992995 ok = False
@@ -1022,15 +1025,18 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
10221025 py_platform = sys .platform
10231026 if py_platform in ['linux2' , 'linux3' ]:
10241027 py_platform = 'linux'
1025- if self .ndk_ver == 'r5b' :
1026- toolchain_prefix = 'arm-eabi'
1027- elif self .ndk_ver [:2 ] in ('r7' , 'r8' , 'r9' ):
1028- toolchain_prefix = 'arm-linux-androideabi'
1029- elif self .ndk_ver [:3 ] == 'r10' :
1030- toolchain_prefix = 'arm-linux-androideabi'
1028+ if arch .arch [:3 ] == 'arm' :
1029+ if self .ndk_ver == 'r5b' :
1030+ toolchain_prefix = 'arm-eabi'
1031+ elif self .ndk_ver [:2 ] in ('r7' , 'r8' , 'r9' ):
1032+ toolchain_prefix = 'arm-linux-androideabi'
1033+ elif self .ndk_ver [:3 ] == 'r10' :
1034+ toolchain_prefix = 'arm-linux-androideabi'
1035+ else :
1036+ warning ('Error: NDK not supported by these tools?' )
1037+ exit (1 )
10311038 else :
1032- warning ('Error: NDK not supported by these tools?' )
1033- exit (1 )
1039+ toolchain_prefix = 'x86'
10341040
10351041 toolchain_versions = []
10361042 toolchain_path = join (self .ndk_dir , 'toolchains' )
@@ -1042,9 +1048,11 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
10421048 os .path .join (toolchain_path , toolchain_content )):
10431049 toolchain_version = toolchain_content [
10441050 len (toolchain_prefix )+ 1 :]
1045- debug ('Found toolchain version: {}' .format (
1046- toolchain_version ))
1047- toolchain_versions .append (toolchain_version )
1051+ # AND: This is terrible!
1052+ if toolchain_version [0 ] in map (str , range (10 )) and 'clang' not in toolchain_version and toolchain_version [:2 ] != '64' :
1053+ debug ('Found toolchain version: {}' .format (
1054+ toolchain_version ))
1055+ toolchain_versions .append (toolchain_version )
10481056 else :
10491057 warning ('Could not find toolchain subdirectory!' )
10501058 ok = False
0 commit comments