Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class Archx86(Arch):
arch = 'x86'
toolchain_prefix = 'x86'
command_prefix = 'i686-linux-android'
platform_dir = 'arch-x86'
def get_env(self, with_flags_in_cc=True):
env = super(Archx86, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
env['CXXFLAGS'] = env['CFLAGS']
return env
class Archx86_64(Arch):
arch = 'x86_64'
toolchain_prefix = 'x86_64'
command_prefix = 'x86_64-linux-android'
platform_dir = 'arch-x86_64'
def get_env(self, with_flags_in_cc=True):
env = super(Archx86_64, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
env['CXXFLAGS'] = env['CFLAGS']
return env
class ArchAarch_64(Arch):
arch = 'arm64-v8a'
toolchain_prefix = 'aarch64-linux-android'
command_prefix = 'aarch64-linux-android'
class Archx86_64(Arch):
arch = 'x86_64'
toolchain_prefix = 'x86_64'
command_prefix = 'x86_64-linux-android'
platform_dir = 'arch-x86_64'
def get_env(self, with_flags_in_cc=True):
env = super(Archx86_64, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
env['CXXFLAGS'] = env['CFLAGS']
return env
class ArchAarch_64(Arch):
arch = 'arm64-v8a'
toolchain_prefix = 'aarch64-linux-android'
command_prefix = 'aarch64-linux-android'
platform_dir = 'arch-arm64'
def get_env(self, with_flags_in_cc=True):
env = super(ArchAarch_64, self).get_env(with_flags_in_cc)
incpath = ' -I' + join(dirname(__file__), 'includes', 'arm64-v8a')
env['EXTRA_CFLAGS'] = incpath
env['CFLAGS'] += incpath
env['CXXFLAGS'] += incpath
if with_flags_in_cc:
env['CC'] += incpath
env['CXX'] += incpath
return env
def __init__(self, ctx):
super(Arch, self).__init__()
self.ctx = ctx
toolchain_prefix = 'arm-linux-androideabi'
command_prefix = 'arm-linux-androideabi'
platform_dir = 'arch-arm'
class ArchARMv7_a(ArchARM):
arch = 'armeabi-v7a'
def get_env(self, with_flags_in_cc=True):
env = super(ArchARMv7_a, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb'
env['CXXFLAGS'] = env['CFLAGS']
return env
class Archx86(Arch):
arch = 'x86'
toolchain_prefix = 'x86'
command_prefix = 'i686-linux-android'
platform_dir = 'arch-x86'
def get_env(self, with_flags_in_cc=True):
env = super(Archx86, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
env['CXXFLAGS'] = env['CFLAGS']
return env
class Archx86_64(Arch):
arch = 'x86_64'
toolchain_prefix = 'x86_64'
command_prefix = 'x86_64-linux-android'
toolchain_prefix = 'arm-linux-androideabi'
command_prefix = 'arm-linux-androideabi'
platform_dir = 'arch-arm'
class ArchARMv7_a(ArchARM):
arch = 'armeabi-v7a'
def get_env(self, with_flags_in_cc=True):
env = super(ArchARMv7_a, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb'
env['CXXFLAGS'] = env['CFLAGS']
return env
class Archx86(Arch):
arch = 'x86'
toolchain_prefix = 'x86'
command_prefix = 'i686-linux-android'
platform_dir = 'arch-x86'
def get_env(self, with_flags_in_cc=True):
env = super(Archx86, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
env['CXXFLAGS'] = env['CFLAGS']
return env
class Archx86_64(Arch):
arch = 'x86_64'
toolchain_prefix = 'x86_64'
command_prefix = 'x86_64-linux-android'
def __init__(self, ctx):
super(Arch, self).__init__()
self.ctx = ctx
class Archx86_64(Arch):
arch = 'x86_64'
toolchain_prefix = 'x86_64'
command_prefix = 'x86_64-linux-android'
platform_dir = 'arch-x86_64'
def get_env(self, with_flags_in_cc=True):
env = super(Archx86_64, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
env['CXXFLAGS'] = env['CFLAGS']
return env
class ArchAarch_64(Arch):
arch = 'arm64-v8a'
toolchain_prefix = 'aarch64-linux-android'
command_prefix = 'aarch64-linux-android'
platform_dir = 'arch-arm64'
def get_env(self, with_flags_in_cc=True):
env = super(ArchAarch_64, self).get_env(with_flags_in_cc)
incpath = ' -I' + join(dirname(__file__), 'includes', 'arm64-v8a')
env['EXTRA_CFLAGS'] = incpath
env['CFLAGS'] += incpath
env['CXXFLAGS'] += incpath
if with_flags_in_cc:
env['CC'] += incpath
env['CXX'] += incpath
return env
class Archx86(Arch):
arch = 'x86'
toolchain_prefix = 'x86'
command_prefix = 'i686-linux-android'
platform_dir = 'arch-x86'
def get_env(self, with_flags_in_cc=True):
env = super(Archx86, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
env['CXXFLAGS'] = env['CFLAGS']
return env
class Archx86_64(Arch):
arch = 'x86_64'
toolchain_prefix = 'x86_64'
command_prefix = 'x86_64-linux-android'
platform_dir = 'arch-x86_64'
def get_env(self, with_flags_in_cc=True):
env = super(Archx86_64, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
env['CXXFLAGS'] = env['CFLAGS']
return env
class ArchAarch_64(Arch):
arch = 'arm64-v8a'
toolchain_prefix = 'aarch64-linux-android'
command_prefix = 'aarch64-linux-android'
hostpython_recipe.get_build_dir(self.arch),
'build', 'lib.linux-{}-2.7'.format(uname()[-1]))
except IOError:
pass
env['PATH'] = environ['PATH']
env['ARCH'] = self.arch
if self.ctx.python_recipe and self.ctx.python_recipe.from_crystax:
env['CRYSTAX_PYTHON_VERSION'] = self.ctx.python_recipe.version
return env
class ArchARM(Arch):
arch = "armeabi"
toolchain_prefix = 'arm-linux-androideabi'
command_prefix = 'arm-linux-androideabi'
platform_dir = 'arch-arm'
class ArchARMv7_a(ArchARM):
arch = 'armeabi-v7a'
def get_env(self, with_flags_in_cc=True):
env = super(ArchARMv7_a, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb'
env['CXXFLAGS'] = env['CFLAGS']
return env
# AND: This hardcodes python version 2.7, needs fixing
env['BUILDLIB_PATH'] = join(
hostpython_recipe.get_build_dir(self.arch),
'build', 'lib.linux-{}-2.7'.format(uname()[-1]))
env['PATH'] = environ['PATH']
env['ARCH'] = self.arch
if self.ctx.python_recipe and self.ctx.python_recipe.from_crystax:
env['CRYSTAX_PYTHON_VERSION'] = self.ctx.python_recipe.version
return env
class ArchARM(Arch):
arch = "armeabi"
toolchain_prefix = 'arm-linux-androideabi'
command_prefix = 'arm-linux-androideabi'
platform_dir = 'arch-arm'
class ArchARMv7_a(ArchARM):
arch = 'armeabi-v7a'
def get_env(self, with_flags_in_cc=True):
env = super(ArchARMv7_a, self).get_env(with_flags_in_cc)
env['CFLAGS'] += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb'
env['CXXFLAGS'] = env['CFLAGS']
return env