diff --git a/pythonforandroid/recipes/ffmpeg/__init__.py b/pythonforandroid/recipes/ffmpeg/__init__.py index 85bdb8ad06..4a04f4844f 100644 --- a/pythonforandroid/recipes/ffmpeg/__init__.py +++ b/pythonforandroid/recipes/ffmpeg/__init__.py @@ -98,20 +98,29 @@ def build_arch(self, arch): '--enable-shared', ] + if 'arm64' in arch.arch: + cross_prefix = 'aarch64-linux-android-' + arch_flag = 'aarch64' + else: + cross_prefix = 'arm-linux-androideabi-' + arch_flag = 'arm' + # android: flags += [ '--target-os=android', - '--cross-prefix=arm-linux-androideabi-', - '--arch=arm', + '--cross-prefix={}'.format(cross_prefix), + '--arch={}'.format(arch_flag), '--sysroot=' + self.ctx.ndk_platform, '--enable-neon', '--prefix={}'.format(realpath('.')), ] - cflags += [ - '-mfpu=vfpv3-d16', - '-mfloat-abi=softfp', - '-fPIC', - ] + + if arch_flag == 'arm': + cflags += [ + '-mfpu=vfpv3-d16', + '-mfloat-abi=softfp', + '-fPIC', + ] env['CFLAGS'] += ' ' + ' '.join(cflags) env['LDFLAGS'] += ' ' + ' '.join(ldflags) @@ -121,7 +130,8 @@ def build_arch(self, arch): shprint(sh.make, '-j4', _env=env) shprint(sh.make, 'install', _env=env) # copy libs: - sh.cp('-a', sh.glob('./lib/lib*.so'), self.ctx.get_libs_dir(arch.arch)) + sh.cp('-a', sh.glob('./lib/lib*.so'), + self.ctx.get_libs_dir(arch.arch)) recipe = FFMpegRecipe() diff --git a/pythonforandroid/recipes/libx264/__init__.py b/pythonforandroid/recipes/libx264/__init__.py index c139b4ce74..89d48c8410 100644 --- a/pythonforandroid/recipes/libx264/__init__.py +++ b/pythonforandroid/recipes/libx264/__init__.py @@ -14,9 +14,13 @@ def should_build(self, arch): def build_arch(self, arch): with current_directory(self.get_build_dir(arch.arch)): env = self.get_recipe_env(arch) + if 'arm64' in arch.arch: + cross_prefix = 'aarch64-linux-android-' + else: + cross_prefix = 'arm-linux-androideabi-' configure = sh.Command('./configure') shprint(configure, - '--cross-prefix=arm-linux-androideabi-', + '--cross-prefix={}'.format(cross_prefix), '--host=arm-linux', '--disable-asm', '--disable-cli',