No context in TL2023 source ?
Ken Brown
kbrow1i at gmail.com
Wed Mar 22 21:57:30 CET 2023
I succeeded in building luametatex on Cygwin, though I don't know how to
test it. (I did run 'luametatex --help', but that's all.) David, would
you see if you can replicate my build and test it? You'll have to
install ninja if you don't already have it installed.
Here's what I did:
1. Clone the luametatex git repo.
2. Apply the attached patch.
3. chmod +x build.sh
4. ./build.sh cygwin
This runs with no errors and leaves luametatex.exe in build/cygwin.
Ken
P.S. The tricky part was that I kept getting errors involving quad_t,
which I finally traced to the fact that <sys/types.h> on Cygwin contains
#define quad quad_t
-------------- next part --------------
diff --git a/build.sh b/build.sh
old mode 100644
new mode 100755
index 56ed63497132..de5861ebe61d
--- a/build.sh
+++ b/build.sh
@@ -42,6 +42,14 @@ then
cd build/mingw-64-ucrt
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=./cmake/mingw-64-ucrt.cmake ../..
+elif [ "$1" = "cygwin" ] || [ "$1" = "--cygwin" ]
+then
+ PLATFORM="cygwin"
+ SUFFIX=".exe"
+ mkdir -p build/cygwin
+ cd build/cygwin
+ cmake -G Ninja ../..
+
else
PLATFORM="native"
diff --git a/source/libraries/mimalloc/src/os.c b/source/libraries/mimalloc/src/os.c
index 0f98474170e9..7df76b159d57 100644
--- a/source/libraries/mimalloc/src/os.c
+++ b/source/libraries/mimalloc/src/os.c
@@ -1197,7 +1197,7 @@ static void* mi_os_alloc_huge_os_pagesx(void* addr, size_t size, int numa_node)
return VirtualAlloc(addr, size, flags, PAGE_READWRITE);
}
-#elif defined(MI_OS_USE_MMAP) && (MI_INTPTR_SIZE >= 8) && !defined(__HAIKU__)
+#elif defined(MI_OS_USE_MMAP) && (MI_INTPTR_SIZE >= 8) && !defined(__HAIKU__) && !defined(__CYGWIN__)
#include <sys/syscall.h>
#ifndef MPOL_PREFERRED
#define MPOL_PREFERRED 1
diff --git a/source/lua/lmtinterface.c b/source/lua/lmtinterface.c
index 2c94feb6fac7..a6024a9734e2 100644
--- a/source/lua/lmtinterface.c
+++ b/source/lua/lmtinterface.c
@@ -10,6 +10,9 @@
*/
# include "luametatex.h"
+# if defined(__CYGWIN__)
+# undef quad
+# endif
lua_state_info lmt_lua_state = {
.lua_instance = NULL,
More information about the tex-live
mailing list.