Xboard GTK for Windows

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

Xboard GTK for Windows

Postby Josh Pettus » 28 Dec 2015, 20:45

I've been thinking about trying this for a while. In theory rather then have 2 separate code bases we could just use xboardGTK instead as GTK2 is available for windows as well. This has a few advantages
1. Easier to maintain
2. Librsvg/cairo is much more advanced then win32's rendering:
- SVG images on top of looking cleaner are much more practical and easier to create then chess fonts. (Inkscape is free and does a great job converting raster images to vector. Proper font software can cost hundreds of dollars )
-Resizable png images over the cumbersome bitmaps for every size cannot be overstated.
-Board Scalable to any size, not just fixed ones.

Fact is after using Xboard on OSX for years, Winbord just looks ugly :)

We would have to figure out the bundling later. Perhaps to some relative directory system: But it should be more then possible.
Step 1 though is to try to get it to compile.

Anyway I installed the mingw/msys package over here (mingw is a version of GCC modified to make native windows binaries)
and downloaded the mingw GTK+ package here, and merged the folder into the mingw root folder:
http://sourceforge.net/projects/gtk-min ... s/gtk%2B2/
and did the same for mingw librsvg package here:
http://sourceforge.net/projects/gtk-min ... s/librsvg/

By default MSYS root folder is separate from the MinGW folder. This is cumbersome and I found it much easier to take the contents of ./MSYS/1.0/ folder to the root folder of MinGW, then deal with finding the libraries.

autogen.sh ran fine (I first tried it with a development build and got the same issue)
configure ran fine:
Code: Select all
$ ./configure --with-gtk -prefix=/mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for library containing strerror... none required
checking whether NLS is requested... yes
checking for msgfmt... /bin/msgfmt
checking for gmsgfmt... /bin/msgfmt
checking for xgettext... /bin/xgettext
checking for msgmerge... /bin/msgmerge
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking for ld used by GCC... c:/mingw/mingw32/bin/ld.exe
checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... no
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... /mingw32/lib/libiconv.dll.a -L/mingw32/lib
checking for GNU gettext in libintl... yes
checking whether to use NLS... yes
checking where the gettext function comes from... external libintl
checking how to link with libintl... -lintl
checking for remsh... no
checking for rsh... rsh
checking for makeinfo... makeinfo
checking for nroff... cat
checking for awk... /bin/awk
checking for perl... /bin/perl
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking return type of signal handlers... void
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking stropts.h usability... no
checking stropts.h presence... no
checking for stropts.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/systeminfo.h usability... no
checking sys/systeminfo.h presence... no
checking for sys/systeminfo.h... no
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking sys/socket.h usability... no
checking sys/socket.h presence... no
checking for sys/socket.h... no
checking lan/socket.h usability... no
checking lan/socket.h presence... no
checking for lan/socket.h... no
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for _getpty... no
checking for grantpt... no
checking for setitimer... no
checking for usleep... yes
checking for gettimeofday... yes
checking for random... no
checking for rand48... no
checking for gethostname... no
checking for sysinfo... no
checking for setlocale... yes
checking for getpseudotty in -lseq... no
checking whether compiler understands -Wall -Wno-parentheses... yes
checking for pkg-config... pkg-config
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for CAIRO... yes
checking for xdg-mime... no
checking for xdg-desktop-menu... no
checking for xdg-icon-resource... no
checking for GTK... yes
checking whether ptys or pipes should be used... pipes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cmail
config.status: creating po/Makefile.in
config.status: creating osxapp/Info.plist
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing test-stamp-h commands
config.status: executing chmod-cmail commands

 Configurations summary:

        prefix:          /mingw32
        datarootdir:     ${prefix}/share
        datadir:         ${datarootdir}
        gamedatadir:     $(datadir)/games/xboard
        desktopdir:      $(datadir)/applications
        mimedir:         $(datadir)/mime/packages
        iconsdir:        $(datadir)/icons/hicolor/48x48/apps
        svgiconsdir:     $(datadir)/icons/hicolor/scalable/apps
        infodir:         ${datarootdir}/info   (info files will go here)
        sysconfdir:      ${prefix}/etc   (xboard.conf will go here)

        update mimedb:   yes

        NLS support:     yes

        GTK:             yes
        Xaw3d:           no
        Xaw:             no

        ptys:            pipes
        zippy:           no
        sigint:          yes

But make failed with:

Code: Select all
$ make
make  all-recursive
make[1]: Entering directory `/home/herec/xboard-4.8.0'
Making all in po
make[2]: Entering directory `/home/herec/xboard-4.8.0/po'
make[2]: Leaving directory `/home/herec/xboard-4.8.0/po'
make[2]: Entering directory `/home/herec/xboard-4.8.0'
  CC       backend.o
