Skip to content

Commit

Permalink
Move companion tool build into a separate step.
Browse files Browse the repository at this point in the history
Also, rename "build" -> "for_build", since we're going to have a "for_host"
as well.

Signed-off-by: Alexey Neyman <stilor@att.net>
  • Loading branch information
stilor committed Dec 2, 2016
1 parent f7f70b6 commit 3f7fbd7
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 17 deletions.
9 changes: 4 additions & 5 deletions scripts/build/companion_tools.sh
Expand Up @@ -7,11 +7,11 @@ for f in "${CT_LIB_DIR}/scripts/build/companion_tools/"*.sh; do
_f="${_f#???-}"
__f="CT_COMP_TOOLS_${_f}"
if [ "${!__f}" = "y" ]; then
CT_DoLog DEBUG "Enabling companion tools '${_f}'"
CT_DoLog DEBUG "Enabling companion tool '${_f}'"
. "${f}"
CT_COMP_TOOLS_FACILITY_LIST="${CT_COMP_TOOLS_FACILITY_LIST} ${_f}"
else
CT_DoLog DEBUG "Disabling companion tools '${_f}'"
CT_DoLog DEBUG "Disabling companion tool '${_f}'"
fi
done

Expand All @@ -30,9 +30,8 @@ do_companion_tools_extract() {
}

