Skip to content

Commit e3568ce

Browse files
committed
configure: Determine system architecture properly on *BSD systems
uname -m on a BSD system will provide the architecture port .e.g. arm64, macppc, octeon instead of the machine architecture .e.g. aarch64, powerpc, mips64. uname -p will provide the machine architecture.
1 parent 6d8c1ac commit e3568ce

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

configure

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ if [ -n "${CHOST}" ]; then
2929
CROSS_PREFIX="${CHOST}-"
3030
ARCH="$(echo "${NORM_CHOST}" | sed -e 's/-.*//')"
3131
else
32-
ARCH="$(uname -m)"
32+
# BSD systems use uname -p for architecture names vs port names
33+
case "$(uname -s)" in
34+
*BSD | DragonFly)
35+
ARCH="$(uname -p)" ;;
36+
*)
37+
ARCH="$(uname -m)" ;;
38+
esac
3339
fi
3440

3541
case "${ARCH}" in

0 commit comments

Comments
 (0)