XBoard (GtkBoard?) pre-alpha

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
hgm
Posts: 28451
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard (GtkBoard?) pre-alpha

Post by hgm »

Ah yes. I started collecting the various patches I made in WinBoard before and during my holiday on my Linux system (where I maintain the source repository) only yesterday. And some of the WinBoard patches broke XBoard. I already fixed that for the Xaw version, but I did not try to compile the GTK version yet.

This particular error is du toe the -autoCreateLogon patch, which (when on) automatically creates an ICSlogon file from the name and pasword you type, to use thos next time when you login. I changed the type of the ICSInitScript function from void to int for that, to have it report whether the file already exited.

It seems that xboard.c still contains a 'prototype definition' for that function as 'void'. As far as I could tell the fact that the definition is there is an error in itself, because that function no longer resides in xboard.c, but has been moved to usystem.c in the pre-GTK core reorganization.

The warnings are innocent; in the GTK version FindFont is not used at all. It is left there only as a 'to-do' reminder, with all the actual Xaw-based code commented out (leading to the complaint that the variables are no longer used).

Today I am at the Leiden tourney, but I will repair the GTK version for the latest back-end changes soon after that.
ZirconiumX
Posts: 1361
Joined: Sun Jul 17, 2011 11:14 am
Full name: Hannah Ravensloft

Re: XBoard (GtkBoard?) pre-alpha

Post by ZirconiumX »

Just a quick little note: gtkboard does exist.

Code: Select all

matthew@dells-bells:~$ apt-cache search gtkboard | grep gtkboard
gtkboard - many board games in one program
Matthew:out
tu ne cede malis, sed contra audentior ito
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: XBoard (GtkBoard?) pre-alpha

Post by JoshPettus »

Oh wow, that's exciting, have fun Harm! :D
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: XBoard (GtkBoard?) pre-alpha

Post by JoshPettus »

Well I successfully compiled the gtk version in OSX

Note others using mac, use macports. First it has the latest version of gtk which fink hasn't updated past version 2 yet. Librsvg actually worked too so svg pieces works at least in gtk version. I havn't been able to compile xaw version for some reason see below. little crazy.

in the gtk version board resizing hasn't been implemented with the window yet? Seems like the board is fixed and moving the window around just adds space. Also doesn't seem to update the window properly. I have to flip the board so it will redraw when ever i start up xboard.

anyway here is the issue with the xaw version.

Code: Select all

Joshuas-MacBook-Pro:xboard-e7bcd69 herecomethej$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
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.out
checking for suffix of executables... 
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... /opt/local/bin/msgfmt
checking for gmsgfmt... /opt/local/bin/msgfmt
checking for xgettext... /opt/local/bin/xgettext
checking for msgmerge... /opt/local/bin/msgmerge
checking build system type... x86_64-apple-darwin12.2.0
checking host system type... x86_64-apple-darwin12.2.0
checking for ld used by GCC... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking for shared library run path origin... done
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for CFPreferencesCopyAppValue... yes
checking for CFLocaleCopyCurrent... yes
checking for GNU gettext in libc... no
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... -liconv
checking for GNU gettext in libintl... no
checking whether to use NLS... no
checking for remsh... no
checking for rsh... rsh
checking for makeinfo... makeinfo
checking for nroff... nroff -man
checking for awk... /usr/bin/awk
checking for perl... /opt/local/bin/perl
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... yes
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... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for _getpty... no
checking for grantpt... yes
checking for setitimer... yes
checking for usleep... yes
checking for gettimeofday... yes
checking for random... yes
checking for gethostname... yes
checking for setlocale... yes
checking for getpseudotty in -lseq... no
checking whether compiler understands -Wall -Wno-parentheses... yes
checking for pkg-config... /opt/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for CAIRO... yes
checking for X... libraries /usr/X11/lib, headers /usr/X11/include
checking whether -R must be followed by a space... no
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking X11/Intrinsic.h usability... yes
checking X11/Intrinsic.h presence... yes
checking for X11/Intrinsic.h... yes
checking X11/Xaw/Dialog.h usability... yes
checking X11/Xaw/Dialog.h presence... yes
checking for X11/Xaw/Dialog.h... yes
checking X11/xpm.h usability... yes
checking X11/xpm.h presence... yes
checking for X11/xpm.h... yes
checking for XpmReadFileToPixmap in -lXpm... yes
checking whether ptys or pipes should be used... pipes
checking for xdg-mime... no
checking for xdg-desktop-menu... no
checking for xdg-icon-resource... no
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 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:          /usr/local       
        datarootdir:     ${prefix}/share  
        datadir:         ${datarootdir}   (icons will go in $datadir/icons/hicolor/...)
                                    (bitmaps will go in $datadir/games/xboard/...)
        infodir:         ${datarootdir}/info   (info files will go here)
        sysconfdir:      ${prefix}/etc   (xboard.conf will go here)

        update mimedb:   yes

        NLS support:     no

        GTK:             no
        Xaw3d:           no
        Xaw:             yes

        xpm:             yes
        ptys:            pipes
        zippy:           no
        sigint:          yes
