This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: brodieG <brodieG@users.noreply.github.com>
Date: Sun, 15 May 2022 12:57:55 +0000
Subject: [PATCH 1/3] Makes sure to link against all of geos' libs as...

well as the stdc++ lib.  Originally by:

From: Luke Potgieter <fried.roadkill+ght@gmail.com>
Date: Wed, 23 Aug 2017 12:51:27 +0200

diff --git a/configure.ac b/configure.ac
index 1111111..2222222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -345,13 +345,13 @@ if test x"$enable_geos" != "xno"; then
   CPPFLAGS_SAVE="$CPPFLAGS"
   CPPFLAGS="$GEOS_CFLAGS"
   AC_CHECK_HEADERS([geos_c.h],, [AC_MSG_ERROR([could not find geos_c.h - you may need to specify the directory of a geos-config file using --with-geosconfig])])
-  CPPFLAGS="$CPPFLAGS_SAVE"	
+  CPPFLAGS="$CPPFLAGS_SAVE -I`$GEOSCONFIG --includes`"
   # Ensure we can link against libgeos_c
   LIBS_SAVE="$LIBS"
-  LIBS="$GEOS_LDFLAGS"
+  LIBS="$GEOS_LDFLAGS `$GEOSCONFIG --clibs`"
   AC_SEARCH_LIBS(GEOSCoveredBy,geos_c,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.3.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig]))
   LIBS="$LIBS_SAVE"
-  LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c"
+  LIBS="$LIBS $GEOS_LDFLAGS `$GEOSCONFIG --clibs`"
 
   #-----------------------------------------------------------------------
   #   --enable-controlpoints

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: brodieG <brodieG@users.noreply.github.com>
Date: Sun, 15 May 2022 13:02:00 +0000
Subject: [PATCH 2/3] use lower case for windows headers


diff --git a/src/gaiageo/gg_shape.c b/src/gaiageo/gg_shape.c
index 1111111..2222222 100644
--- a/src/gaiageo/gg_shape.c
+++ b/src/gaiageo/gg_shape.c
@@ -58,7 +58,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #endif
 
 #ifdef _WIN32
-#include <Windows.h>
+#include <windows.h>
 #endif
 
 #if OMIT_ICONV == 0		/* if ICONV is disabled no SHP support is available */
diff --git a/test/scandir4win.h b/test/scandir4win.h
index 1111111..2222222 100644
--- a/test/scandir4win.h
+++ b/test/scandir4win.h
@@ -11,7 +11,7 @@ even implied
 
 #ifdef _WIN32
 
-#include <Windows.h>
+#include <windows.h>
 #include <stdio.h>
 #include <sys/types.h>
 

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: brodieG <brodieG@users.noreply.github.com>
Date: Sat, 28 May 2022 12:27:03 +0000
Subject: [PATCH 3/3] fix minizip reference for MXE minizip

Spatialite assumes minizip is winimage.com one, whereas MXE
uses minizip-ng which installs directly to includes instead
of to includes/minizip

diff --git a/config.h b/config.h
index 1111111..2222222 100644
--- a/config.h
+++ b/config.h
@@ -65,7 +65,7 @@
 /* Define to 1 if you have the `memset' function. */
 #define HAVE_MEMSET 1
 
-/* Define to 1 if you have the <minizip/unzip.h> header file. */
+/* Define to 1 if you have the <unzip.h> header file. */
 #define HAVE_MINIZIP_UNZIP_H 1
 
 /* Define to 1 if you have the <proj_api.h> header file. */
diff --git a/config.h.in b/config.h.in
index 1111111..2222222 100644
--- a/config.h.in
+++ b/config.h.in
@@ -64,7 +64,7 @@
 /* Define to 1 if you have the `memset' function. */
 #undef HAVE_MEMSET
 
-/* Define to 1 if you have the <minizip/unzip.h> header file. */
+/* Define to 1 if you have the <unzip.h> header file. */
 #undef HAVE_MINIZIP_UNZIP_H
 
 /* Define to 1 if you have the <proj_api.h> header file. */
diff --git a/configure.ac b/configure.ac
index 1111111..2222222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -441,7 +441,7 @@ AC_ARG_ENABLE(minizip, [AS_HELP_STRING(
   [--enable-minizip], [enables MiniZIP inclusion [default=yes]])],
   [], [enable_minizip=yes])
 if test x"$enable_minizip" != "xno"; then
-  AC_CHECK_HEADERS(minizip/unzip.h,, [AC_MSG_ERROR([cannot find minizip/unzip.h, bailing out])])
+  AC_CHECK_HEADERS(unzip.h,, [AC_MSG_ERROR([cannot find unzip.h, bailing out])])
   AC_SEARCH_LIBS(unzLocateFile, minizip,,AC_MSG_ERROR(['libminizip' is required but it doesn't seem to be installed on this system.]))
   AC_DEFINE(ENABLE_MINIZIP)
 fi
diff --git a/fakeconfig.h b/fakeconfig.h
index 1111111..2222222 100644
--- a/fakeconfig.h
+++ b/fakeconfig.h
@@ -92,7 +92,7 @@
 /* Define to 1 if you have the `memset' function. */
 #define HAVE_MEMSET 1
 
-/* Define to 1 if you have the <minizip/unzip.h> header file. */
+/* Define to 1 if you have the <unzip.h> header file. */
 #define HAVE_MINIZIP_UNZIP_H 1
 
 /* Define to 1 if you have the <proj_api.h> header file. */
diff --git a/fakeconfig.h.in b/fakeconfig.h.in
index 1111111..2222222 100644
--- a/fakeconfig.h.in
+++ b/fakeconfig.h.in
@@ -91,7 +91,7 @@
 /* Define to 1 if you have the `memset' function. */
 #undef HAVE_MEMSET
 
-/* Define to 1 if you have the <minizip/unzip.h> header file. */
+/* Define to 1 if you have the <unzip.h> header file. */
 #undef HAVE_MINIZIP_UNZIP_H
 
 /* Define to 1 if you have the <proj_api.h> header file. */
diff --git a/src/shapefiles/shapefiles.c b/src/shapefiles/shapefiles.c
index 1111111..2222222 100644
--- a/src/shapefiles/shapefiles.c
+++ b/src/shapefiles/shapefiles.c
@@ -80,7 +80,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
 #endif
 
 #ifdef ENABLE_MINIZIP		/* MINIZIP is enabled */
-#include <minizip/unzip.h>
+#include <unzip.h>
 #endif
 
 #if defined(_WIN32) && !defined(__MINGW32__)
