From 5cf2e648a67e1af20a23e010c86e8812a74ff7a4 Mon Sep 17 00:00:00 2001
From: Behdad Esfahbod <behdad@behdad.org>
Date: Sat, 25 May 2019 11:15:15 -0400
Subject: [PATCH] [mingw] Update for Fedora mingw installation location

Also adds --with-uniscribe by default.

Part of https://github.com/harfbuzz/harfbuzz/issues/1728
---
 mingw32.sh | 9 +++++----
 mingw64.sh | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/mingw32.sh b/mingw32.sh
index 67744051c..25c86a879 100755
--- a/mingw32.sh
+++ b/mingw32.sh
@@ -14,9 +14,10 @@ unset PKG_CONFIG_PATH
 # Removed -static from the following
 export CFLAGS="-static-libgcc"
 export CXXFLAGS="-static-libgcc -static-libstdc++"
-export CPPFLAGS="-I$HOME/.local/$target/include -O2"
+export CPPFLAGS="-I$HOME/.local/$target/include"
 export LDFLAGS=-L$HOME/.local/$target/lib
-export PKG_CONFIG_LIBDIR=$HOME/.local/$target/lib/pkgconfig
-export PATH=$HOME/.local/$target/bin:$PATH
+export PKG_CONFIG_LIBDIR=$HOME/.local/$target/lib/pkgconfig:/usr/$target/sys-root/mingw/lib/pkgconfig/
+export PKG_CONFIG_PATH=$HOME/.local/$target/share/pkgconfig:/usr/$target/sys-root/mingw/share/pkgconfig/
+export PATH=$HOME/.local/$target/bin:/usr/$target/sys-root/mingw/bin:/usr/$target/bin:$PATH
 
-../configure --build=`../config.guess` --host=$target --prefix=$HOME/.local/$target "$@"
+../configure --build=`../config.guess` --host=$target --prefix=$HOME/.local/$target --with-uniscribe "$@"
diff --git a/mingw64.sh b/mingw64.sh
index 49a143179..2b891f8dc 100755
--- a/mingw64.sh
+++ b/mingw64.sh
@@ -14,9 +14,10 @@ unset PKG_CONFIG_PATH
 # Removed -static from the following
 export CFLAGS="-static-libgcc"
 export CXXFLAGS="-static-libgcc -static-libstdc++"
-export CPPFLAGS="-I$HOME/.local/$target/include -O2"
+export CPPFLAGS="-I$HOME/.local/$target/include"
 export LDFLAGS=-L$HOME/.local/$target/lib
-export PKG_CONFIG_LIBDIR=$HOME/.local/$target/lib/pkgconfig
-export PATH=$HOME/.local/$target/bin:$PATH
+export PKG_CONFIG_LIBDIR=$HOME/.local/$target/lib/pkgconfig:/usr/$target/sys-root/mingw/lib/pkgconfig/
+export PKG_CONFIG_PATH=$HOME/.local/$target/share/pkgconfig:/usr/$target/sys-root/mingw/share/pkgconfig/
+export PATH=$HOME/.local/$target/bin:/usr/$target/sys-root/mingw/bin:/usr/$target/bin:$PATH
 
-../configure --build=`../config.guess` --host=$target --prefix=$HOME/.local/$target "$@"
+../configure --build=`../config.guess` --host=$target --prefix=$HOME/.local/$target --with-uniscribe "$@"