2007-02-24 11:00:05 +00:00
|
|
|
# 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
|
|
|
|
|
2007-05-07 09:04:02 +00:00
|
|
|
# Download binutils
|
|
|
|
do_binutils_get() {
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_Fetch BINUTILS
|
2012-11-19 10:21:31 +00:00
|
|
|
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_Fetch ELF2FLT
|
2012-11-19 10:21:31 +00:00
|
|
|
fi
|
2007-05-07 09:04:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Extract binutils
|
|
|
|
do_binutils_extract() {
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_ExtractPatch BINUTILS
|
2012-11-19 10:21:31 +00:00
|
|
|
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
|
2017-05-30 05:32:38 +00:00
|
|
|
CT_ExtractPatch ELF2FLT
|
2013-07-24 22:10:47 +00:00
|
|
|
fi
|
2007-05-07 09:04:02 +00:00
|
|
|
}
|
|
|
|
|
2011-07-24 21:52:28 +00:00
|
|
|
# Build binutils for build -> target
|
|
|
|
do_binutils_for_build() {
|
|
|
|
local -a binutils_opts
|
|
|
|
|
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
|
|
|
native|cross) return 0;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
CT_DoStep INFO "Installing binutils for build"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-binutils-build-${CT_BUILD}"
|
|
|
|
|
|
|
|
binutils_opts+=( "host=${CT_BUILD}" )
|
|
|
|
binutils_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
|
2012-11-16 14:25:57 +00:00
|
|
|
binutils_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
|
|
|
|
binutils_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
|
2011-07-24 21:52:28 +00:00
|
|
|
|
|
|
|
do_binutils_backend "${binutils_opts[@]}"
|
|
|
|
|
|
|
|
CT_Popd
|
2012-11-19 10:21:31 +00:00
|
|
|
|
|
|
|
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
|
|
|
|
# We re-use binutils' options, plus our owns
|
2017-05-30 05:32:38 +00:00
|
|
|
binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils" )
|
2012-11-19 10:21:31 +00:00
|
|
|
binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-build-${CT_BUILD}" )
|
|
|
|
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-build-${CT_BUILD}"
|
|
|
|
|
|
|
|
do_elf2flt_backend "${binutils_opts[@]}"
|
|
|
|
|
|
|
|
CT_Popd
|
|
|
|
fi
|
|
|
|
|
2011-07-24 21:52:28 +00:00
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
2011-07-17 16:29:35 +00:00
|
|
|
# Build binutils for host -> target
|
|
|
|
do_binutils_for_host() {
|
|
|
|
local -a binutils_opts
|
|
|
|
|
|
|
|
CT_DoStep INFO "Installing binutils for host"
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}"
|
|
|
|
|
|
|
|
binutils_opts+=( "host=${CT_HOST}" )
|
|
|
|
binutils_opts+=( "prefix=${CT_PREFIX_DIR}" )
|
|
|
|
binutils_opts+=( "static_build=${CT_STATIC_TOOLCHAIN}" )
|
|
|
|
binutils_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
|
2012-11-16 14:25:57 +00:00
|
|
|
binutils_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
|
2011-07-17 16:29:35 +00:00
|
|
|
binutils_opts+=( "build_manuals=${CT_BUILD_MANUALS}" )
|
|
|
|
|
|
|
|
do_binutils_backend "${binutils_opts[@]}"
|
|
|
|
|
2012-11-19 10:21:31 +00:00
|
|
|
CT_Popd
|
|
|
|
|
|
|
|
if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
|
|
|
|
# We re-use binutils' options, plus our owns
|
2017-05-30 05:32:38 +00:00
|
|
|
binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils" )
|
2012-11-19 10:21:31 +00:00
|
|
|
binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" )
|
|
|
|
|
|
|
|
CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-host-${CT_HOST}"
|
|
|
|
|
|
|
|
do_elf2flt_backend "${binutils_opts[@]}"
|
|
|
|
|
|
|
|
CT_Popd
|
|
|
|
fi
|
|
|
|
|
2011-07-17 16:29:35 +00:00
|
|
|
# Make those new tools available to the core C compilers to come.
|
2014-02-04 07:40:45 +00:00
|
|
|
# Note: some components want the ${TARGET}-{ar,as,ld,ranlib,strip} commands
|
|
|
|
# as well. Create that.
|
2011-07-17 16:29:35 +00:00
|
|
|
# Don't do it for canadian or cross-native, because the binutils
|
|
|
|
# are not executable on the build machine.
|
|
|
|
case "${CT_TOOLCHAIN_TYPE}" in
|
|
|
|
cross|native)
|
|
|
|
mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/bin"
|
2017-04-01 17:12:05 +00:00
|
|
|
CT_SymlinkTools "${CT_BUILDTOOLS_PREFIX_DIR}/bin" \
|
|
|
|
"${CT_PREFIX_DIR}/bin" \
|
|
|
|
"${CT_TARGET}"
|
|
|
|
CT_DoExecLog ALL mkdir -p "${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}"
|
|
|
|
CT_DoExecLog ALL ln -sv "${CT_PREFIX_DIR}/${CT_TARGET}/bin" \
|
|
|
|
"${CT_BUILDTOOLS_PREFIX_DIR}/${CT_TARGET}/bin"
|
2011-07-17 16:29:35 +00:00
|
|
|
;;
|
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
CT_EndStep
|
|
|
|
}
|
|
|
|
|
|
|
|
# Build binutils for X -> target
|
|
|
|
# Parameter : description : type : default
|
|
|
|
# host : machine to run on : tuple : (none)
|
|
|
|
# prefix : prefix to install into : dir : (none)
|
|
|
|
# static_build : build statcially : bool : no
|
2012-11-16 14:25:57 +00:00
|
|
|
# cflags : cflags to use : string : (empty)
|
|
|
|
# ldflags : ldflags to use : string : (empty)
|
2011-07-17 16:29:35 +00:00
|
|
|
# build_manuals : whether to build manuals : bool : no
|
|
|
|
do_binutils_backend() {
|
|
|
|
local host
|
|
|
|
local prefix
|
|
|
|
local static_build
|
|
|
|
local cflags
|
2012-11-16 14:25:57 +00:00
|
|
|
local ldflags
|
2011-07-17 16:29:35 +00:00
|
|
|
local build_manuals=no
|
2009-08-19 17:44:44 +00:00
|
|
|
local -a extra_config
|
2010-12-09 17:55:33 +00:00
|
|
|
local -a extra_make_flags
|
2011-11-15 21:06:21 +00:00
|
|
|
local -a manuals_for
|
|
|
|
local -a manuals_install
|
2011-07-17 16:29:35 +00:00
|
|
|
local arg
|
2009-08-19 17:44:44 +00:00
|
|
|
|
2011-07-17 16:29:35 +00:00
|
|
|
for arg in "$@"; do
|
|
|
|
eval "${arg// /\\ }"
|
|
|
|
done
|
2007-02-24 11:00:05 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Configuring binutils"
|
2010-12-27 23:11:33 +00:00
|
|
|
|
2021-09-21 07:46:06 +00:00
|
|
|
case "${CT_BINUTILS_LINKERS_LIST}" in
|
|
|
|
ld)
|
|
|
|
extra_config+=( --enable-ld=yes --enable-gold=no )
|
|
|
|
;;
|
|
|
|
gold)
|
|
|
|
extra_config+=( --enable-ld=no --enable-gold=yes )
|
|
|
|
;;
|
|
|
|
ld,gold)
|
|
|
|
extra_config+=( --enable-ld=default --enable-gold=yes )
|
|
|
|
;;
|
|
|
|
gold,ld)
|
|
|
|
extra_config+=( --enable-ld=yes --enable-gold=default )
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if [ "${CT_BINUTILS_GOLD_THREADS}" = "y" ]; then
|
|
|
|
extra_config+=( --enable-threads )
|
2010-12-27 23:11:33 +00:00
|
|
|
fi
|
2011-01-02 12:56:05 +00:00
|
|
|
if [ "${CT_BINUTILS_PLUGINS}" = "y" ]; then
|
|
|
|
extra_config+=( --enable-plugins )
|
|
|
|
fi
|
2019-10-10 16:57:07 +00:00
|
|
|
if [ "${CT_BINUTILS_RELRO}" = "y" ]; then
|
2018-12-04 03:27:30 +00:00
|
|
|
extra_config+=( --enable-relro )
|
|
|
|
elif [ "${CT_BINUTILS_RELRO}" != "m" ]; then
|
|
|
|
extra_config+=( --disable-relro )
|
|
|
|
fi
|
2019-10-10 16:56:22 +00:00
|
|
|
if [ "${CT_BINUTILS_DETERMINISTIC_ARCHIVES}" = "y" ]; then
|
|
|
|
extra_config+=( --enable-deterministic-archives )
|
|
|
|
fi
|
2021-09-21 07:46:06 +00:00
|
|
|
[ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
|
|
|
|
[ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")
|
2011-11-23 22:27:12 +00:00
|
|
|
if [ "${CT_MULTILIB}" = "y" ]; then
|
|
|
|
extra_config+=("--enable-multilib")
|
|
|
|
else
|
|
|
|
extra_config+=("--disable-multilib")
|
|
|
|
fi
|
2010-12-27 23:11:33 +00:00
|
|
|
|
2015-11-25 04:40:44 +00:00
|
|
|
# Disable gdb when building from the binutils-gdb repository.
|
|
|
|
extra_config+=("--disable-sim")
|
|
|
|
extra_config+=("--disable-gdb")
|
|
|
|
|
2022-02-20 08:46:21 +00:00
|
|
|
# libdebuginfod in incompatible with static linking
|
|
|
|
[ "${CT_STATIC_TOOLCHAIN}" = "y" ] && extra_config+=("--without-debuginfod")
|
|
|
|
|
2011-11-17 09:59:44 +00:00
|
|
|
[ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ] && extra_config+=("--disable-nls")
|
|
|
|
|
2023-02-25 03:04:57 +00:00
|
|
|
if [ "${CT_COMP_LIBS_ZSTD}}" = "y" ]; then
|
|
|
|
extra_config+=("--with-zstd=${complibs}")
|
|
|
|
else
|
|
|
|
extra_config+=("--without-zstd")
|
|
|
|
fi
|
|
|
|
|
2010-12-27 23:11:33 +00:00
|
|
|
CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
|
|
|
|
|
2010-10-22 20:02:57 +00:00
|
|
|
CT_DoExecLog CFG \
|
2017-04-02 20:18:07 +00:00
|
|
|
CC_FOR_BUILD="${CT_BUILD}-gcc" \
|
2017-06-16 06:07:00 +00:00
|
|
|
CFLAGS_FOR_BUILD="${CT_CFLAGS_FOR_BUILD}" \
|
2021-07-06 15:05:25 +00:00
|
|
|
CXXFLAGS_FOR_BUILD="${CT_CFLAGS_FOR_BUILD} ${CT_CXXFLAGS_FOR_BUILD}" \
|
2017-06-16 06:07:00 +00:00
|
|
|
LDFLAGS_FOR_BUILD="${CT_LDFLAGS_FOR_BUILD}" \
|
2011-07-17 16:29:35 +00:00
|
|
|
CFLAGS="${cflags}" \
|
2021-07-06 15:05:25 +00:00
|
|
|
CXXFLAGS="${cflags} ${CT_CXXFLAGS_FOR_BUILD}" \
|
2012-11-16 14:25:57 +00:00
|
|
|
LDFLAGS="${ldflags}" \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
2017-05-30 05:32:38 +00:00
|
|
|
"${CT_SRC_DIR}/binutils/configure" \
|
2009-01-04 14:21:00 +00:00
|
|
|
--build=${CT_BUILD} \
|
2011-07-17 16:29:35 +00:00
|
|
|
--host=${host} \
|
2009-01-04 14:21:00 +00:00
|
|
|
--target=${CT_TARGET} \
|
2011-07-17 16:29:35 +00:00
|
|
|
--prefix=${prefix} \
|
2009-01-04 14:21:00 +00:00
|
|
|
--disable-werror \
|
2009-08-19 17:44:44 +00:00
|
|
|
"${extra_config[@]}" \
|
2009-01-04 14:21:00 +00:00
|
|
|
${CT_ARCH_WITH_FLOAT} \
|
2017-08-20 06:11:27 +00:00
|
|
|
${CT_BINUTILS_SYSROOT_ARG} \
|
2011-05-18 21:00:46 +00:00
|
|
|
"${CT_BINUTILS_EXTRA_CONFIG_ARRAY[@]}"
|
2007-02-24 11:00:05 +00:00
|
|
|
|
2011-07-17 16:29:35 +00:00
|
|
|
if [ "${static_build}" = "y" ]; then
|
2015-12-07 19:21:34 +00:00
|
|
|
extra_make_flags+=("LDFLAGS=${ldflags} -all-static")
|
2010-12-09 17:55:33 +00:00
|
|
|
CT_DoLog EXTRA "Prepare binutils for static build"
|
2019-04-04 23:47:50 +00:00
|
|
|
CT_DoExecLog ALL make ${CT_JOBSFLAGS} configure-host
|
2010-12-09 17:55:33 +00:00
|
|
|
fi
|
|
|
|
|
2007-02-24 11:00:05 +00:00
|
|
|
CT_DoLog EXTRA "Building binutils"
|
2019-04-04 23:47:50 +00:00
|
|
|
CT_DoExecLog ALL make "${extra_make_flags[@]}" ${CT_JOBSFLAGS}
|
2007-02-24 11:00:05 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing binutils"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make install
|
2007-02-24 11:00:05 +00:00
|
|
|
|
2018-12-11 16:55:07 +00:00
|
|
|
if [ "${CT_BINUTILS_PLUGINS}" = "y" ]; then
|
|
|
|
# Create a directory for plugins such as LTO (to be installed by
|
|
|
|
# their providers later)
|
|
|
|
CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/lib/bfd-plugins"
|
|
|
|
fi
|
|
|
|
|
2011-07-17 16:29:35 +00:00
|
|
|
if [ "${build_manuals}" = "y" ]; then
|
2011-11-15 21:06:21 +00:00
|
|
|
CT_DoLog EXTRA "Building and installing the binutils manuals"
|
|
|
|
manuals_for=( gas binutils ld gprof )
|
|
|
|
if [ "${CT_BINUTILS_LINKER_GOLD}" = "y" ]; then
|
|
|
|
manuals_for+=( gold )
|
|
|
|
fi
|
2017-01-29 19:38:38 +00:00
|
|
|
manuals_install=( "${manuals_for[@]/#/install-pdf-}" )
|
|
|
|
manuals_install+=( "${manuals_for[@]/#/install-html-}" )
|
2019-04-04 23:47:50 +00:00
|
|
|
CT_DoExecLog ALL make ${CT_JOBSFLAGS} pdf html
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make "${manuals_install[@]}"
|
2011-11-15 21:06:21 +00:00
|
|
|
fi
|
|
|
|
|
2010-12-29 17:19:40 +00:00
|
|
|
# Install the wrapper if needed
|
|
|
|
if [ "${CT_BINUTILS_LD_WRAPPER}" = "y" ]; then
|
|
|
|
CT_DoLog EXTRA "Installing ld wrapper"
|
2011-07-17 16:29:35 +00:00
|
|
|
rm -f "${prefix}/bin/${CT_TARGET}-ld"
|
|
|
|
rm -f "${prefix}/${CT_TARGET}/bin/ld"
|
2017-02-27 03:06:35 +00:00
|
|
|
sed -r -e "s/@@DEFAULT_LD@@/${CT_BINUTILS_LINKER_DEFAULT}/" \
|
2018-12-05 00:15:37 +00:00
|
|
|
"${CT_LIB_DIR}/packages/binutils/binutils-ld.in" \
|
2011-07-17 16:29:35 +00:00
|
|
|
>"${prefix}/bin/${CT_TARGET}-ld"
|
2018-09-27 06:54:55 +00:00
|
|
|
chmod a+x "${prefix}/bin/${CT_TARGET}-ld"
|
2011-07-17 16:29:35 +00:00
|
|
|
cp -a "${prefix}/bin/${CT_TARGET}-ld" \
|
|
|
|
"${prefix}/${CT_TARGET}/bin/ld"
|
2011-04-04 23:02:28 +00:00
|
|
|
|
2018-11-01 22:50:12 +00:00
|
|
|
# If needed, force using ld.bfd during the toolchain build.
|
|
|
|
# Note that
|
|
|
|
if [ "${CT_BINUTILS_FORCE_LD_BFD_DEFAULT}" = "y" ]; then
|
|
|
|
CT_EnvModify export CTNG_LD_IS bfd
|
2011-04-04 23:02:28 +00:00
|
|
|
fi
|
2010-12-29 17:19:40 +00:00
|
|
|
fi
|
2008-04-28 07:38:36 +00:00
|
|
|
}
|
|
|
|
|
2012-11-19 10:21:31 +00:00
|
|
|
# Build elf2flt for X -> target
|
|
|
|
# Parameter : description : type : default
|
|
|
|
# host : machine to run on : tuple : (none)
|
|
|
|
# prefix : prefix to install into : dir : (none)
|
|
|
|
# static_build : build statcially : bool : no
|
|
|
|
# cflags : cflags to use : string : (empty)
|
|
|
|
# ldflags : ldflags to use : string : (empty)
|
|
|
|
# binutils_src : source dir of binutils : dir : (none)
|
|
|
|
# binutils_bld : build dir of binutils : dir : (none)
|
|
|
|
# build_manuals : whether to build manuals : bool : no
|
|
|
|
do_elf2flt_backend() {
|
|
|
|
local host
|
|
|
|
local prefix
|
|
|
|
local static_build
|
|
|
|
local cflags
|
|
|
|
local ldflags
|
|
|
|
local binutils_bld
|
|
|
|
local binutils_src
|
|
|
|
local build_manuals
|
|
|
|
local arg
|
|
|
|
|
|
|
|
for arg in "$@"; do
|
|
|
|
eval "${arg// /\\ }"
|
|
|
|
done
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Configuring elf2flt"
|
|
|
|
CT_DoExecLog CFG \
|
|
|
|
CFLAGS="${cflags}" \
|
|
|
|
LDFLAGS="${ldflags}" \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
2017-07-02 20:12:53 +00:00
|
|
|
"${CT_SRC_DIR}/elf2flt/configure" \
|
2012-11-19 10:21:31 +00:00
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${host} \
|
|
|
|
--target=${CT_TARGET} \
|
|
|
|
--prefix=${prefix} \
|
|
|
|
--with-bfd-include-dir=${binutils_bld}/bfd \
|
|
|
|
--with-binutils-include-dir=${binutils_src}/include \
|
2023-11-25 05:03:39 +00:00
|
|
|
--with-libbfd=${binutils_bld}/bfd/.libs/libbfd.a \
|
2012-11-19 10:21:31 +00:00
|
|
|
--with-libiberty=${binutils_bld}/libiberty/libiberty.a \
|
2016-09-20 20:28:29 +00:00
|
|
|
--disable-werror \
|
2012-11-19 10:21:31 +00:00
|
|
|
${elf2flt_opts} \
|
|
|
|
"${CT_ELF2FLT_EXTRA_CONFIG_ARRAY[@]}"
|
|
|
|
|
|
|
|
CT_DoLog EXTRA "Building elf2flt"
|
2019-04-04 23:47:50 +00:00
|
|
|
CT_DoExecLog ALL make ${CT_JOBSFLAGS} CPU=${CT_ARCH}
|
2012-11-19 10:21:31 +00:00
|
|
|
|
|
|
|
CT_DoLog EXTRA "Installing elf2flt"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make install
|
2012-11-19 10:21:31 +00:00
|
|
|
}
|
|
|
|
|
2008-04-28 07:38:36 +00:00
|
|
|
# Now on for the target libraries
|
2012-03-04 16:31:23 +00:00
|
|
|
do_binutils_for_target() {
|
2009-08-19 17:44:44 +00:00
|
|
|
local -a extra_config
|
|
|
|
local -a targets
|
|
|
|
local -a build_targets
|
|
|
|
local -a install_targets
|
|
|
|
local t
|
|
|
|
|
2022-09-12 18:22:12 +00:00
|
|
|
[ "${CT_BINUTILS_FOR_TARGET_IBERTY}" = "y" ] && targets+=("libiberty")
|
|
|
|
[ "${CT_BINUTILS_FOR_TARGET_BFD}" = "y" ] && targets+=("bfd")
|
|
|
|
[ "${CT_BINUTILS_FOR_TARGET_OPCODES}" = "y" ] && targets+=("opcodes")
|
2009-08-19 17:44:44 +00:00
|
|
|
for t in "${targets[@]}"; do
|
|
|
|
build_targets+=("all-${t}")
|
|
|
|
install_targets+=("install-${t}")
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "${#targets[@]}" -ne 0 ]; then
|
2008-04-27 15:08:15 +00:00
|
|
|
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"
|
2011-05-31 18:39:42 +00:00
|
|
|
|
2021-09-21 07:46:06 +00:00
|
|
|
[ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
|
|
|
|
[ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")
|
2011-11-23 22:27:12 +00:00
|
|
|
if [ "${CT_MULTILIB}" = "y" ]; then
|
|
|
|
extra_config+=("--enable-multilib")
|
|
|
|
else
|
|
|
|
extra_config+=("--disable-multilib")
|
|
|
|
fi
|
2011-05-31 18:39:42 +00:00
|
|
|
|
2016-01-02 11:15:07 +00:00
|
|
|
if [ "${CT_BINUTILS_FOR_TARGET_IBERTY}" = "y" ]; then
|
|
|
|
extra_config+=("--enable-install-libiberty")
|
|
|
|
fi
|
|
|
|
|
2011-11-17 09:59:44 +00:00
|
|
|
[ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ] && extra_config+=("--disable-nls")
|
|
|
|
|
2011-03-03 22:29:07 +00:00
|
|
|
CT_DoExecLog CFG \
|
2017-01-25 08:06:28 +00:00
|
|
|
${CONFIG_SHELL} \
|
2017-05-30 05:32:38 +00:00
|
|
|
"${CT_SRC_DIR}/binutils/configure" \
|
2009-01-04 14:21:00 +00:00
|
|
|
--build=${CT_BUILD} \
|
|
|
|
--host=${CT_TARGET} \
|
|
|
|
--target=${CT_TARGET} \
|
|
|
|
--prefix=/usr \
|
|
|
|
--disable-werror \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-static \
|
2009-08-19 17:44:44 +00:00
|
|
|
"${extra_config[@]}" \
|
2009-01-04 14:21:00 +00:00
|
|
|
${CT_ARCH_WITH_FLOAT} \
|
2011-12-12 19:24:05 +00:00
|
|
|
"${CT_BINUTILS_EXTRA_CONFIG_ARRAY[@]}"
|
2008-04-27 15:08:15 +00:00
|
|
|
|
2009-08-19 17:44:44 +00:00
|
|
|
CT_DoLog EXTRA "Building binutils' libraries (${targets[*]}) for target"
|
2019-04-04 23:47:50 +00:00
|
|
|
CT_DoExecLog ALL make ${CT_JOBSFLAGS} "${build_targets[@]}"
|
2009-08-19 17:44:44 +00:00
|
|
|
CT_DoLog EXTRA "Installing binutils' libraries (${targets[*]}) for target"
|
2016-11-21 07:50:17 +00:00
|
|
|
CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" "${install_targets[@]}"
|
2008-04-27 15:08:15 +00:00
|
|
|
|
|
|
|
CT_Popd
|
|
|
|
CT_EndStep
|
|
|
|
fi
|
2007-02-24 11:00:05 +00:00
|
|
|
}
|