diff --git a/script/install-gcc-src/customize.py b/script/install-gcc-src/customize.py index 839a43699..c13141d22 100644 --- a/script/install-gcc-src/customize.py +++ b/script/install-gcc-src/customize.py @@ -22,6 +22,11 @@ def preprocess(i): else: env['MLC_GCC_TARGET_STRING'] = '' + if env.get('MLC_GCC_HOST', '') != '': + env['MLC_GCC_HOST_STRING'] = f""" --target={env['MLC_GCC_HOST']} """ + else: + env['MLC_GCC_HOST_STRING'] = '' + env['MLC_GCC_INSTALLED_PATH'] = os.path.join(os.getcwd(), 'install', 'bin') return {'return': 0} diff --git a/script/install-gcc-src/meta.yaml b/script/install-gcc-src/meta.yaml index 74a883f26..3bc1e7083 100644 --- a/script/install-gcc-src/meta.yaml +++ b/script/install-gcc-src/meta.yaml @@ -26,6 +26,7 @@ deps: - MLC_GIT_CHECKOUT_TAG input_mapping: targets: MLC_GCC_TARGET + host: MLC_GCC_HOST env: MLC_GIT_URL: git://gcc.gnu.org/git/gcc.git diff --git a/script/install-gcc-src/run.sh b/script/install-gcc-src/run.sh index 7d3131950..d11bedbd0 100644 --- a/script/install-gcc-src/run.sh +++ b/script/install-gcc-src/run.sh @@ -23,7 +23,7 @@ cd src cd ../build -cmd="../src/configure --prefix="${INSTALL_DIR}" ${MLC_GCC_TARGET_STRING} --with-gcc-major-version-only --disable-multilib" +cmd="../src/configure --prefix="${INSTALL_DIR}" ${MLC_GCC_TARGET_STRING} ${MLC_GCC_HOST_STRING} --with-gcc-major-version-only --disable-multilib" echo $cmd eval $cmd