Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions proc/01-core-defines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ load_strict "$AB"/lib/default-flags.sh
if ! abisdefined DPKG_ARCH ; then
export DPKG_ARCH="$ABHOST"
fi
if abisdefined FAIL_ARCH && abisdefined ALLOW_ARCH; then
abdie "Can not define FAIL_ARCH and ALLOW_ARCH at the same time."
if abisdefined ALLOW_ARCH; then
abdie "ALLOW_ARCH is deprecated, please remove it from your defines file."
fi

# NOTE: Some defines may override AB_FLAGS_* defined in an arch-specific
Expand All @@ -92,8 +92,41 @@ if [ -n "$ALLOW_ARCH" ] && [ "${ABBUILD%%\/*}" != $ALLOW_ARCH ]; then
abdie "This package can only be built on $ALLOW_ARCH, not including $ABHOST."
fi
# shellcheck disable=SC2053
[[ ${ABHOST} != $FAIL_ARCH ]] ||
# Now, we need to match not only the ARCH itself, we also have to match every
# ABHOST_GROUPs (e.g. retro, mainline, etc.).
# Three types of expressions are handled:
# - "!(a|b|c)", matching anything except a, b and c, so the build is only
# available to a, b and c.
# - "@(a|b|c)", matching a, b and c, so the build is not available to a,
# b and c.
# - "arch" or "group", disallowing build for one arch/group.
# NOTE:
# - Expressions such as "a|b|c" or "(a|b|c)" are invalid.
last_status=0
if [ "${FAIL_ARCH##\!}" != "$FAIL_ARCH" ] ; then
chk_op="!="
elif [ "${FAIL_ARCH##\@}" != "$FAIL_ARCH" ] ; then
chk_op="=="
elif [ "${FAIL_ARCH//[^0-9a-z-_]/}" != "$FAIL_ARCH" ] ; then
abdie "Invalid FAIL_ARCH expression: ‘$FAIL_ARCH’."
else
chk_op="=="
fi
for match in "$ABHOST" "${ABHOST_GROUP[@]}" ; do
if eval "[[ \$match $chk_op \$FAIL_ARCH ]]" ; then
last_status=0
break
else
last_status=1
fi
done
if [ "$chk_op" = "==" ] ; then
last_status="$(( !last_status ))"
fi
if [ "$last_status" != "0" ] ; then
abdie "This package cannot be built for $FAIL_ARCH, e.g. $ABHOST."
fi
unset last_status chk_op

if ! bool "$ABSTRIP" && bool "$ABSPLITDBG"; then
abwarn "QA: ELF stripping is turned OFF."
Expand Down
9 changes: 5 additions & 4 deletions sets/arch_targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"alpha": "alpha-aosc-linux-gnu",
"amd64": "x86_64-aosc-linux-gnu",
"arm64": "aarch64-aosc-linux-gnu",
"armv4": "arm-aosc-linux-gnueabi",
"armv6hf": "arm-aosc-linux-gnueabihf",
"armv7hf": "arm-aosc-linux-gnueabihf",
"armv4": "armv4l-aosc-linux-gnueabi",
"armv6hf": "armv6l-aosc-linux-gnueabihf",
"armv7hf": "armv7l-aosc-linux-gnueabihf",
"i486": "i486-aosc-linux-gnu",
"ia64": "ia64-aosc-linux-gnu",
"loongson2f": "mips64el-aosc-linux-gnuabi64",
Expand All @@ -18,5 +18,6 @@
"powerpc": "powerpc-aosc-linux-gnu",
"ppc64": "powerpc64-aosc-linux-gnu",
"ppc64el": "powerpc64le-aosc-linux-gnu",
"riscv64": "riscv64-aosc-linux-gnu"
"riscv64": "riscv64-aosc-linux-gnu",
"sparc64": "sparc64-aosc-linux-gnu"
}
Loading