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: aquiles2k <aj@elane2k.com>
Date: Wed, 6 Apr 2016 22:39:53 +0300
Subject: [PATCH 1/2] fix error "won't overwrite defined macro" on OSX

See https://github.com/mxe/mxe/issues/1281

diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4
index 1111111..2222222 100644
--- a/m4macros/glib-gettext.m4
+++ b/m4macros/glib-gettext.m4
@@ -39,8 +39,8 @@ dnl We go to great lengths to make sure that aclocal won't
 dnl try to pull in the installed version of these macros
 dnl when running aclocal in the glib directory.
 dnl
-m4_copy([AC_DEFUN],[glib_DEFUN])
-m4_copy([AC_REQUIRE],[glib_REQUIRE])
+m4_copy_force([AC_DEFUN],[glib_DEFUN])
+m4_copy_force([AC_REQUIRE],[glib_REQUIRE])
 dnl
 dnl At the end, if we're not within glib, we'll define the public
 dnl definitions in terms of our private definitions.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: v1993 <v19930312@gmail.com>
Date: Wed, 8 Dec 2021 20:08:30 +0300
Subject: [PATCH 2/2] Fix gio linking error for some cases

Happens with autotools and direct GCC call, meson doesn't have it.

diff --git a/gio/meson.build b/gio/meson.build
index 1111111..2222222 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -909,7 +909,15 @@ libgio_dep = declare_dependency(link_with : libgio,
   ],
 )
 
+# Link against libuuid to prevent linker error in certain cases
+windows_ldflags = []
+
+if host_system == 'windows'
+  windows_ldflags += ['-luuid']
+endif
+
 pkg.generate(libgio,
+  libraries_private : [windows_ldflags],
   requires : ['glib-2.0', 'gobject-2.0'],
   variables : [
     'schemasdir=' + '${datadir}' / schemas_subdir,
