Use MSYS2 and UCRT64 environment. Existing ragel is required.
We use existing package from UCRT64 that depends on libgcc
, libstdc++
and
libwinpthread
.
pacman -S --needed autotools git mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-ragel
Fetch http://www.colm.net/files/kelbt/kelbt-0.16.tar.gz as prerequisite. Also included in gist on GitHub.
tar xf kelbt-0.16.tar.gz
cd kelbt-0.16
./configure
make -j
make install-exec
Fetch version 6.10 of ragel
. THIS MUST DONE IN MINGW64 environment.
git -c core.eol=lf -c core.autocrlf=false clone -b ragel-6.10 https://github.com/adrian-thurston/ragel.git
Fix a bug for code generation with D language with this patch.
patch -l -p1 <<"EOF"
diff --git a/ragel/cdcodegen.cpp b/ragel/cdcodegen.cpp
--- a/ragel/cdcodegen.cpp
+++ b/ragel/cdcodegen.cpp
@@ -782,12 +782,12 @@ string DCodeGen::POINTER()
string DCodeGen::PTR_CONST()
{
- return "";
+ return "const(";
}
string DCodeGen::PTR_CONST_END()
{
- return "";
+ return ")";
}
EOF
Autoconf sources are quite old, run autoupdate
before autogen.sh
. We only
build the binary. Examples build would fail on absence of demonstration
language installed.
autoupdate
./autogen.sh
LDFLAGS="--static" ./configure --disable-manual
make -j
Verify this is a static binary
ldd ./ragel/ragel.exe