# -----------------------------------------------------------------------------
# Abort if the user runs the script in an "MSYS2 MSYS" shell.
-if [ $MSYSTEM = "MSYS2" ]; then
+if [ $MSYSTEM = "MSYS" ]; then
echo "Building in an 'MSYS2 MSYS' shell will not work, aborting."
echo "Please use the 'MSYS2 MinGW 64-bit' (or 32-bit) shell."
exit
PYPATH=$PREFIX/$PYBASE
+# Eliminate the host Python path environment variable, if any is set.
+export PYTHONPATH=
+
# -----------------------------------------------------------------------------
-P="$PREFIX/lib/pkgconfig"
+P="$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
C="$C --prefix=$PREFIX"
L="--disable-shared --enable-static"