GITVERSION=$(shell sh -c 'git describe --dirty --always 2>/dev/null')
AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @X_CFLAGS@ @CAIRO_CFLAGS@ @FRONTEND_CFLAGS@ -DSYSCONFDIR='"$(sysconfdir)"' \
-DLOCALEDIR='"$(localedir)"' -DSVGDIR='"$(svgdir)"' -D__GIT_VERSION='"$(GITVERSION)"' \
- -DCONFIGURE_OPTIONS='"@CONFIGURE_OPTIONS@"' $(headers)
+ -DCONFIGURE_OPTIONS='"@CONFIGURE_OPTIONS@"' -DDATADIR='"$(datadir)/games/xboard"' $(headers)
ACLOCAL_AMFLAGS = -I m4
themes/xiangqi/BlackPawn.svg themes/xiangqi/WhitePawn.svg \
themes/xiangqi/BlackRook.svg themes/xiangqi/WhiteRook.svg
+### directory and files for themes (and other) configuration files
+
+themesdir = $(datadir)/games/xboard/themes/conf
+dist_themes_DATA = conf/shogi conf/xq conf/chu conf/ics conf/mini conf/mini.fen conf/sho conf/sho.fen
+
### directory and files for pixmaps
pixmapsdir = $(gamedatadir)/pixmaps/textures
}
if (ok) {
f = fopen(fullname, "r");
+#ifdef DATADIR
+ if(f == NULL && *fullname != '/') { // when a relative name did not work
+ MySearchPath(DATADIR "/themes/conf", name, fullname); // also look in standard place
+ f = fopen(fullname, "r");
+ }
+#endif
if (f != NULL) {
if (addr != NULL) {
ASSIGN(*addr, fullname);
case ArgString:
case ArgFilename:
+#ifdef DATADIR
+ if(argValue[0] == '~' && argValue[1] == '~') {
+ char buf[4*MSG_SIZ]; // expand ~~
+ snprintf(buf, 4*MSG_SIZ, DATADIR "%s", argValue+2);
+ ASSIGN(*(char **) ad->argLoc, buf);
+ break;
+ }
+#endif
ASSIGN(*(char **) ad->argLoc, argValue);
break;
--- /dev/null
+;
+; settings for oriental Chu-Shogi theme
+;
+-variant chu
+;
+; pieces: supplied chu-shogi svg's, and flip them in flipView
+;
+-pid ~~/themes/chu
+-flipBlack true
+-trueColors true
+;
+; board: no checkering (both w. and w.o. texture)
+;
+-liteBackTextureFile "~~/themes/textures/wood_l.png"
+-darkBackTextureFile "~~/themes/textures/wood_l.png"
+-lightSquareColor #FF8040
+-darkSquareColor #FF8040
+;
+; detour under-promotion is less convenient when non-pawns promote
+;
+-sweepPromotions false
+;
+; legality testing must be on for double-moves to work, no adjudication
+;
+-testLegality true
+-trivialDraws false
+-materialDraws false
+;
+; make the Lion roar on double captures
+;
+-roarSound roar.wav
+;
+; redefine default engine
+;
+-fcp hachu
+-scp hachu
+;
+; set up own persistence file, used for this theme only
+;
+-settingsFile ~/.xboard-chu-rc
+-saveSettingsFile ~/.xboard-chu-rc
+
--- /dev/null
+;
+; settings for Internet Chess Server client
+;
+-ics
+;
+; set up own persistence file, used for ICS play
+;
+-settingsFile ~/.xboard-ics-rc
+-saveSettingsFile ~/.xboard-ics-rc
+
--- /dev/null
+;
+; additional settings for Judkins Shogi
+;
+-variant shogi
+;
+; size overrides
+;
+-boardWidth 6
+-boardHeight 6
+-holdingsSize 6
+;
+; remove L from piece set
+;
+-pieceToCharTable "PNBR.S...G.++++.+Kpnbr.s...g.++++.+k"
+;
+; provide initial position
+;
+-loadPositionFile "~~/themes/conf/judkins.fen"
+
--- /dev/null
+rbnsgk/6p/6/6/P5/KGSNBR w 0 1
+
--- /dev/null
+;
+; additional settings for mini-Shogi
+;
+-variant shogi
+;
+; size overrides
+;
+-boardWidth 5
+-boardHeight 5
+-holdingsSize 5
+;
+; remove L and N from piece set
+;
+-pieceToCharTable "P.BR.S...G.+.++.+Kp.br.s...g.+.++.+k"
+;
+; redefine default engine
+;
+-fcp gnuminishogi
+-scp gnuminishogi
+;
+; provide initial position
+;
+-loadPositionFile "~~/themes/conf/mini.fen"
+
--- /dev/null
+rbsgk/4p/5/P4/KGSBR w 0 1
+
--- /dev/null
+;
+; additional settings for Sho Shogi
+;
+-variant shogi
+;
+; size overrides
+;
+-boardWidth 9
+-boardHeight 9
+-holdingsSize 0
+;
+; add Elephant to piece set
+;
+-pieceToCharTable "PNBRLSE..G.++++++Kpnbrlse..g.++++++k"
+;
+; provide initial position
+;
+-loadPositionFile "~~/themes/conf/sho.fen"
+;
+; redefine default engine
+;
+-fcp hachu
+-scp hachu
+
--- /dev/null
+lnsgkgsnl/1r2e2b1/ppppppppp/9/9/9/PPPPPPPPP/1B2E2R1/LNSGKGSNL w 0 1
+
--- /dev/null
+;
+; settings for oriental Shogi theme
+;
+-variant shogi
+;
+; pieces: supplied shogi svg's, and flip them in flipView
+;
+-pid ~~/themes/shogi
+-flipBlack true
+-trueColors true
+;
+; board: no checkering (both w. and w.o. texture)
+;
+-liteBackTextureFile "~~/themes/textures/wood_l.png"
+-darkBackTextureFile "~~/themes/textures/wood_l.png"
+-lightSquareColor #FF8040
+-darkSquareColor #FF8040
+;
+; detour under-promotion is less convenient when non-pawns promote
+;
+-sweepPromotions false
+;
+; no adjudication
+;
+-trivialDraws false
+-materialDraws false
+;
+; common non-compliant notations
+;
+-colorNickNames "sg"
+;
+; redefine default engine
+;
+-fcp gnushogi
+-scp gnushogi
+;
+; set up own persistence file, used for this theme only
+;
+-settingsFile ~/.xboard-shogi-rc
+-saveSettingsFile ~/.xboard-shogi-rc
+
--- /dev/null
+;
+; settings for oriental Xiangqi theme
+;
+-variant xiangqi
+;
+; pieces: supplied xiangqi svg's
+;
+-pid ~~/themes/xiangqi
+-trueColors true
+;
+; board: supplied board bitmap
+;
+-liteBackTextureFile "~~/themes/textures/xqboard.png"
+-darkBackTextureFile "~~/themes/textures/xqboard.png"
+;
+; suppress square boundaries and highlight with arrow instead
+;
+-overrideLineGap 0
+-highlightMovesWithArrow true
+;
+; define common non-compliant notations
+;
+-pieceNickNames ".N...MB..G..n...mb..g."
+-colorNickNames "r."
+;
+; set up own persistence file, used for this theme only
+;
+-settingsFile ~/.xboard-xiangqi-rc
+-saveSettingsFile ~/.xboard-xiangqi-rc
+
--- /dev/null
+;
+; settings for oriental Xiangqi theme
+;
+-variant xiangqi
+;
+; pieces: supplied xiangqi svg's
+;
+-pid ~~/themes/xiangqi
+-trueColors true
+;
+; board: supplied board bitmap
+;
+-useBoardTexture true
+-liteBackTextureFile "~~/themes/textures/xqboard.png"
+-darkBackTextureFile "~~/themes/textures/xqboard.png"
+;
+; suppress square boundaries and highlight with arrow instead
+;
+-overrideLineGap 0
+-highlightMoveWithArrow true
+;
+; define common non-compliant notations
+;
+-pieceNickNames ".N...MB..G..n...mb..g."
+-colorNickNames "r."
+;
+; set default engines
+;
+-fcp maxqi
+-scp maxqi
+;
+; set up own persistence file, used for this theme only
+;
+-settingsFile ~/.xboard-xiangqi-rc
+-saveSettingsFile ~/.xboard-xiangqi-rc
+
}
if (*s == '~') {
+ if(s[1] == '~') { // use ~~ for XBoard's private data directory
+ snprintf(d, 4*MSG_SIZ, DATADIR "%s", s+2);
+ } else
if (*(s+1) == '/') {
safeStrCpy(d, getpwuid(getuid())->pw_dir, 4*MSG_SIZ );
strcat(d, s+1);