functions: add support for arch-specific patch

Add support for applying arch-specific patches found in
"patches/${pkgname}/${version}/${CT_ARCH}".

This is needed for applying a popular binutils patch specific for the
AVR architecture but which isn't isolated for AVR in binutils' code.
In this case, applying it for every architecture would end up bloating
binutils' "size" options with AVR specifics.

This feels like a bit of a hack but it is easy enough to support with
current crosstool-ng infrastructure, seems like worth it for this case.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
This commit is contained in:
Erico Nunes 2015-06-21 20:53:43 -03:00
parent 6da2fde11e
commit 219c5e932f

View File

@ -1101,13 +1101,14 @@ CT_Patch() {
CT_DoLog EXTRA "Patching '${pkgdir}'"
bundled_patch_dir="${CT_LIB_DIR}/patches/${pkgname}/${version}"
bundled_patch_arch_dir="${bundled_patch_dir}/${CT_ARCH}"
local_patch_dir="${CT_LOCAL_PATCH_DIR}/${pkgname}/${version}"
case "${CT_PATCH_ORDER}" in
bundled) patch_dirs=("${bundled_patch_dir}");;
bundled) patch_dirs=("${bundled_patch_dir}" "${bundled_patch_arch_dir}");;
local) patch_dirs=("${local_patch_dir}");;
bundled,local) patch_dirs=("${bundled_patch_dir}" "${local_patch_dir}");;
local,bundled) patch_dirs=("${local_patch_dir}" "${bundled_patch_dir}");;
bundled,local) patch_dirs=("${bundled_patch_dir}" "${bundled_patch_arch_dir}" "${local_patch_dir}");;
local,bundled) patch_dirs=("${local_patch_dir}" "${bundled_patch_dir}" "${bundled_patch_arch_dir}");;
none) patch_dirs=;;
esac