Use mips64el toolchain
This commit is contained in:
parent
a83b8e751b
commit
b2fdfa2710
2 changed files with 37 additions and 5 deletions
|
@ -5,12 +5,13 @@ import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from lib.config import get_target_arch
|
from lib.config import MIPS64EL_GCC, get_target_arch
|
||||||
from lib.util import electron_gyp, import_vs_env
|
from lib.util import electron_gyp, import_vs_env
|
||||||
|
|
||||||
|
|
||||||
CONFIGURATIONS = ['Release', 'Debug']
|
CONFIGURATIONS = ['Release', 'Debug']
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
|
||||||
LIBCC_SOURCE_ROOT = os.path.join(SOURCE_ROOT, 'vendor', 'libchromiumcontent')
|
LIBCC_SOURCE_ROOT = os.path.join(SOURCE_ROOT, 'vendor', 'libchromiumcontent')
|
||||||
LIBCC_DIST_MAIN = os.path.join(LIBCC_SOURCE_ROOT, 'dist', 'main')
|
LIBCC_DIST_MAIN = os.path.join(LIBCC_SOURCE_ROOT, 'dist', 'main')
|
||||||
GCLIENT_DONE = os.path.join(SOURCE_ROOT, '.gclient_done')
|
GCLIENT_DONE = os.path.join(SOURCE_ROOT, '.gclient_done')
|
||||||
|
@ -40,9 +41,10 @@ def main():
|
||||||
get_target_arch()])
|
get_target_arch()])
|
||||||
subprocess.check_call([ninja, '-C', LIBCC_DIST_MAIN])
|
subprocess.check_call([ninja, '-C', LIBCC_DIST_MAIN])
|
||||||
|
|
||||||
|
env = build_env()
|
||||||
for config in args.configuration:
|
for config in args.configuration:
|
||||||
build_path = os.path.join('out', config[0])
|
build_path = os.path.join('out', config[0])
|
||||||
ret = subprocess.call([ninja, '-C', build_path, args.target])
|
ret = subprocess.call([ninja, '-C', build_path, args.target], env=env)
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
sys.exit(ret)
|
sys.exit(ret)
|
||||||
|
|
||||||
|
@ -68,5 +70,20 @@ def parse_args():
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
def build_env():
|
||||||
|
env = os.environ.copy()
|
||||||
|
if get_target_arch() == "mips64el":
|
||||||
|
gcc_dir = os.path.join(VENDOR_DIR, MIPS64EL_GCC)
|
||||||
|
ldlib_dirs = [
|
||||||
|
gcc_dir + '/usr/x86_64-unknown-linux-gnu/mips64el-redhat-linux/lib',
|
||||||
|
gcc_dir + '/usr/lib64',
|
||||||
|
gcc_dir + '/usr/mips64el-redhat-linux/lib64',
|
||||||
|
gcc_dir + '/usr/mips64el-redhat-linux/sysroot/lib64',
|
||||||
|
gcc_dir + '/usr/mips64el-redhat-linux/sysroot/usr/lib64',
|
||||||
|
]
|
||||||
|
env['LD_LIBRARY_PATH'] = os.pathsep.join(ldlib_dirs)
|
||||||
|
env['PATH'] = os.pathsep.join([gcc_dir + '/usr/bin', env['PATH']])
|
||||||
|
return env
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
# Set this to true when building with Clang.
|
# Set this to true when building with Clang.
|
||||||
'clang%': 1,
|
'clang%': 1,
|
||||||
|
|
||||||
|
# Path to mips64el toolchain.
|
||||||
|
'make_mips64_dir%': 'vendor/gcc-4.8.3-d197-n64-loongson/usr',
|
||||||
|
|
||||||
'variables': {
|
'variables': {
|
||||||
# The minimum macOS SDK version to use.
|
# The minimum macOS SDK version to use.
|
||||||
'mac_sdk_min%': '10.10',
|
'mac_sdk_min%': '10.10',
|
||||||
|
@ -30,8 +33,8 @@
|
||||||
'use_lto_o2%': 0,
|
'use_lto_o2%': 0,
|
||||||
|
|
||||||
'conditions': [
|
'conditions': [
|
||||||
# Do not use Clang on Windows.
|
# Do not use Clang on Windows or when building for mips64el.
|
||||||
['OS=="win"', {
|
['OS=="win" or target_arch=="mips64el"', {
|
||||||
'clang%': 0,
|
'clang%': 0,
|
||||||
}], # OS=="win"
|
}], # OS=="win"
|
||||||
|
|
||||||
|
@ -61,6 +64,9 @@
|
||||||
['target_arch=="x64"', {
|
['target_arch=="x64"', {
|
||||||
'sysroot%': '<(source_root)/vendor/debian_jessie_amd64-sysroot',
|
'sysroot%': '<(source_root)/vendor/debian_jessie_amd64-sysroot',
|
||||||
}],
|
}],
|
||||||
|
['target_arch=="mips64el"', {
|
||||||
|
'sysroot%': '<(source_root)/vendor/debian_jessie_mips64-sysroot',
|
||||||
|
}],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
# Copy conditionally-set variables out one scope.
|
# Copy conditionally-set variables out one scope.
|
||||||
|
@ -130,6 +136,15 @@
|
||||||
},
|
},
|
||||||
}], # clang==1
|
}], # clang==1
|
||||||
|
|
||||||
|
['target_arch=="mips64el"', {
|
||||||
|
'make_global_settings': [
|
||||||
|
['CC', '<(make_mips64_dir)/bin/mips64el-redhat-linux-gcc'],
|
||||||
|
['CXX', '<(make_mips64_dir)/bin/mips64el-redhat-linux-g++'],
|
||||||
|
['CC.host', '$(CC)'],
|
||||||
|
['CXX.host', '$(CXX)'],
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
|
||||||
# Specify the SDKROOT.
|
# Specify the SDKROOT.
|
||||||
['OS=="mac"', {
|
['OS=="mac"', {
|
||||||
'target_defaults': {
|
'target_defaults': {
|
||||||
|
@ -140,7 +155,7 @@
|
||||||
}],
|
}],
|
||||||
|
|
||||||
# Setup sysroot environment.
|
# Setup sysroot environment.
|
||||||
['OS=="linux" and target_arch in ["arm", "ia32", "x64", "arm64"]', {
|
['OS=="linux" and target_arch in ["arm", "ia32", "x64", "arm64", "mips64el"]', {
|
||||||
'target_defaults': {
|
'target_defaults': {
|
||||||
'target_conditions': [
|
'target_conditions': [
|
||||||
['_toolset=="target"', {
|
['_toolset=="target"', {
|
||||||
|
|
Loading…
Reference in a new issue