From 823a1a4dbdba8f682e2d31851c11e369e50aa0f7 Mon Sep 17 00:00:00 2001
From: Andrew Caudwell <acaudwell@gmail.com>
Date: Thu, 14 Aug 2025 12:10:06 +1200
Subject: [PATCH] Fixed build with Boost 1.89.0 by no longer linking boost
 system.

Increased minimum required version of Boost to 1.69.

Updated ax_boost_base.m4 macro
---
 configure.ac          |   4 +-
 m4/ax_boost_base.m4   |   7 +--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 382fa7e..bcc107f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,8 +45,7 @@ AC_CHECK_FUNCS([IMG_LoadPNG_RW], , AC_MSG_ERROR([SDL2_image with PNG support req
 AC_CHECK_FUNCS([IMG_LoadJPG_RW], , AC_MSG_ERROR([SDL2_image with JPEG support required. Please see INSTALL]))
 
 #BOOST
-AX_BOOST_BASE([1.46], , AC_MSG_ERROR(Boost Filesystem >= 1.46 is required. Please see INSTALL))
-AX_BOOST_SYSTEM
+AX_BOOST_BASE([1.69], , AC_MSG_ERROR(Boost Filesystem >= 1.69 is required. Please see INSTALL))
 AX_BOOST_FILESYSTEM
 
 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
diff --git a/m4/ax_boost_base.m4 b/m4/ax_boost_base.m4
index 6c944b1..9d5a08c 100644
--- a/m4/ax_boost_base.m4
+++ b/m4/ax_boost_base.m4
@@ -10,7 +10,7 @@
 #
 #   Test for the Boost C++ libraries of a particular version (or newer)
 #
-#   If no path to the installed boost library is given the macro searchs
+#   If no path to the installed boost library is given the macro searches
 #   under /usr, /usr/local, /opt, /opt/local and /opt/homebrew and evaluates
 #   the $BOOST_ROOT environment variable. Further documentation is available
 #   at <http://randspringer.de/boost/index.html>.
@@ -33,7 +33,7 @@
 #   and this notice are preserved. This file is offered as-is, without any
 #   warranty.
 
-#serial 51
+#serial 55
 
 # example boost program (need to pass version)
 m4_define([_AX_BOOST_BASE_PROGRAM],
@@ -114,7 +114,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
     AS_CASE([${host_cpu}],
       [x86_64],[libsubdirs="lib64 libx32 lib lib64"],
       [mips*64*],[libsubdirs="lib64 lib32 lib lib64"],
-      [ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64|e2k],[libsubdirs="lib64 lib lib64"],
+      [ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64|e2k|loongarch64],[libsubdirs="lib64 lib lib64"],
       [libsubdirs="lib"]
     )
 
@@ -289,6 +289,8 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
         else
             AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
         fi
+        BOOST_LDFLAGS=""
+        BOOST_CPPFLAGS=""
         # execute ACTION-IF-NOT-FOUND (if present):
         ifelse([$3], , :, [$3])
     else
