Create sysroot for MinGW. For example, create a folder named $HOME/mingw-sysroot
Create ${CHOST}-pkg-config wrapper. The wrapper will set PKG_CONFIG_SYSROOT_DIR as sysroot.
#!/bin/sh
# Point to your sysroot.
SYSROOT=$HOME/mingw-sysroot
export PKG_CONFIG_DIR=
export PKG_CONFIG_LIBDIR=${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig
export PKG_CONFIG_SYSROOT_DIR=${SYSROOT}
exec pkg-config "$@"
export PKG_CONFIG=${CHOST}-pkg-config
./configure --host=i686-w64-mingw32 \
--prefix=/usr \
--with-sysroot=$HOME/mingw-sysroot
make install DESTDIR=$HOME/mingw-sysroot
Reference: