Пример #1
0
def check_win_x64_android_arm_gcc_installed(conf):
    """
	Check compiler is actually installed on executing machine
	"""
    v = conf.env

    # Setup Tools for GCC Cross Compile Toolchain
    if not conf.is_option_true('auto_detect_compiler'):
        android_sdk_home = conf.CreateRootRelativePath('Code/SDKs/android-sdk')
        android_ndk_home = conf.CreateRootRelativePath('Code/SDKs/android-ndk')
        android_java_home = conf.CreateRootRelativePath('Code/SDKs/jdk')
        android_ant_home = conf.CreateRootRelativePath('Code/SDKs/apache-ant')
    else:
        android_sdk_home = os.getenv('ANDROID_HOME', "")
        android_ndk_home = os.getenv('NDK_ROOT', "")
        android_java_home = os.getenv('JAVA_HOME', "")
        android_ant_home = os.getenv('ANT_HOME', "")

    # Validate paths
    for path in [
            android_sdk_home, android_ndk_home, android_java_home,
            android_ant_home
    ]:
        if not os.path.exists(path):
            conf.cry_warning("Requiered Android SDK path does not exist: %s." %
                             path)
            return False

    # Configure platform and compiler mutations
    platform_target = '/platforms/android-' + str(android_target_version)
    compiler_target = '/arch-arm'
    compiler_version = str(android_compiler_version)
    toolchain = 'arm-linux-androideabi-' + compiler_version

    android_sdk_platform_target = android_sdk_home + platform_target
    android_ndk_platform_compiler_target = android_ndk_home + platform_target + compiler_target
    android_ndk_toolchain_target = android_ndk_home + '/toolchains/' + toolchain + '/prebuilt/windows-x86_64'
    if not os.path.exists(android_ndk_toolchain_target
                          ):  # Fallback if the 64 bit compiler is not found
        android_ndk_toolchain_target = android_ndk_home + '/toolchains/' + toolchain + '/prebuilt/windows'

    # Validate paths
    for path in [
            android_sdk_platform_target, android_ndk_platform_compiler_target,
            android_ndk_toolchain_target
    ]:
        if not os.path.exists(path):
            conf.cry_warning("Requiered Android SDK path does not exist: %s." %
                             path)
            return False

    return True
def check_win_x64_android_arm_gcc_installed(conf):
	"""
	Check compiler is actually installed on executing machine
	"""
	v = conf.env
	
	# Setup Tools for GCC Cross Compile Toolchain
	if not conf.is_option_true('auto_detect_compiler'):	
		android_sdk_home		= conf.CreateRootRelativePath('Code/SDKs/android-sdk')
		android_ndk_home		= conf.CreateRootRelativePath('Code/SDKs/android-ndk')
		android_java_home		= conf.CreateRootRelativePath('Code/SDKs/jdk')
		android_ant_home 		= conf.CreateRootRelativePath('Code/SDKs/apache-ant')
	else:
		android_sdk_home 		= os.getenv('ANDROID_HOME', "")	
		android_ndk_home 		= os.getenv('NDK_ROOT', "")
		android_java_home 	= os.getenv('JAVA_HOME', "")
		android_ant_home 		= os.getenv('ANT_HOME', "")
		
	# Validate paths
	for path in [android_sdk_home, android_ndk_home, android_java_home, android_ant_home]:
		if not os.path.exists(path):
			conf.cry_warning("Requiered Android SDK path does not exist: %s." % path)
			return False

	# Configure platform and compiler mutations		
	platform_target = '/platforms/android-' + str(android_target_version)
	compiler_target = '/arch-arm'
	compiler_version = str(android_compiler_version)
	toolchain = 'arm-linux-androideabi-' + compiler_version
	
	android_sdk_platform_target 	= android_sdk_home + platform_target
	android_ndk_platform_compiler_target 	= android_ndk_home + platform_target + compiler_target
	android_ndk_toolchain_target 	= android_ndk_home + '/toolchains/' + toolchain + '/prebuilt/windows-x86_64'
	if not os.path.exists(android_ndk_toolchain_target): # Fallback if the 64 bit compiler is not found
		android_ndk_toolchain_target 	= android_ndk_home + '/toolchains/' + toolchain + '/prebuilt/windows'
		
	# Validate paths
	for path in [android_sdk_platform_target, android_ndk_platform_compiler_target, android_ndk_toolchain_target]:
		if not os.path.exists(path):
			conf.cry_warning("Requiered Android SDK path does not exist: %s." % path)
			return False
		
	return  True