binutils/binutils: build statically

If the global static option is set, then build binutils statically.

Signed-off-by: "Bryan Hundven" <bryanhundven@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
Bryan Hundven" 2010-12-09 18:55:33 +01:00 committed by Bryan Hundven
parent c10e06ed81
commit bf3c89ebb5
2 changed files with 9 additions and 1 deletions

View File

@ -41,6 +41,7 @@ config STATIC_TOOLCHAIN
you can say 'Y' here, and all the host tools will be linked staticaly.
The impacted tools are:
- the GNU binutils
- the cross-gdb
The default is 'N', to build dynamicaly-linked host binaries.

View File

@ -18,6 +18,7 @@ do_binutils_extract() {
# Build binutils
do_binutils() {
local -a extra_config
local -a extra_make_flags
mkdir -p "${CT_BUILD_DIR}/build-binutils"
cd "${CT_BUILD_DIR}/build-binutils"
@ -40,8 +41,14 @@ do_binutils() {
${CT_BINUTILS_EXTRA_CONFIG} \
${BINUTILS_SYSROOT_ARG}
if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
extra_make_flags+=("LDFLAGS=-all-static")
CT_DoLog EXTRA "Prepare binutils for static build"
CT_DoExecLog ALL make configure-host
fi
CT_DoLog EXTRA "Building binutils"
CT_DoExecLog ALL make ${PARALLELMFLAGS}
CT_DoExecLog ALL make "${extra_make_flags[@]}" ${PARALLELMFLAGS}
CT_DoLog EXTRA "Installing binutils"
CT_DoExecLog ALL make install