From ec30912f35f4cb1fe50ebfe7a1fbb32bb74f910c Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <sezeroz@gmail.com>
Date: Thu, 29 May 2025 07:20:04 +0300
Subject: [PATCH] builds/unix/configure.raw: set have_harfbuzz* vars to dynamic for mingw

Windows uses its own LoadLibrary().

This fixes mingw configuration errors:
---
checking for HARFBUZZ... no
checking for dlopen in -lc... no
checking for dlopen in -ldl... no
configure: error: harfbuzz support requested but library not found
---
---
 builds/unix/configure.raw |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index fa1e25f..2eb90ef 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -468,6 +468,13 @@ fi
 have_harfbuzz_dynamic=no
 if test x"$have_harfbuzz" = xno; then
   if test x"$with_harfbuzz" = xdynamic -o x"$with_harfbuzz" = xauto; then
+   case "$host" in
+   *-*-mingw*)
+    # windows uses its own LoadLibrary(), set variables to dynamic:
+    have_harfbuzz_dynamic=yes
+    have_harfbuzz="yes (dynamic)"
+    ;;
+   *)
     # Check for libdl
     AC_CHECK_LIB([c], [dlopen], [have_harfbuzz_dynamic=yes],
        AC_CHECK_LIB([dl], [dlopen], [have_harfbuzz_dynamic=yes; need_libdl=yes]))
@@ -478,6 +485,8 @@ if test x"$have_harfbuzz" = xno; then
          HARFBUZZ_LIBS="-ldl"
       fi
     fi
+   ;;
+   esac
   fi
 fi
 