Joshuas-MacBook-Pro:xboard-e7bcd69 herecomethej$ make
make  all-recursive
Making all in po
  CC       backend.o
backend.c: In function ‘ParseBoard12’:
backend.c:4197: warning: unused variable ‘bookHit’
backend.c:4185: warning: unused variable ‘takeback’
backend.c:4184: warning: unused variable ‘i’
  CC       childio.o
  CC       gamelist.o
  CC       ngamelist.o
  CC       lists.o
  CC       moves.o
  CC       parser.o
  CC       pgntags.o
  CC       board.o
board.c: In function ‘DrawPosition’:
board.c:918: warning: implicit declaration of function ‘MarkMenuItem’
  CC       draw.o
In file included from draw.c:59:
/opt/local/include/librsvg-2.0/librsvg/rsvg-cairo.h:27:2: warning: #warning "Including <librsvg/rsvg-cairo.h> directly is deprecated."
  CC       dialogs.o
dialogs.c: In function ‘FileNamePopUp’:
dialogs.c:2577: warning: implicit declaration of function ‘FileNamePopUpGTK’
  CC       engineoutput.o
  CC       nengineoutput.o
  CC       evalgraph.o
  CC       nevalgraph.o
  CC       history.o
  CC       nhistory.o
  CC       menus.o
  CC       usounds.o
  CC       usystem.o
  CC       xaw/xboard.o
