* builds/unix/configure.raw [mmap support]: Correctly handle Windows. Fixes #1024.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
diff --git a/ChangeLog b/ChangeLog
index 319a989..64bf771 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2021-01-31 Werner Lemberg <wl@gnu.org>
+ * builds/unix/configure.raw [mmap support]: Correctly handle Windows.
+
+ Fixes #1024.
+
+2021-01-31 Werner Lemberg <wl@gnu.org>
+
* builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c`.
2021-01-31 Werner Lemberg <wl@gnu.org>
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index e45769d..ce0c83f 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -192,39 +192,51 @@ AC_SUBST(INSTALL_FT2_CONFIG, [$enable_freetype_config])
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],
[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>
#endif
#include <sys/mman.h>
- ])
+ ])
- FT_MUNMAP_PARAM
+ FT_MUNMAP_PARAM
+ ;;
+ esac
fi
AC_SUBST([FTSYS_SRC])