Add a i586 toolchain.
This will allow to build kiwix-tools for i586 architectures.
This commit is contained in:
parent
5d08673a52
commit
468c3edff9
|
@ -1,4 +1,5 @@
|
|||
include kiwixbuild/templates/cmake_cross_file.txt
|
||||
include kiwixbuild/templates/meson_cross_file.txt
|
||||
include kiwixbuild/templates/cmake_android_cross_file.txt
|
||||
include kiwixbuild/templates/cmake_i586_cross_file.txt
|
||||
include kiwixbuild/patches/*.patch
|
||||
|
|
|
@ -52,6 +52,12 @@ PACKAGE_NAME_MAPPERS = {
|
|||
'lzma': ['xz-devel', 'xz-static']
|
||||
# Either there is no packages, or no static or too old
|
||||
},
|
||||
'fedora_i586_dyn': {
|
||||
'COMMON': _fedora_common + ['glibc-devel.i686', 'libstdc++-devel.i686'],
|
||||
},
|
||||
'fedora_i586_static': {
|
||||
'COMMON': _fedora_common + ['glibc-devel.i686'],
|
||||
},
|
||||
'fedora_win32_dyn': {
|
||||
'COMMON': _fedora_common + ['mingw32-gcc-c++', 'mingw32-bzip2', 'mingw32-win-iconv', 'mingw32-winpthreads', 'wine'],
|
||||
'zlib': ['mingw32-zlib'],
|
||||
|
@ -162,6 +168,19 @@ class TargetInfo:
|
|||
'abi': ''
|
||||
}
|
||||
}
|
||||
elif self.build == 'i586':
|
||||
return {
|
||||
'extra_libs': ['-m32', '-march=i586'],
|
||||
'extra_cflags': ['-m32', '-march=i586'],
|
||||
'host_machine': {
|
||||
'system': 'linux',
|
||||
'lsystem': 'linux',
|
||||
'cpu_family': 'x86',
|
||||
'cpu': 'i586',
|
||||
'endian': 'little',
|
||||
'abi': ''
|
||||
}
|
||||
}
|
||||
|
||||
class AndroidTargetInfo(TargetInfo):
|
||||
__arch_infos = {
|
||||
|
@ -209,6 +228,10 @@ class BuildEnv:
|
|||
hosts=['fedora', 'debian', 'Darwin']),
|
||||
'native_static': TargetInfo('native', True, [],
|
||||
hosts=['fedora', 'debian']),
|
||||
'i586_dyn': TargetInfo('i586', False, ['linux_i586_toolchain'],
|
||||
hosts=['fedora', 'debian']),
|
||||
'i586_static': TargetInfo('i586', True, ['linux_i586_toolchain'],
|
||||
hosts=['fedora', 'debian']),
|
||||
'win32_dyn': TargetInfo('win32', False, ['mingw32_toolchain'],
|
||||
hosts=['fedora', 'debian']),
|
||||
'win32_static': TargetInfo('win32', True, ['mingw32_toolchain'],
|
||||
|
@ -332,6 +355,10 @@ class BuildEnv:
|
|||
def setup_iOS(self):
|
||||
pass
|
||||
|
||||
def setup_i586(self):
|
||||
self.cmake_crossfile = self._gen_crossfile('cmake_i586_cross_file.txt')
|
||||
self.meson_crossfile = self._gen_crossfile('meson_cross_file.txt')
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self.options, name)
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
SET(CMAKE_SYSTEM_NAME {host_machine[system]})
|
||||
SET(CMAKE_SYSTEM_PROCESSOR {host_machine[cpu_family]})
|
||||
|
||||
# specify the cross compiler
|
||||
SET(CMAKE_C_COMPILER "{toolchain.binaries[CC]}")
|
||||
SET(CMAKE_CXX_COMPILER "{toolchain.binaries[CXX]}")
|
||||
SET(C_FLAGS "-m32 -march=i586")
|
||||
SET(CXX_FLAGS "-m32 -march=i586")
|
||||
SET(CMAKE_LD_FLAGS "-m32 -march=i586")
|
||||
SET(CMAKE_AR:FILEPATH {toolchain.binaries[AR]})
|
||||
SET(CMAKE_RANLIB:FILEPATH {toolchain.binaries[RANLIB]})
|
||||
|
||||
find_program(CCACHE_FOUND ccache)
|
||||
if(CCACHE_FOUND)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
endif(CCACHE_FOUND)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
from . import android_ndk, android_sdk, armhf, ios, mingw32
|
||||
from . import android_ndk, android_sdk, armhf, ios, mingw32, linux_i586
|
||||
|
||||
from .base_toolchain import Toolchain
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
from .base_toolchain import Toolchain
|
||||
from kiwixbuild.dependency_utils import GitClone
|
||||
from kiwixbuild.utils import Remotefile, which
|
||||
pj = os.path.join
|
||||
|
||||
class linux_i586_toolchain(Toolchain):
|
||||
name = 'linux_i586'
|
||||
arch_full = 'i586-linux-gnu'
|
||||
|
||||
@property
|
||||
def configure_option(self):
|
||||
return '--host={}'.format(self.arch_full)
|
||||
|
||||
@property
|
||||
def binaries(self):
|
||||
return {k:which(v)
|
||||
for k, v in (('CC', os.environ.get('CC', 'gcc')),
|
||||
('CXX', os.environ.get('CXX', 'g++')),
|
||||
('AR', 'ar'),
|
||||
('STRIP', 'strip'),
|
||||
('RANLIB', 'ranlib'),
|
||||
('LD', 'ld'))
|
||||
}
|
||||
|
||||
@property
|
||||
def configure_option(self):
|
||||
return '--host={}'.format(self.arch_full)
|
||||
|
||||
def set_env(self, env):
|
||||
env['CFLAGS'] = "-m32 -march=i586 "+env['CFLAGS']
|
||||
env['CXXFLAGS'] = "-m32 -march=i586 "+env['CXXFLAGS']
|
||||
env['LDFLAGS'] = "-m32 -march=i586 "+env['LDFLAGS']
|
||||
|
||||
def get_bin_dir(self):
|
||||
return []
|
Loading…
Reference in New Issue