summaryrefslogtreecommitdiff
path: root/scripts/build/cc
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build/cc')
-rw-r--r--scripts/build/cc/gcc.sh (renamed from scripts/build/cc/100-gcc.sh)63
1 files changed, 21 insertions, 42 deletions
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/gcc.sh
index 2ca8e6f..6019b35 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -3,53 +3,32 @@
# Licensed under the GPL v2. See COPYING in the root of this package
# Download gcc
-do_gcc_get() {
+do_cc_get() {
local linaro_version=""
local linaro_series=""
- if [ "${CT_CC_GCC_CUSTOM}" = "y" ]; then
- CT_GetCustom "gcc" "${CT_CC_GCC_CUSTOM_VERSION}" \
- "${CT_CC_GCC_CUSTOM_LOCATION}"
- else
- case "${CT_CC_GCC_VERSION}" in
- linaro-*)
- CT_GetLinaro "gcc" "${CT_CC_GCC_VERSION}"
- ;;
- *)
- # The official gcc hosts put gcc under a gcc/release/ directory,
- # whereas the mirrors put it in the gcc/ directory.
- CT_GetFile "gcc-${CT_CC_GCC_VERSION}" \
- {http,ftp,https}://ftp.gnu.org/gnu/gcc/gcc-${CT_CC_GCC_VERSION} \
- ftp://{gcc.gnu.org,sourceware.org}/pub/gcc/releases/gcc-${CT_CC_GCC_VERSION}
- ;;
- esac
- fi # ! custom location
+ CT_Fetch GCC
+
# Starting with GCC 4.3, ecj is used for Java, and will only be
# built if the configure script finds ecj.jar at the top of the
# GCC source tree, which will not be there unless we get it and
# put it there ourselves
if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" ]; then
- CT_GetFile ecj-latest .jar http://mirrors.kernel.org/sourceware/java/ \
- http://crosstool-ng.org/pub/java \
- ftp://gcc.gnu.org/pub/java \
- ftp://sourceware.org/pub/java
+ if ! CT_GetFile ecj-latest .jar $(CT_Mirrors sourceware java); then
+ # Should be a package, too - but with Java retirement in GCC,
+ # it may not make sense.
+ CT_Abort "Failed to download ecj-latest.jar"
+ fi
fi
}
# Extract gcc
-do_gcc_extract() {
- CT_Extract "gcc-${CT_CC_GCC_VERSION}"
- CT_Patch "gcc" "${CT_CC_GCC_VERSION}"
+do_cc_extract() {
+ CT_ExtractPatch GCC
# Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
- if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" \
- -a ! -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/ecj.jar" \
- ]; then
- CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/ecj.jar"
- fi
-
- if [ -n "${CT_ARCH_XTENSA_CUSTOM_NAME}" ]; then
- CT_ConfigureXtensa "gcc" "${CT_CC_GCC_VERSION}"
+ if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" -a ! -f "${CT_SRC_DIR}/gcc/ecj.jar" ]; then
+ CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc/ecj.jar"
fi
}
@@ -205,7 +184,7 @@ cc_gcc_multilib_housekeeping() {
#------------------------------------------------------------------------------
# Core gcc pass 1
-do_gcc_core_pass_1() {
+do_cc_core_pass_1() {
local -a core_opts
if [ "${CT_CC_CORE_PASS_1_NEEDED}" != "y" ]; then
@@ -231,7 +210,7 @@ do_gcc_core_pass_1() {
}
# Core gcc pass 2
-do_gcc_core_pass_2() {
+do_cc_core_pass_2() {
local -a core_opts
if [ "${CT_CC_CORE_PASS_2_NEEDED}" != "y" ]; then
@@ -575,7 +554,7 @@ do_gcc_core_backend() {
CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \
${CONFIG_SHELL} \
- "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/configure" \
+ "${CT_SRC_DIR}/gcc/configure" \
--build=${CT_BUILD} \
--host=${host} \
--target=${CT_TARGET} \
@@ -603,7 +582,7 @@ do_gcc_core_backend() {
# so we configure then build it.
# Next we have to configure gcc, create libgcc.mk then edit it...
# So much easier if we just edit the source tree, but hey...
- if [ ! -f "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/gcc/BASE-VER" ]; then
+ if [ ! -f "${CT_SRC_DIR}/gcc/gcc/BASE-VER" ]; then
CT_DoExecLog CFG make ${JOBSFLAGS} configure-libiberty
CT_DoExecLog ALL make ${JOBSFLAGS} -C libiberty libiberty.a
CT_DoExecLog CFG make ${JOBSFLAGS} configure-gcc configure-libcpp
@@ -613,12 +592,12 @@ do_gcc_core_backend() {
CT_DoExecLog ALL make ${JOBSFLAGS} all-libcpp all-build-libiberty
fi
# HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
- if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/libdecnumber" ]; then
+ if [ -d "${CT_SRC_DIR}/gcc/libdecnumber" ]; then
CT_DoExecLog CFG make ${JOBSFLAGS} configure-libdecnumber
CT_DoExecLog ALL make ${JOBSFLAGS} -C libdecnumber libdecnumber.a
fi
# HACK: gcc-4.8 uses libbacktrace to make libgcc.mvars, so make it here.
- if [ -d "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/libbacktrace" ]; then
+ if [ -d "${CT_SRC_DIR}/gcc/libbacktrace" ]; then
CT_DoExecLog CFG make ${JOBSFLAGS} configure-libbacktrace
CT_DoExecLog ALL make ${JOBSFLAGS} -C libbacktrace
fi
@@ -711,7 +690,7 @@ do_gcc_core_backend() {
#------------------------------------------------------------------------------
# Build complete gcc to run on build
-do_gcc_for_build() {
+do_cc_for_build() {
local -a build_final_opts
local build_final_backend
@@ -796,7 +775,7 @@ gcc_movelibs() {
#------------------------------------------------------------------------------
# Build final gcc to run on host
-do_gcc_for_host() {
+do_cc_for_host() {
local -a final_opts
local final_backend
@@ -1121,7 +1100,7 @@ do_gcc_backend() {
CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \
LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \
${CONFIG_SHELL} \
- "${CT_SRC_DIR}/gcc-${CT_CC_GCC_VERSION}/configure" \
+ "${CT_SRC_DIR}/gcc/configure" \
--build=${CT_BUILD} \
--host=${host} \
--target=${CT_TARGET} \