<command-line>:0:9: error: expected identifier or '(' before string constant
backend.c: In function 'read_from_ics':
backend.c:4024:21: warning: variable 'blackname' set but not used [-Wunused-but-set-variable]
   char *whitename, *blackname, *why, *endtoken;
backend.c:4024:9: warning: variable 'whitename' set but not used [-Wunused-but-set-variable]
   char *whitename, *blackname, *why, *endtoken;
backend.c: In function 'HandleMachineMove':
backend.c:9453:10: warning: unknown conversion type character 'l' in format [-Wformat=]
          &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) {
backend.c:9453:10: warning: format '%[^
' expects argument of type 'char *', but argument 7 has type 'long long unsigned int *' [-Wformat=]
backend.c:9453:10: warning: too many arguments for format [-Wformat-extra-args]
backend.c:9601:10: warning: unknown conversion type character 'l' in format [-Wformat=]
          &mvtot, mvname) >= 5) {
backend.c:9601:10: warning: format '%d' expects argument of type 'int *', but argument 4 has type 'long long unsigned int *' [-Wformat=]
backend.c:9601:10: warning: format '%s' expects argument of type 'char *', but argument 7 has type 'int *' [-Wformat=]
backend.c:9601:10: warning: too many arguments for format [-Wformat-extra-args]
backend.c:9664:10: warning: unknown conversion type character 'l' in format [-Wformat=]
          &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5)
backend.c:9664:10: warning: format '%[^
' expects argument of type 'char *', but argument 7 has type 'long long unsigned int *' [-Wformat=]
backend.c:9664:10: warning: too many arguments for format [-Wformat-extra-args]
make[2]: *** [backend.o] Error 1
make[2]: Leaving directory `/home/herec/xboard-4.8.0'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/herec/xboard-4.8.0'
make: *** [all] Error 2

Leaves me scratching my head. Must be some MinGW quirk as there is no line 0 in backend.c or any file. Does anyone have any ideas?
Josh Pettus
Posts: 309
Joined: 11 Mar 2009, 01:11

Re: Xboard GTK for Windows

Postby H.G.Muller » 29 Dec 2015, 11:43

It says <command-line>, which would make me think it is actually complaining against the way the Makefile invoked the compiler (like a syntax error in a -D option for defining a macro).

The idea to use XBoard on Windows too has come up before, but what stopped me is that it seemed to require installing hundreds of MB of non-standard libraries. I want to distribute packages that run 'out-of-the-box', and it would be pretty annoying if every bundle of engine + GUI I host would have to be >100MB instead of the ~700KB it is with winboard.exe in it. So I did not want to abandon the dedicated Windows front end. (Although I agree that XBoard graphics by now looks much better.)

But that should of course not stop people that do want to go through the trouble of installing the required infra-structure to use XBoard on Windows. Cygwin is supposed to be able to compile and run XBoard, and I think I actually tried that once (but that was before we had a GTK version). That was not a MinGW compile, though, but was using the Cygwin infra-structure (cygwin1.dll and such).

From the list of warnings I get the impression there is an incompatibility with the way of representing int64 arguments in printf() format strings. This has always been a problem in MinGW compiles, as gcc expects you to use %lld, while the library routines of the Windows API expect %I64d, where gcc again takes %I to mean something entirely different. So the way gcc matches the argument with the format (solely for the purpose of checking and issuing warnings) is different from what actually happens at run time. (When you linked to the Windows API.) And the code is written to assume linking to the Windows API when the macro WIN32 is defined.
User avatar
Posts: 3066
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Xboard GTK for Windows

Postby Josh Pettus » 29 Dec 2015, 16:07

I'll take a look at those compile options.

The OSX app is bundled with all the non standard libraries and it's only 27Mb (19Mb of which is the libraries themselves). I don't think that's too large, especially this day and age. All the other chess GUI's are much larger.

We would have to think about the bundling though, and how xboard accesses its resources to make it portable. (kinda like we do with the mac version only without the benefit of the integration library.) We also have to figure out what we actually need for runtime. I'll poke at it with a stick for now, see if it moves. :)
Josh Pettus
Posts: 309
Joined: 11 Mar 2009, 01:11

Re: Xboard GTK for Windows

Postby Josh Pettus » 30 Dec 2015, 04:30

On the other hand GTK really is a PIA, so I really don't blame you....
Josh Pettus
Posts: 309
Joined: 11 Mar 2009, 01:11

Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 2 guests