xaw/xboard.c:170:28: error: X11/Xaw/Dialog.h: No such file or directory
xaw/xboard.c:171:26: error: X11/Xaw/Form.h: No such file or directory
xaw/xboard.c:172:26: error: X11/Xaw/List.h: No such file or directory
xaw/xboard.c:173:27: error: X11/Xaw/Label.h: No such file or directory
xaw/xboard.c:174:32: error: X11/Xaw/SimpleMenu.h: No such file or directory
xaw/xboard.c:175:28: error: X11/Xaw/SmeBSB.h: No such file or directory
xaw/xboard.c:176:29: error: X11/Xaw/SmeLine.h: No such file or directory
xaw/xboard.c:177:25: error: X11/Xaw/Box.h: No such file or directory
xaw/xboard.c:178:32: error: X11/Xaw/MenuButton.h: No such file or directory
xaw/xboard.c:179:26: error: X11/Xaw/Text.h: No such file or directory
xaw/xboard.c:180:31: error: X11/Xaw/AsciiText.h: No such file or directory
xaw/xboard.c: In function ‘InitializeFonts’:
xaw/xboard.c:919: warning: unused variable ‘vTo’
xaw/xboard.c: In function ‘MarkMenuItem’:
xaw/xboard.c:1586: error: ‘XtNleftBitmap’ undeclared (first use in this function)
xaw/xboard.c:1586: error: (Each undeclared identifier is reported only once
xaw/xboard.c:1586: error: for each function it appears in.)
xaw/xboard.c:1586: warning: left-hand operand of comma expression has no effect
xaw/xboard.c: In function ‘CommentClick’:
xaw/xboard.c:1789: error: ‘XawTextPosition’ undeclared (first use in this function)
xaw/xboard.c:1789: error: expected ‘;’ before ‘index’
xaw/xboard.c:1792: warning: implicit declaration of function ‘XawTextGetSelectionPos’
xaw/xboard.c:1792: error: ‘dummy’ undeclared (first use in this function)
xaw/xboard.c:1797: warning: passing argument 1 of ‘LoadVariation’ makes integer from pointer without a cast
make[2]: *** [xaw/xboard.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: XBoard (GtkBoard?) pre-alpha

Post by Sven »

JoshPettus wrote:I havn't been able to compile xaw version for some reason see below. little crazy.
Have you cleaned and built from scratch after the last GTK build?

Or maybe the following is related to your problem, I don't know and can't check. "configure.ac" contains this code:

Code: Select all

dnl | make results available in Makefile.am
AM_CONDITIONAL([withGTK],   [test x"$with_GTK" = x"yes"])
AM_CONDITIONAL([withXaw],   [test x"$with_Xaw3d" = x"yes"])
AM_CONDITIONAL([withXaw],   [test x"$with_Xaw" = x"yes"])
where I would expect the second line to start with "AM_CONDITIONAL([withXaw3d]..." instead of "...withXaw...". Not sure whether it may help at all to change it, or whether changing it according to my expectation would even be correct, but it looks a bit like a copy&paste problem at least, and may have *some* influence on the build as well.

If I read the configure log followed by your error messages I get the impression that the generated makefile may be somehow inconsistent, possibly the include path is not set correctly for some reason. I'd assume the X11/Xaw headers are present (otherwise we can stop here ...) so it should really a problem of the configured include path.

Sven
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: XBoard (GtkBoard?) pre-alpha

Post by JoshPettus »

Yah, all that stuff checks out. I did make the change but no luck

I "echo $PATH" there exists the line
/opt/X11/include

And sure enough the "missing" headers are all there under "X11/Xaw/" so this has me scratching my head.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: XBoard (GtkBoard?) pre-alpha

Post by JoshPettus »

the ./configure generated says /usr/x11/ etc but that is a simlink to the original which is in /opt/ . So either would work right?
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: XBoard (GtkBoard?) pre-alpha

Post by Sven »

JoshPettus wrote:Yah, all that stuff checks out. I did make the change but no luck

I "echo $PATH" there exists the line
/opt/X11/include

And sure enough the "missing" headers are all there under "X11/Xaw/" so this has me scratching my head.
$PATH is irrelevant here, it is for calling programs without the need to mention their location, as in calling "gcc" instead of "/where/ever/gcc/is/installed/bin/gcc". I wonder why /opt/X11/include is in your $PATH even though that folder probably does not contain any executables, but answering that does not help here.

The include path of the compiler is buried somewhere in the generated makefile. I'd recommend to make the command line that does the job behind

Code: Select all

  CC       xaw/xboard.o
visible somehow to see whether it contains "-I /usr/X11/include" or "-I /opt/X11/include". A manual way to achieve this would be to patch the generated makefile by removing the "@" sign at the beginning of the rule that builds .o files from .c files (maybe just for xaw/xboard.c if such a single rule exists).

The symlink stuff sounds o.k. so /usr/X11 and /opt/X11 should both work.

Any permission problem perhaps?

ls -ld /opt/X11/include
ls -ld /opt/X11/include/X11
ls -ld /opt/X11/include/X11/Xaw
ls -l /opt/X11/include/X11/Xaw/Dialog.h

Sven
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: XBoard (GtkBoard?) pre-alpha

Post by JoshPettus »

I think i got it to do what you asked.

All it put out for the xboard.o part is

Code: Select all

echo "  CC      " depbase=`echo xaw/xboard.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DHAVE_CONFIG_H -I.  -DINFODIR='"/usr/local/share/info"' -D_REENTRANT -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng15 -I/opt/local/include/librsvg-2.0 -I/opt/local/include/gdk-pixbuf-2.0     -DSYSCONFDIR='"/usr/local/etc"' -DLOCALEDIR='"/usr/local/share/locale"' -DSVGDIR='"/usr/local/share/games/xboard/themes/default"' -I xaw -DX11   -Wall -Wno-parentheses -MT xaw/xboard.o -MD -MP -MF $depbase.Tpo -c -o xaw/xboard.o xaw/xboard.c &&\
	mv -f $depbase.Tpo $depbase.Po
  CC       depbase=xaw/.deps/xboard
xaw/xboard.c:170:28: error: X11/Xaw/Dialog.h: No such file or directory
xaw/xboard.c:171:26: error: X11/Xaw/Form.h: No such file or directory
xaw/xboard.c:172:26: error: X11/Xaw/List.h: No such file or directory
xaw/xboard.c:173:27: error: X11/Xaw/Label.h: No such file or directory
xaw/xboard.c:174:32: error: X11/Xaw/SimpleMenu.h: No such file or directory
xaw/xboard.c:175:28: error: X11/Xaw/SmeBSB.h: No such file or directory
xaw/xboard.c:176:29: error: X11/Xaw/SmeLine.h: No such file or directory
xaw/xboard.c:177:25: error: X11/Xaw/Box.h: No such file or directory
xaw/xboard.c:178:32: error: X11/Xaw/MenuButton.h: No such file or directory
xaw/xboard.c:179:26: error: X11/Xaw/Text.h: No such file or directory
xaw/xboard.c:180:31: error: X11/Xaw/AsciiText.h: No such file or directory
xaw/xboard.c: In function ‘InitializeFonts’:
xaw/xboard.c:919: warning: unused variable ‘vTo’
xaw/xboard.c: In function ‘MarkMenuItem’:
xaw/xboard.c:1586: error: ‘XtNleftBitmap’ undeclared (first use in this function)
xaw/xboard.c:1586: error: (Each undeclared identifier is reported only once
xaw/xboard.c:1586: error: for each function it appears in.)
xaw/xboard.c:1586: warning: left-hand operand of comma expression has no effect
xaw/xboard.c: In function ‘CommentClick’:
xaw/xboard.c:1789: error: ‘XawTextPosition’ undeclared (first use in this function)
xaw/xboard.c:1789: error: expected ‘;’ before ‘index’
xaw/xboard.c:1792: warning: implicit declaration of function ‘XawTextGetSelectionPos’
xaw/xboard.c:1792: error: ‘dummy’ undeclared (first use in this function)
xaw/xboard.c:1797: warning: passing argument 1 of ‘LoadVariation’ makes integer from pointer without a cast
make[2]: *** [xaw/xboard.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Joshuas-MacBook-Pro:xboard-e7bcd69 herecomethej$ 
your permissions test yielded

Code: Select all

Joshuas-MacBook-Pro:xboard-e7bcd69 herecomethej$ ls -ld /opt/X11/include
drwxr-xr-x  18 root  wheel  612 Oct  4 01:57 /opt/X11/include
Joshuas-MacBook-Pro:xboard-e7bcd69 herecomethej$ ls -ld /opt/X11/include/X11
drwxr-xr-x  88 root  wheel  2992 Jan 14 22:03 /opt/X11/include/X11
Joshuas-MacBook-Pro:xboard-e7bcd69 herecomethej$ ls -ld /opt/X11/include/X11/Xaw
drwxr-xr-x  73 root  wheel  2482 Oct  4 01:56 /opt/X11/include/X11/Xaw
Joshuas-MacBook-Pro:xboard-e7bcd69 herecomethej$ ls -l /opt/X11/include/X11/Xaw/Dialog.h 
-rwxr-xr-x  1 root  wheel  3426 Sep 27 17:41 /opt/X11/include/X11/Xaw/Dialog.h
User avatar
hgm
Posts: 28451
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard (GtkBoard?) pre-alpha

Post by hgm »

First let me stress I have no Mac, and only know very little about the Linux automake process (which, for XBoard, is all handled by Arun Persaud). If I look at the above output, however, I notice that there is a -I/opt/local/include in the command, while in fact your files are in /opt/X11/include. The latter is not mentioned anywhere in the linking command.

One thing you could try is to copy the entire subtree /opt/X11/include/X11/* to /opt/local/include. (Perhaps this can be solved by making a symbolic link, but I know little about that). If the includes work, you might get a similar problem with the actual libraries.