shithub: freetype+ttf2subf

Download patch

ref: 5635d5edc489a19d8e6faef48c644942a4b3f777
parent: 689402418f862154ade6a3b2d08930fed2c08b52
author: Werner Lemberg <[email protected]>
date: Tue Feb 2 05:33:53 EST 2021

* builds/unix/configure.raw [mmap support]: Correctly handle Windows.

Fixes #1024.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2021-01-31  Werner Lemberg  <[email protected]>
 
+	* builds/unix/configure.raw [mmap support]: Correctly handle Windows.
+
+	Fixes #1024.
+
+2021-01-31  Werner Lemberg  <[email protected]>
+
 	* builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c`.
 
 2021-01-31  Werner Lemberg  <[email protected]>
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -192,6 +192,9 @@
 AC_SYS_LARGEFILE
 
 # Here we check whether we can use our mmap file component.
+#
+# Note that `ftsystem.c` for Windows has its own mmap-like implementation
+# not covered by `AC_FUNC_MMAP` and/or `FT_UNMAP_PARAM`.
 
 AC_ARG_ENABLE([mmap],
   AS_HELP_STRING([--disable-mmap],
@@ -198,24 +201,31 @@
                  [do not check mmap() and do not use]),
   [enable_mmap="no"], [enable_mmap="yes"])
 if test "x${enable_mmap}" != "xno"; then
-  AC_FUNC_MMAP
-fi
-if test "x${enable_mmap}" = "xno" \
-   -o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then
   case "$host" in
   *-*-mingw*)
-    FTSYS_SRC='$(PLATFORM_DIR)/ftsystem.c'
+    ac_cv_func_mmap_fixed_mapped="yes"
+    AC_MSG_CHECKING([for working mmap])
+    AC_MSG_RESULT([using Windows-specific equivalent])
     ;;
   *)
-    FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
+    AC_FUNC_MMAP
+    ;;
   esac
+fi
+if test "x${enable_mmap}" = "xno" \
+   -o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then
+  FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
 else
   FTSYS_SRC='$(PLATFORM_DIR)/ftsystem.c'
 
-  AC_CHECK_DECLS([munmap],
-    [],
-    [],
-    [
+  case "$host" in
+  *-*-mingw*)
+    ;;
+  *)
+    AC_CHECK_DECLS([munmap],
+      [],
+      [],
+      [
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -222,9 +232,11 @@
 #endif
 #include <sys/mman.h>
 
-    ])
+      ])
 
-  FT_MUNMAP_PARAM
+    FT_MUNMAP_PARAM
+    ;;
+  esac
 fi
 AC_SUBST([FTSYS_SRC])