mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-21 21:57:48 +00:00
Add support code for the canadian-cross case.
Add implementation for a candadian build option already present in crosstool in order to build a cross-compiler where build != host != target Signed-off-by: Bart van der Meulen <bartvdrmeulen@gmail.com>
This commit is contained in:
parent
38916b8bfb
commit
1a84e201d0
@ -123,7 +123,7 @@ config CROSS_NATIVE
|
|||||||
|
|
||||||
config CANADIAN
|
config CANADIAN
|
||||||
bool
|
bool
|
||||||
prompt "Canadian (NO CODE!) (EXPERIMENTAL)"
|
prompt "Canadian (EXPERIMENTAL)"
|
||||||
depends on EXPERIMENTAL
|
depends on EXPERIMENTAL
|
||||||
help
|
help
|
||||||
Build a canadian-toolchain.
|
Build a canadian-toolchain.
|
||||||
|
@ -41,6 +41,10 @@ do_cc_extract() {
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Core gcc pass 1
|
# Core gcc pass 1
|
||||||
do_cc_core_pass_1() {
|
do_cc_core_pass_1() {
|
||||||
|
# If we're building a canadian compiler no use to build the CC
|
||||||
|
# core compiler, we're not using it
|
||||||
|
[ -n "${CT_CANADIAN}" ] && return 0
|
||||||
|
|
||||||
# If we're building for bare metal, build the static core gcc,
|
# If we're building for bare metal, build the static core gcc,
|
||||||
# with libgcc.
|
# with libgcc.
|
||||||
# In case we're not bare metal, and we're NPTL, build the static core gcc.
|
# In case we're not bare metal, and we're NPTL, build the static core gcc.
|
||||||
@ -54,6 +58,10 @@ do_cc_core_pass_1() {
|
|||||||
|
|
||||||
# Core gcc pass 2
|
# Core gcc pass 2
|
||||||
do_cc_core_pass_2() {
|
do_cc_core_pass_2() {
|
||||||
|
# If we're building a canadian compiler no use to build the CC
|
||||||
|
# core compiler, we're not using it
|
||||||
|
[ -n "${CT_CANADIAN}" ] && return 0
|
||||||
|
|
||||||
# In case we're building for bare metal, do nothing, we already have
|
# In case we're building for bare metal, do nothing, we already have
|
||||||
# our compiler.
|
# our compiler.
|
||||||
# In case we're NPTL, build the shared core gcc and the target libgcc.
|
# In case we're NPTL, build the shared core gcc and the target libgcc.
|
||||||
|
@ -223,8 +223,10 @@ CT_DoExecLog ALL mkdir -p "${CT_BUILD_DIR}"
|
|||||||
CT_DoExecLog ALL mkdir -p "${CT_CONFIG_DIR}"
|
CT_DoExecLog ALL mkdir -p "${CT_CONFIG_DIR}"
|
||||||
CT_DoExecLog ALL mkdir -p "${CT_INSTALL_DIR}"
|
CT_DoExecLog ALL mkdir -p "${CT_INSTALL_DIR}"
|
||||||
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}"
|
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}"
|
||||||
CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}"
|
if [ -z "${CT_CANADIAN}" ]; then
|
||||||
CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}"
|
CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}"
|
||||||
|
CT_DoExecLog ALL mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Only create the state dir if asked for a restartable build
|
# Only create the state dir if asked for a restartable build
|
||||||
[ -n "${CT_DEBUG_CT_SAVE_STEPS}" ] && CT_DoExecLog ALL mkdir -p "${CT_STATE_DIR}"
|
[ -n "${CT_DEBUG_CT_SAVE_STEPS}" ] && CT_DoExecLog ALL mkdir -p "${CT_STATE_DIR}"
|
||||||
@ -319,10 +321,17 @@ if [ -z "${CT_RESTART}" ]; then
|
|||||||
|
|
||||||
# Prepare mangling patterns to later modify BUILD and HOST (see below)
|
# Prepare mangling patterns to later modify BUILD and HOST (see below)
|
||||||
case "${CT_TOOLCHAIN_TYPE}" in
|
case "${CT_TOOLCHAIN_TYPE}" in
|
||||||
|
canadian)
|
||||||
|
CT_REAL_TARGET="${CT_TARGET}"
|
||||||
|
build_mangle="build_"
|
||||||
|
host_mangle="host_"
|
||||||
|
install_build_tools_for="BUILD HOST TARGET"
|
||||||
|
;;
|
||||||
cross)
|
cross)
|
||||||
CT_HOST="${CT_BUILD}"
|
CT_HOST="${CT_BUILD}"
|
||||||
build_mangle="build_"
|
build_mangle="build_"
|
||||||
host_mangle="build_"
|
host_mangle="build_"
|
||||||
|
install_build_tools_for="BUILD HOST"
|
||||||
;;
|
;;
|
||||||
*) CT_Abort "No code for '${CT_TOOLCHAIN_TYPE}' toolchain type!"
|
*) CT_Abort "No code for '${CT_TOOLCHAIN_TYPE}' toolchain type!"
|
||||||
;;
|
;;
|
||||||
@ -350,7 +359,7 @@ if [ -z "${CT_RESTART}" ]; then
|
|||||||
# cross-tools for those mangled tuples.
|
# cross-tools for those mangled tuples.
|
||||||
CT_DoLog DEBUG "Making build system tools available"
|
CT_DoLog DEBUG "Making build system tools available"
|
||||||
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/buildtools"
|
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/buildtools"
|
||||||
for m in BUILD HOST; do
|
for m in ${install_build_tools_for}; do
|
||||||
r="CT_REAL_${m}"
|
r="CT_REAL_${m}"
|
||||||
v="CT_${m}"
|
v="CT_${m}"
|
||||||
p="CT_${m}_PREFIX"
|
p="CT_${m}_PREFIX"
|
||||||
@ -418,6 +427,7 @@ if [ -z "${CT_RESTART}" ]; then
|
|||||||
# so don't add those PATHs in this case...
|
# so don't add those PATHs in this case...
|
||||||
case "${CT_TOOLCHAIN_TYPE}" in
|
case "${CT_TOOLCHAIN_TYPE}" in
|
||||||
cross) export PATH="${CT_PREFIX_DIR}/buildtools:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";;
|
cross) export PATH="${CT_PREFIX_DIR}/buildtools:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";;
|
||||||
|
canadian) export PATH="${CT_PREFIX_DIR}/buildtools:${PATH}";;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user