diff options
-rw-r--r-- | config/global/paths.in | 28 | ||||
-rw-r--r-- | scripts/build/internals.sh | 15 |
2 files changed, 43 insertions, 0 deletions
diff --git a/config/global/paths.in b/config/global/paths.in index 82ee4b39..e4cf7024 100644 --- a/config/global/paths.in +++ b/config/global/paths.in @@ -137,3 +137,31 @@ config STRIP_TARGET_TOOLCHAIN_EXECUTABLES An install-strip make target is provided that installs stripped executables, and may install libraries with unneeded or debugging sections stripped. + +config TARBALL_RESULT + bool + depends on EXPERIMENTAL + prompt "Create binary toolchain tarball" + default n + help + Create tarball of the final binary toolchain. + +if TARBALL_RESULT + +config TARBALL_RESULT_DIR + string + depends on TARBALL_RESULT + prompt "Output directory" + default "${CT_TOP_DIR}" + help + Directory where tarball will be created. + +config TARBALL_RESULT_FILENAME + string + depends on TARBALL_RESULT + prompt "Output filename" + default "toolchain${CT_TOOLCHAIN_PKGVERSION:+-${CT_TOOLCHAIN_PKGVERSION}}-${CT_HOST:+HOST-${CT_HOST}-}${CT_TARGET}" + help + Filename for toolchain tarball, without extension. + +endif diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index 821761c2..c4dc81dd 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -31,6 +31,7 @@ do_finish() { local strip_args local gcc_version local exe_suffix + local tarball CT_DoStep INFO "Finalizing the toolchain's directory" @@ -138,5 +139,19 @@ do_finish() { CT_InstallCopyingInformation fi + if [ "${CT_TARBALL_RESULT}" = y ]; then + tarball="${CT_TARBALL_RESULT_DIR}/${CT_TARBALL_RESULT_FILENAME}.tar.xz" + CT_DoLog EXTRA "Creating binary toolchain tarball: ${tarball}" + cp "${CT_TOP_DIR}/.config" "${CT_PREFIX_DIR}/${CT_TOOLCHAIN_PKGVERSION}.config" + (cd "${CT_PREFIX_DIR}" && \ + find ./. -print0 | \ + LC_ALL=C sort -z | \ + tar --numeric-owner --owner=0 --group=0 \ + --transform "s,^\./\.,${CT_TARBALL_RESULT_FILENAME},S" \ + --no-recursion --null -T - -Jcf "${tarball}") + CT_DoLog EXTRA "Calculating binary toolchain checksum" + sha256sum "${tarball}" > "${tarball}.asc" + fi + CT_EndStep } |