diff options
author | Alexey Neyman <stilor@att.net> | 2016-12-03 03:18:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-03 03:18:56 (GMT) |
commit | 4042269de621e166235308f139e89c92e379040d (patch) | |
tree | 093329f6412837d89e1e849575a3f1579412802f /scripts/build/companion_tools/050-make.sh | |
parent | a787e410dc7133fb371e71161663639e1c0dc89b (diff) | |
parent | bf0d593639d0c9451b13be4965bc6766cc90fed9 (diff) |
Merge pull request #487 from stilor/host-comp-tools
Allow for installation of companion tools for host
Diffstat (limited to 'scripts/build/companion_tools/050-make.sh')
-rw-r--r-- | scripts/build/companion_tools/050-make.sh | 59 |
1 files changed, 49 insertions, 10 deletions
diff --git a/scripts/build/companion_tools/050-make.sh b/scripts/build/companion_tools/050-make.sh index 9458a25..d8f6b66 100644 --- a/scripts/build/companion_tools/050-make.sh +++ b/scripts/build/companion_tools/050-make.sh @@ -11,18 +11,57 @@ do_companion_tools_make_extract() { CT_Patch "make" "${CT_MAKE_VERSION}" } -do_companion_tools_make_build() { - CT_DoStep EXTRA "Installing make" - mkdir -p "${CT_BUILD_DIR}/build-make" - CT_Pushd "${CT_BUILD_DIR}/build-make" - - CT_DoExecLog CFG "${CT_SRC_DIR}/make-${CT_MAKE_VERSION}/configure" \ - --prefix="${CT_BUILDTOOLS_PREFIX_DIR}" - CT_DoExecLog ALL make - CT_DoExecLog ALL make install +do_companion_tools_make_for_build() { + CT_DoStep EXTRA "Installing make for build" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-make-build" + do_make_backend \ + host=${CT_BUILD} \ + prefix="${CT_BUILD_COMPTOOLS_DIR}" \ + cflags="${CT_CFLAGS_FOR_BUILD}" \ + ldflags="${CT_LDFLAGS_FOR_BUILD}" + CT_Popd if [ "${CT_MAKE_GMAKE_SYMLINK}" = "y" ]; then - CT_DoExecLog ALL ln -sv make "${CT_BUILDTOOLS_PREFIX_DIR}/bin/gmake" + CT_DoExecLog ALL ln -sv make "${CT_BUILD_COMPTOOLS_DIR}/bin/gmake" fi + CT_EndStep +} + +do_companion_tools_make_for_host() { + CT_DoStep EXTRA "Installing make for host" + CT_mkdir_pushd "${CT_BUILD_DIR}/build-make-host" + do_make_backend \ + host=${CT_HOST} \ + prefix="${CT_PREFIX_DIR}" \ + cflags="${CT_CFLAGS_FOR_HOST}" \ + ldflags="${CT_LDFLAGS_FOR_HOST}" CT_Popd + if [ "${CT_MAKE_GMAKE_SYMLINK}" = "y" ]; then + CT_DoExecLog ALL ln -sv make "${CT_PREFIX_DIR}/bin/gmake" + fi CT_EndStep } + +do_make_backend() { + local host + local prefix + local cflags + local ldflags + + for arg in "$@"; do + eval "${arg// /\\ }" + done + + CT_DoLog EXTRA "Configuring make" + CT_DoExecLog CFG \ + CFLAGS="${cflags}" \ + LDFLAGS="${ldflags}" \ + "${CT_SRC_DIR}/make-${CT_MAKE_VERSION}/configure" \ + --host="${host}" \ + --prefix="${prefix}" + + CT_DoLog EXTRA "Building make" + CT_DoExecLog ALL make + + CT_DoLog EXTRA "Installing make" + CT_DoExecLog ALL make install +} |