--- a/configure.ac	2020-08-24 23:20:40.000000000 +0800
+++ b/configure.ac	2021-11-17 01:49:35.530639500 +0800
@@ -11,6 +11,8 @@
 AM_MAINTAINER_MODE
 AM_CONFIG_HEADER(config.h)
 
+AC_CANONICAL_HOST
+
 # enabling huge-file support (64 bit file pointers)
 AH_TEMPLATE([_LARGE_FILE],
             [Must be defined in order to enable huge-file support.])
@@ -253,6 +255,12 @@
 AC_SUBST(LIBCAIRO_LIBS)
 
 # Checking for MinGW
-AM_CONDITIONAL([MINGW], [test "$target_alias" = "mingw32"])
+case "${host_os}" in
+    mingw*)
+        AM_CONDITIONAL([MINGW], true)
+        ;;
+    *)
+        AM_CONDITIONAL([MINGW], false);;
+esac
 
 AC_OUTPUT
