Skip to content

Commit

Permalink
build: Add missing 'riscv64' to configure --arch
Browse files Browse the repository at this point in the history
The configure script didn't accept the riscv target arch and failed like
below when I tried to cross-build:

  $ ./configure --arch=riscv64 --cross-compile=riscv64-linux-gnu-
  Error: 'riscv64' is not a supported architecture

Also change the script to use 'case' statement to handle multiple
architectures easily.

Signed-off-by: Namhyung Kim <[email protected]>
  • Loading branch information
namhyung committed Jan 25, 2024
1 parent 9d8657e commit 4a31fe0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,20 @@ fi
# Support --arch, --cross-compile, --cflags and --ldflags options
#
if [ ! -z "$arch" ]; then
export ARCH=$arch
if [ "$arch" = "x86_64" ] || [ "$arch" = "arm" ] || [ "$arch" = "aarch64" ]; then
case $arch in
x86_64 | arm | aarch64 | riscv64)
export ARCH=$arch
elif [ "$arch" = "i386" ]; then
;;
i*86)
export ARCH="i386"
export CFLAGS="-m32 $CFLAGS"
export LDFLAGS="-m32 $LDFLAGS"
else
;;
*)
echo "Error: '$arch' is not a supported architecture" >&2
exit 1
fi
;;
esac
fi
if [ ! -z "$cross_compile" ]; then
export CROSS_COMPILE=$cross_compile
Expand Down

0 comments on commit 4a31fe0

Please sign in to comment.