From 63057ef329a5d5450b60f0ca66cb1dc0ab1853b2 Mon Sep 17 00:00:00 2001
From: Kai Zhang <zhangkai@iscas.ac.cn>
Date: Wed, 20 Mar 2024 19:46:30 +0800
Subject: [PATCH] riscv: config pmdabpf_arch value

Configure scripts use pmdabpf_arch to refer to architecture
directory of iovisor/bcc/libbpf-tools, which hold kernel
vmlinux.h. For RISC-V, the unique directory name is 'riscv'.
We need to sed uname's value riscv64 etc. to adapt this.

Signed-off-by: Kai Zhang <zhangkai@iscas.ac.cn>
---
 configure    | 2 +-
 configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 14e8c3cf5..b0f7dae89 100755
--- a/configure
+++ b/configure
@@ -9105,7 +9105,7 @@
 
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking BPF CO-RE architecture identifier" >&5
 printf %s "checking BPF CO-RE architecture identifier... " >&6; }
-pmdabpf_arch=`uname -m | sed 's/x86_64/x86/' | sed 's/aarch64/arm64/' | sed 's/ppc64le/powerpc/' | sed 's/mips.*/mips/'`
+pmdabpf_arch=`uname -m | sed 's/x86_64/x86/' | sed 's/aarch64/arm64/' | sed 's/ppc64le/powerpc/' | sed 's/mips.*/mips/' | sed 's/riscv.*/riscv/'`
 
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $pmdabpf_arch" >&5
 printf "%s\n" "$pmdabpf_arch" >&6; }
diff --git a/configure.ac b/configure.ac
index f8e855019..51887d26c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1172,7 +1172,7 @@
 
 dnl Get BPF CO-RE arch identifier
 AC_MSG_CHECKING([BPF CO-RE architecture identifier])
-pmdabpf_arch=`uname -m | sed 's/x86_64/x86/' | sed 's/aarch64/arm64/' | sed 's/ppc64le/powerpc/' | sed 's/mips.*/mips/'`
+pmdabpf_arch=`uname -m | sed 's/x86_64/x86/' | sed 's/aarch64/arm64/' | sed 's/ppc64le/powerpc/' | sed 's/mips.*/mips/' | sed 's/riscv.*/riscv/'`
 AC_SUBST(pmdabpf_arch)
 AC_MSG_RESULT($pmdabpf_arch)
 
-- 
2.43.0
