mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-20 13:23:08 +00:00
1b9a490601
Some (most) of the sites we use toretrieve tarballs have http equivallent for the ftp service. Use http as a failover. There's no solution for those sites that do not have such an http equivalent. /trunk/scripts/build/binutils.sh | 5 2 3 0 ++--- /trunk/scripts/build/libc_glibc.sh | 4 2 2 0 ++-- /trunk/scripts/build/libc_uClibc.sh | 2 1 1 0 +- /trunk/scripts/build/debug/400-ltrace.sh | 2 1 1 0 +- /trunk/scripts/build/debug/300-gdb.sh | 8 3 5 0 +++----- /trunk/scripts/build/kernel_linux.sh | 7 2 5 0 ++----- /trunk/scripts/build/cc_gcc.sh | 6 2 4 0 ++---- /trunk/scripts/build/gmp.sh | 4 1 3 0 +--- 8 files changed, 14 insertions(+), 24 deletions(-)
104 lines
4.1 KiB
Bash
104 lines
4.1 KiB
Bash
# This file adds functions to build binutils
|
|
# Copyright 2007 Yann E. MORIN
|
|
# Licensed under the GPL v2. See COPYING in the root of this package
|
|
|
|
do_print_filename() {
|
|
echo "binutils-${CT_BINUTILS_VERSION}"
|
|
}
|
|
|
|
# Download binutils
|
|
do_binutils_get() {
|
|
CT_GetFile "${CT_BINUTILS_FILE}" \
|
|
{ftp,http}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils
|
|
}
|
|
|
|
# Extract binutils
|
|
do_binutils_extract() {
|
|
CT_ExtractAndPatch "${CT_BINUTILS_FILE}"
|
|
}
|
|
|
|
# Build binutils
|
|
do_binutils() {
|
|
mkdir -p "${CT_BUILD_DIR}/build-binutils"
|
|
cd "${CT_BUILD_DIR}/build-binutils"
|
|
|
|
CT_DoStep INFO "Installing binutils"
|
|
|
|
binutils_opts=
|
|
# If GMP and MPFR were configured, then use that,
|
|
# otherwise let binutils find the system-wide libraries, if they exist.
|
|
if [ "${CT_CC_GCC_GMP_MPFR}" = "y" ]; then
|
|
binutils_opts="--with-gmp=${CT_PREFIX_DIR} --with-mpfr=${CT_PREFIX_DIR}"
|
|
fi
|
|
|
|
CT_DoLog EXTRA "Configuring binutils"
|
|
CFLAGS="${CT_CFLAGS_FOR_HOST}" \
|
|
"${CT_SRC_DIR}/${CT_BINUTILS_FILE}/configure" \
|
|
${CT_CANADIAN_OPT} \
|
|
--build=${CT_BUILD} \
|
|
--host=${CT_HOST} \
|
|
--target=${CT_TARGET} \
|
|
--prefix=${CT_PREFIX_DIR} \
|
|
--disable-nls \
|
|
${binutils_opts} \
|
|
${CT_BINUTILS_EXTRA_CONFIG} \
|
|
${BINUTILS_SYSROOT_ARG} 2>&1 |CT_DoLog ALL
|
|
|
|
CT_DoLog EXTRA "Building binutils"
|
|
make ${PARALLELMFLAGS} 2>&1 |CT_DoLog ALL
|
|
|
|
CT_DoLog EXTRA "Installing binutils"
|
|
make install 2>&1 |CT_DoLog ALL
|
|
|
|
# Make those new tools available to the core C compilers to come.
|
|
# Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
|
|
# well. Create that.
|
|
mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin"
|
|
mkdir -p "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin"
|
|
mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin"
|
|
mkdir -p "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin"
|
|
for t in ar as ld strip; do
|
|
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
|
|
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_STATIC_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
|
|
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/${CT_TARGET}/bin/${t}"
|
|
ln -sv "${CT_PREFIX_DIR}/bin/${CT_TARGET}-${t}" "${CT_CC_CORE_SHARED_PREFIX_DIR}/bin/${CT_TARGET}-${t}"
|
|
done |CT_DoLog ALL
|
|
|
|
CT_EndStep
|
|
}
|
|
|
|
# Now on for the target libraries
|
|
do_binutils_target() {
|
|
targets=
|
|
[ "${CT_BINUTILS_FOR_TARGET_IBERTY}" = "y" ] && targets="${targets} libiberty"
|
|
[ "${CT_BINUTILS_FOR_TARGET_BFD}" = "y" ] && targets="${targets} bfd"
|
|
targets="${targets# }"
|
|
|
|
if [ -n "${targets}" ]; then
|
|
CT_DoStep INFO "Installing binutils for target"
|
|
mkdir -p "${CT_BUILD_DIR}/build-binutils-for-target"
|
|
CT_Pushd "${CT_BUILD_DIR}/build-binutils-for-target"
|
|
|
|
CT_DoLog EXTRA "Configuring binutils for target"
|
|
"${CT_SRC_DIR}/${CT_BINUTILS_FILE}/configure" \
|
|
--build=${CT_BUILD} \
|
|
--host=${CT_TARGET} \
|
|
--target=${CT_TARGET} \
|
|
--prefix=/usr \
|
|
--enable-shared --enable-static \
|
|
${CT_BINUTILS_EXTRA_CONFIG} \
|
|
--disable-nls 2>&1 |CT_DoLog ALL
|
|
|
|
build_targets=$(echo "${targets}" |sed -r -e 's/(^| +)/\1all-/g;')
|
|
install_targets=$(echo "${targets}" |sed -r -e 's/(^| +)/\1install-/g;')
|
|
|
|
CT_DoLog EXTRA "Building binutils' libraries (${targets}) for target"
|
|
make ${PARALLELMFLAGS} ${build_targets} 2>&1 |CT_DoLog ALL
|
|
CT_DoLog EXTRA "Installing binutils' libraries (${targets}) for target"
|
|
make DESTDIR="${CT_SYSROOT_DIR}" ${install_targets} 2>&1 |CT_DoLog ALL
|
|
|
|
CT_Popd
|
|
CT_EndStep
|
|
fi
|
|
}
|