On Saturday, 4 March 2023, 05:57:43 GMT, Werner LEMBERG <[email protected]> wrote:
> > in Makefile, near line 304: > > > > Change > > > > EXTRAFLAGS = $DUNIX $DHAVE_POSIX_TERMIOS > > > > to > > > > EXTRAFLAGS = > > > > that's the line which blindly defines "-DUNIX -DHAVE_POSIX_TERMIOS". > > With this simple change, ttdebug cross-builds. > Good catch! > > I guess nobody have tried cross-compiling the freetype demos for > > windows for years, or building all the freetype demos for windows > > natively (i.e., with visual studio) ever - a few of visual studio > > projects are missing. > This is most likely a correct assumption – at least for `Makefile`. > Meson support, on the other hand, also builds `ttdebug`; maybe this > works already out of the box on Windows, too. It is a bit more troublesome than that... those EXTRAFLAGS were at the initial commit - i.e. 20+ years old. So the assumptions have always been that autoconf/make build = unix etc. That's obviously not the case for cross-compile for windows, or msys2 . I haven't tried the meson build yet, but I can't see it defining UNIX anywhere. So likely windows build works, but linux build is crippled / broken - -dUNIX is used for 4 programs, ttdebug, ftbench, gbench, ftlint. For ftbench and ftlint, usage seems to be trivial - just function stubs for getopt(). gbench is for timing fuctions, and ttdebug for temios. so gbench is a bit crippled without the timing functions, while I think ttdebug meson shouldn't build on linux at all, since without -dUNIX, it should look for windows's conio.h .
