diff mbox series

[pseudo,3/3] configure: Add support for LoongArch

Message ID 20250309060039.454124-4-wuxiaotian@loongson.cn
State New
Headers show
Series Porting pseudo to LoongArch | expand

Commit Message

Xiaotian Wu March 9, 2025, 6 a.m. UTC
Set the default architecture based on the current machine

Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
---
 configure | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/configure b/configure
index 39b5fbe..9fbba9a 100755
--- a/configure
+++ b/configure
@@ -22,8 +22,17 @@  opt_xattrdb=false
 opt_profile=false
 opt_passwd_fallback='""'
 
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=x86
+case $UNAME_MACHINE in
+  i*86|x86_64) opt_arch=x86 ;;
+  arm|arm64) opt_arch=arm ;;
+  loongarch32|loongarch64) opt_arch=loongarch ;;
+esac
+
 compile_x86_32=-m32
 compile_x86_64=-m64
+compile_loongarch_32=
+compile_loongarch_64=
 
 usage()
 {
@@ -170,7 +179,7 @@  do
 done
 
 case $opt_arch in
-'' | x86 | arm )
+'' | x86 | arm | loongarch)
     ;;
 *)    echo >&2 "Untested arch $opt_arch."
     ;;