From a605e4b2a0db1a3b5a5cdc19815c5a328d69b6f0 Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Fri, 31 May 2024 22:52:22 +0000
Subject: [PATCH] autoconf: remove i386 windows related logic

This commit removes legacy i386 windows logic in autoconf scripts.
---
 m4/fp_leading_underscore.m4      | 1 -
 m4/fp_setup_windows_toolchain.m4 | 6 +-----
 m4/fptools_set_c_ld_flags.m4     | 3 ---
 m4/ghc_select_file_extensions.m4 | 4 ++--
 4 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/m4/fp_leading_underscore.m4 b/m4/fp_leading_underscore.m4
index 939cee3b69f7..14cb85293358 100644
--- a/m4/fp_leading_underscore.m4
+++ b/m4/fp_leading_underscore.m4
@@ -24,7 +24,6 @@ case $TargetPlatform in
         i386-*2\.@<:@0-9@:>@ | i386-*3\.@<:@0-3@:>@ ) fptools_cv_leading_underscore=yes ;;
         *) fptools_cv_leading_underscore=no ;;
       esac ;;
-    i386-unknown-mingw32) fptools_cv_leading_underscore=yes;;
     x86_64-unknown-mingw32) fptools_cv_leading_underscore=no;;
     *) AC_RUN_IFELSE([AC_LANG_SOURCE([[#if defined(HAVE_NLIST_H)
 #include <nlist.h>
diff --git a/m4/fp_setup_windows_toolchain.m4 b/m4/fp_setup_windows_toolchain.m4
index a9a795fc31d9..9679adf61730 100644
--- a/m4/fp_setup_windows_toolchain.m4
+++ b/m4/fp_setup_windows_toolchain.m4
@@ -1,12 +1,8 @@
 # Download and install the windows toolchain
 AC_DEFUN([FP_INSTALL_WINDOWS_TOOLCHAIN],[
     # Find the mingw-w64 archive file to extract.
-    if test "$HostArch" = "i386"
+    if test "$HostArch" = "x86_64"
     then
-        mingw_arch="i686"
-        tarball_dest_dir="mingw-w64/i686"
-        tarball_mingw_dir="clang32"
-    else
         mingw_arch="x86_64"
         tarball_dest_dir="mingw-w64/x86_64"
         tarball_mingw_dir="clang64"
diff --git a/m4/fptools_set_c_ld_flags.m4 b/m4/fptools_set_c_ld_flags.m4
index d379f20dc310..13913709c9f4 100644
--- a/m4/fptools_set_c_ld_flags.m4
+++ b/m4/fptools_set_c_ld_flags.m4
@@ -33,9 +33,6 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
     esac
 
     case $$1 in
-    i386-unknown-mingw32)
-        $2="$$2 -march=i686"
-        ;;
     i386-portbld-freebsd*)
         $2="$$2 -march=i686"
         ;;
diff --git a/m4/ghc_select_file_extensions.m4 b/m4/ghc_select_file_extensions.m4
index 751298a7f3a5..da84acb1173c 100644
--- a/m4/ghc_select_file_extensions.m4
+++ b/m4/ghc_select_file_extensions.m4
@@ -5,10 +5,10 @@ AC_DEFUN([GHC_SELECT_FILE_EXTENSIONS],
     case $1 in
     *-unknown-cygwin32)
         AC_MSG_WARN([GHC does not support the Cygwin target at the moment])
-        AC_MSG_WARN([I'm assuming you wanted to build for i386-unknown-mingw32])
+        AC_MSG_WARN([I'm assuming you wanted to build for x86_64-w64-mingw32])
         exit 1
         ;;
-    # examples: i386-unknown-mingw32, i686-w64-mingw32, x86_64-w64-mingw32
+    # examples: x86_64-w64-mingw32
     *-mingw32)
         windows=YES
         $2='.exe'
-- 
GitLab