# Build the companion tools facilities
do_companion_tools() {
do_companion_tools_for_build() {
for f in ${CT_COMP_TOOLS_FACILITY_LIST}; do
do_companion_tools_${f}_build
do_companion_tools_${f}_for_build
done
}

7 changes: 6 additions & 1 deletion scripts/build/companion_tools/050-make.sh
Expand Up @@ -11,14 +11,19 @@ do_companion_tools_make_extract() {
CT_Patch "make" "${CT_MAKE_VERSION}"
}

do_companion_tools_make_build() {
do_companion_tools_make_for_build() {
CT_DoStep EXTRA "Installing make"
mkdir -p "${CT_BUILD_DIR}/build-make"
CT_Pushd "${CT_BUILD_DIR}/build-make"

CT_DoLog EXTRA "Configuring make"
CT_DoExecLog CFG "${CT_SRC_DIR}/make-${CT_MAKE_VERSION}/configure" \
--prefix="${CT_BUILDTOOLS_PREFIX_DIR}"

CT_DoLog EXTRA "Building make"
CT_DoExecLog ALL make

CT_DoLog EXTRA "Installing make"
CT_DoExecLog ALL make install
if [ "${CT_MAKE_GMAKE_SYMLINK}" = "y" ]; then
CT_DoExecLog ALL ln -sv make "${CT_BUILDTOOLS_PREFIX_DIR}/bin/gmake"
Expand Down
7 changes: 6 additions & 1 deletion scripts/build/companion_tools/100-m4.sh
Expand Up @@ -10,15 +10,20 @@ do_companion_tools_m4_extract() {
CT_Patch "m4" "${CT_M4_VERSION}"
}

do_companion_tools_m4_build() {
do_companion_tools_m4_for_build() {
CT_DoStep EXTRA "Installing m4"
mkdir -p "${CT_BUILD_DIR}/build-m4"
CT_Pushd "${CT_BUILD_DIR}/build-m4"

CT_DoLog EXTRA "Configuring m4"
CT_DoExecLog CFG \
"${CT_SRC_DIR}/m4-${CT_M4_VERSION}/configure" \
--prefix="${CT_BUILDTOOLS_PREFIX_DIR}"

CT_DoLog EXTRA "Building m4"
CT_DoExecLog ALL make

CT_DoLog EXTRA "Building m4"
CT_DoExecLog ALL make install
CT_Popd
CT_EndStep
Expand Down
7 changes: 6 additions & 1 deletion scripts/build/companion_tools/200-autoconf.sh
Expand Up @@ -11,7 +11,7 @@ do_companion_tools_autoconf_extract() {
CT_Patch "autoconf" "${CT_AUTOCONF_VERSION}"
}

do_companion_tools_autoconf_build() {
do_companion_tools_autoconf_for_build() {
CT_DoStep EXTRA "Installing autoconf"
mkdir -p "${CT_BUILD_DIR}/build-autoconf"
CT_Pushd "${CT_BUILD_DIR}/build-autoconf"
Expand All @@ -21,10 +21,15 @@ do_companion_tools_autoconf_build() {
# For reference see:
# http://www.gnu.org/software/autoconf/manual/autoconf.html#CONFIG_005fSHELL

CT_DoLog EXTRA "Configuring autoconf"
CT_DoExecLog CFG ${CONFIG_SHELL} \
"${CT_SRC_DIR}/autoconf-${CT_AUTOCONF_VERSION}/configure" \
--prefix="${CT_BUILDTOOLS_PREFIX_DIR}"

CT_DoLog EXTRA "Building autoconf"
CT_DoExecLog ALL make

CT_DoLog EXTRA "Installing autoconf"
CT_DoExecLog ALL make install
CT_Popd
CT_EndStep
Expand Down
7 changes: 6 additions & 1 deletion scripts/build/companion_tools/300-automake.sh
Expand Up @@ -11,15 +11,20 @@ do_companion_tools_automake_extract() {
CT_Patch "automake" "${CT_AUTOMAKE_VERSION}"
}

do_companion_tools_automake_build() {
do_companion_tools_automake_for_build() {
CT_DoStep EXTRA "Installing automake"
mkdir -p "${CT_BUILD_DIR}/build-automake"
CT_Pushd "${CT_BUILD_DIR}/build-automake"

CT_DoLog EXTRA "Configuring automake"
CT_DoExecLog CFG \
"${CT_SRC_DIR}/automake-${CT_AUTOMAKE_VERSION}/configure" \
--prefix="${CT_BUILDTOOLS_PREFIX_DIR}"

CT_DoLog EXTRA "Building automake"
CT_DoExecLog ALL make

CT_DoLog EXTRA "Installing automake"
CT_DoExecLog ALL make install
CT_Popd
CT_EndStep
Expand Down
7 changes: 6 additions & 1 deletion scripts/build/companion_tools/400-libtool.sh
Expand Up @@ -11,15 +11,20 @@ do_companion_tools_libtool_extract() {
CT_Patch "libtool" "${CT_LIBTOOL_VERSION}"
}

do_companion_tools_libtool_build() {
do_companion_tools_libtool_for_build() {
CT_DoStep EXTRA "Installing libtool"
mkdir -p "${CT_BUILD_DIR}/build-libtool"
CT_Pushd "${CT_BUILD_DIR}/build-libtool"

CT_DoLog EXTRA "Configuring libtool"
CT_DoExecLog CFG \
"${CT_SRC_DIR}/libtool-${CT_LIBTOOL_VERSION}/configure" \
--prefix="${CT_BUILDTOOLS_PREFIX_DIR}"

CT_DoLog EXTRA "Building libtool"
CT_DoExecLog ALL make

CT_DoLog EXTRA "Installing libtool"
CT_DoExecLog ALL make install
CT_Popd
CT_EndStep
Expand Down
8 changes: 1 addition & 7 deletions scripts/crosstool-NG.sh.in
Expand Up @@ -580,14 +580,8 @@ if [ -z "${CT_RESTART}" ]; then
CT_DoExecLog ALL mkdir -p "${CT_SRC_DIR}"
fi

if [ "${CT_COMP_TOOLS}" = "y" ]; then
CT_DoStep INFO "Extracting, patching and installing companion tools"
do_companion_tools_extract
do_companion_tools
CT_EndStep
fi

CT_DoStep INFO "Extracting and patching toolchain components"
do_companion_tools_extract
do_kernel_extract
do_companion_libs_extract
do_binutils_extract
Expand Down
1 change: 1 addition & 0 deletions steps.mk
Expand Up @@ -19,6 +19,7 @@ help-env::
# Please keep the last line with a '\' and keep the following empty line:
# it helps when diffing and merging.
CT_STEPS := \
companion_tools_for_build \
companion_libs_for_build \
binutils_for_build \
companion_libs_for_host \
Expand Down

0 comments on commit 3f7fbd7

Please sign in to comment.