From b65e9b7c4b2a06fbb8caa32ceee89a709fdce668 Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@sourcemage.org>
Date: Thu, 13 Jul 2023 00:40:35 +0200
Subject: [PATCH] Make the configure script comply with GNU style

Ignores: --infodir, --localstatedir, --mandir, --sysconfdir, and --target
Changes: --target for --host, and --host for --build

Source: Source Mage
Upstream-Status: Pending
Signed-off-by: Ismael Luceno <ismael@sourcemage.org>
---
 configure | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index fe5688af6476..5a88651ffe0a 100755
--- a/configure
+++ b/configure
@@ -15,8 +15,8 @@ for arg ; do
 	case "$arg" in
 	--prefix=*) prefix=${arg#*=} ;;
 	--bindir=*) bindir=${arg#*=} ;;
-	--host=*) host=${arg#*=} ;;
-	--target=*) target=${arg#*=} ;;
+	--build=*) host=${arg#*=} ;;
+	--host=*) target=${arg#*=} ;;
 	--with-cpp=*) DEFAULT_PREPROCESSOR=${arg#*=} ;;
 	--with-qbe=*) DEFAULT_QBE=${arg#*=} ;;
 	--with-as=*) DEFAULT_ASSEMBLER=${arg#*=} ;;
@@ -26,17 +26,19 @@ for arg ; do
 	CC=*) CC=${arg#*=} ;;
 	CFLAGS=*) CFLAGS=${arg#*=} ;;
 	LDFLAGS=*) LDFLAGS=${arg#*=} ;;
+	# ignored GNU-standard arguments
+	--sysconfdir=*|--localstatedir=*|--mandir=*|--infodir=*|--target=*);;
 	*) fail "unknown option '$arg'"
 	esac
 done
 
 : ${CC:=cc}
 
-printf 'checking host system type... '
+printf 'checking build host system type... '
 test -n "$host" || host=$($CC -dumpmachine 2>/dev/null) || fail "could not determine host"
 printf '%s\n' "$host"
 
-printf 'checking target system type... '
+printf 'checking toolchain host system type... '
 test -n "$target" || target=$host
 printf '%s\n' "$target"
 
-- 
2.40.1

