From 762e18baef5f815cc46019ba3e082bd5ec1980f6 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 2 May 2009 10:50:10 -0700 Subject: [PATCH] changes from H.G. Muller; version 4.3.15 --- Makefile.am | 10 + Makefile.in | 16 +- README | 135 + acconfig.h | 3 + aclocal.m4 | 868 +++ backend.c | 792 ++- backend.h | 8 +- book.c | 472 ++ common.h | 24 +- config.h.in | 175 +- configure |10623 +++++++++++++++++++++++++---------- configure.in | 75 +- copyright.texi | 2 + engine-intf.html | 88 +- manual.html | 535 ++ moves.c | 130 +- moves.h | 322 +- pg_key.c | 340 ++ pg_show.c | 194 + pixmaps/ANALYZING_14.xpm | 23 + pixmaps/BLACK_14.xpm | 23 + pixmaps/CLEAR_14.xpm | 23 + pixmaps/PONDER_14.xpm | 23 + pixmaps/THINKING_14.xpm | 23 + pixmaps/UNKNOWN_14.xpm | 23 + pixmaps/WHITE_14.xpm | 23 + pixmaps/kdd49.xpm | 12 +- pixmaps/kdl49.xpm | 12 +- pixmaps/mdd33.xpm | 55 +- pixmaps/mdl33.xpm | 55 +- pixmaps/pixmaps.h | 120 +- uci.c | 26 +- winboard/config.h | 14 +- winboard/cygwin.mak | 188 +- winboard/readme.txt | 33 +- winboard/resource.h | 14 +- winboard/shogibitmaps/bamazon.bmp | Bin 0 -> 1476 bytes winboard/shogibitmaps/king.bmp | Bin 0 -> 3238 bytes winboard/shogibitmaps/largeking.bmp | Bin 0 -> 143154 bytes winboard/wengineo.c | 751 +++ winboard/winboard.c | 195 +- winboard/winboard.h | 355 +- winboard/winboard.ini | 596 ++- winboard/winboard.rc | 36 +- winboard/woptions.c | 73 +- xboard.c | 457 ++- xboard.h | 236 +- xboard.texi | 513 ++- xengineoutput.c | 1266 +++++ xhistory.c | 33 +- xoptions.c | 1401 +++++ zippy.c | 6 +- 52 files changed, 16878 insertions(+), 4542 deletions(-) create mode 100644 Makefile.am create mode 100644 README create mode 100644 aclocal.m4 mode change 100755 => 100644 bitmaps/dopkbm.sh mode change 100755 => 100644 bitmaps/dopkbm1.sh mode change 100755 => 100644 bitmaps/unsigned.sh create mode 100644 book.c mode change 100755 => 100644 config.guess mode change 100755 => 100644 config.sub mode change 100755 => 100644 configure mode change 100755 => 100644 install-sh create mode 100644 manual.html mode change 100755 => 100644 mkinstalldirs create mode 100644 pg_key.c create mode 100644 pg_show.c create mode 100644 pixmaps/ANALYZING_14.xpm create mode 100644 pixmaps/BLACK_14.xpm create mode 100644 pixmaps/CLEAR_14.xpm create mode 100644 pixmaps/PONDER_14.xpm create mode 100644 pixmaps/THINKING_14.xpm create mode 100644 pixmaps/UNKNOWN_14.xpm create mode 100644 pixmaps/WHITE_14.xpm mode change 100755 => 100644 pxboard mode change 100755 => 100644 texi2man create mode 100644 winboard/shogibitmaps/bamazon.bmp create mode 100644 winboard/shogibitmaps/king.bmp create mode 100644 winboard/shogibitmaps/largeking.bmp create mode 100644 winboard/wengineo.c create mode 100644 xengineoutput.c create mode 100644 xoptions.c diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..cb1a1e5 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,10 @@ +AM_CPPFLAGS=-DINFODIR='"$(infodir)"' +AM_LDFLAGS=-lXt -lm @XAW_LIBS@ +bin_PROGRAMS = xboard +xboard_SOURCES = backend.c lists.c pgntags.c xedittags.c xhistory.c zippy.c childio.c moves.c uci.c xengineoutput.c xoptions.c gamelist.c parser.c xboard.c xgamelist.c +info_TEXINFOS = copyright.texi xboard.texi +man6_MANS = xboard.man + +xboard.man: xboard.texinfo xboard.texi copyright.texi gpl.texinfo + $(srcdir)/texi2man xboard.texinfo > xboard.man || (rm -f xboard.man ; false) + diff --git a/Makefile.in b/Makefile.in index bb8ec86..663db0b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -49,14 +49,15 @@ DISTSOURCE = acconfig.h AUTHORS backend.c backend.h backendz.h bitmaps \ parser.l pgntags.c pixmaps pxboard READ_ME shiphtml sounds texi2man \ ToDo winboard xboard.c xboard.h xboard.texi xboard.texinfo.in \ xedittags.c xedittags.h xgamelist.c xgamelist.h xhistory.c xhistory.h \ - zic2xpm.c zic2xpm.man zippy.c zippy.h zippy.lines zippy.README + zic2xpm.c zic2xpm.man zippy.c zippy.h zippy.lines zippy.README book.c PSEUDOSOURCE = parser.c xboard.man xboard.info xboard.txt zic2xpm.txt FAQ DISTDIR = @PRODUCT@-@VERSION@.@PATCHLEVEL@ XBOARDOBJ = parser.o xboard.o backend.o moves.o childio.o gamelist.o \ - lists.o pgntags.o xgamelist.o xedittags.o xhistory.o @ZIPPY_O@ + lists.o pgntags.o xgamelist.o xedittags.o xhistory.o uci.o \ + xengineoutput.o xoptions.o book.o @ZIPPY_O@ default: xboard zic2xpm @@ -182,6 +183,8 @@ backend.o: backend.h lists.h backend.o: parser.h backend.o: moves.h backend.o: zippy.h +book.o: common.h +book.o: backend.h childio.o: config.h childio.o: common.h childio.o: frontend.h @@ -239,6 +242,15 @@ xhistory.o: backend.h xhistory.o: xboard.h xhistory.o: xhistory.h xhistory.o: lists.h +xengineoutput.o: common.h +xengineoutput.o: frontend.h +xengineoutput.o: backend.h +xengineoutput.o: xboard.h +xoptions.o: common.h +xoptions.o: backend.h +xoptions.o: xboard.h +uci.o: common.h +uci.o: backend.h zippy.o: backend.h zippy.o: backendz.h zippy.o: config.h diff --git a/README b/README new file mode 100644 index 0000000..a27021b --- /dev/null +++ b/README @@ -0,0 +1,135 @@ + +What is XBoard? +=============== +XBoard is a graphical chessboard for the X Window System. It can +serve as a user interface for chess engines such as GNU Chess, for the +Internet Chess Server, or for electronic mail correspondence chess. +XBoard can also be used by itself. See the manual page xboard.txt for +further details. + +XBoard is free software, copyrighted by the Free Software Foundation +and released under the GNU General Public License (GPL). See the file +COPYING for details. + +You can build xboard on most systems with the following commands. + + ./configure + make + +See the file INSTALL for more detailed instructions. + +See the file FAQ.html for answers to frequently asked questions. + + +What is WinBoard? +================= +WinBoard is a port of XBoard to run natively on Windows. It is part +of the XBoard project and is released under the same terms as XBoard. + +You can build WinBoard using the free Cygwin toolchain from +www.cygnus.com with the following commands. + + cd winboard + make -f cygwin.mak + +You can build WinBoard using Microsoft Visual C with the following +commands, or by opening the project in Visual Studio and clicking the +build button. + + cd winboard + nmake -f msvc.mak + +There is also a contributed .mak file for Borland C. It's not +maintained and thus may need updating if you want to use it. + + +Reporting problems +================== + +Report bugs and problems with XBoard and WinBoard to +. With XBoard, please use the "script" program +to start a typescript, run XBoard with the -debug command line option, +and include the typescript output in your message. With WinBoard, +please use the /debug command line option and include the contents of +the file WinBoard.debug. Also tell us what kind of machine and what +operating system version you are using. On Unix, the command "uname +-a" will tell you this. On Windows, right-click on My Computer and +select Properties. + +Here is a sample of approximately what you should type (on Unix): + + script + uname -a + ./configure + make + ./xboard -debug + exit + mail bug-xboard@gnu.org + Subject: Your short description of the problem + Your detailed description of the problem + ~r typescript + . + +If you improve XBoard, please send a message about your changes, and +we will get in touch with you about merging them in to the main line +of development. + +Version 4.3.14 +============== + +This relaese was not made by the GNU xboard team, but by H.G.Muller. +It mainly contains developments on WinBoard. Nevertheless, an attempt +has been started to back-port the enormous number of improvements that +have been made to WinBoard since the Linux and Windows developments branched +to xboard. This is reflected by the source tree now having the same format +as that of xboard 4.2.7, including all the xboard sources. + +An enormous amount of work still has to be done to make the xboard version +fully equivalent to WinBoard, especially on user-interface side. As a modest +beginning, the xboard source files have been patched to allow their compilation +with the newer back-end files from WinBoard. To this end, the number of piece +types in xboard has been increased from 6 to 22, and the WinBoard bitmaps +have been converted to xboard source format (.bm) and are included in the +xboard bitmaps directory. Other quick patches include the coloring of the +board squares (for xiangqi and holdings), and some code in the user-move +handling to suppress all moves into or out of the area between board and +holdings in crazyhouse, and the treatment of king-captures-own-piece +as a possibly valid move (for FRC castling). This should make it possible +to run xboard with the new back-end files without too much inconvenience. + +New xboard command-line options have been added to make the added back-end +features available. The include the new variants (as argument of the old +-variant option), -boardWidth, -boardHeight and -holdingsSize. Be sure +to call xboard with "-boardSize middling" or "-boardSize bulky" if you +want to play with fairy pieces, or xboard might crash due to unavailability +of bitmaps. Other added xboard options are: + +ADJUDICATION OPTIONS: +-checkMates +-testClaims +-materialDraws +-trivialDraws +-ruleMoves +-repeatsToDraw +-adjudicateLossThreshold +-firstScoreAbsolute +-secondScoreAbsolute + +TIME-CONTROL OPTIONS +-firstTimeOdds +-secondTimeOdds +-timeOddsMode +-firstNPS +-secondNPS + +GENERAL OPTIONS +-matchPause +-engineDebugOutput +-userName +-pgnExtendedInfo +-pgnEventHeader +-hideThinkingFromHuman + +This is all completely untested, but as the options merely switch on well-tested +code in the back-end, there should not be too many problems with them. +Bugs can be reported in the WinBoard forum. \ No newline at end of file diff --git a/acconfig.h b/acconfig.h index ceb3f58..8957afb 100644 --- a/acconfig.h +++ b/acconfig.h @@ -52,3 +52,6 @@ #define HAVE_USLEEP 0 #undef USE_XAW3D + +#define X_LOCALE + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..eb3b99a --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,868 @@ +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 13 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/backend.c b/backend.c index 859a47f..5496797 100644 --- a/backend.c +++ b/backend.c @@ -56,7 +56,6 @@ #else #define DoSleep( n ) -typedef int BOOL; #endif @@ -165,7 +164,7 @@ void ApplyMove P((int fromX, int fromY, int toX, int toY, int promoChar, Board board)); void MakeMove P((int fromX, int fromY, int toX, int toY, int promoChar)); void ShowMove P((int fromX, int fromY, int toX, int toY)); -void FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY, +int FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY, /*char*/int promoChar)); void BackwardInner P((int target)); void ForwardInner P((int target)); @@ -216,8 +215,13 @@ void ParseFeatures P((char* args, ChessProgramState *cps)); void InitBackEnd3 P((void)); void FeatureDone P((ChessProgramState* cps, int val)); void InitChessProgram P((ChessProgramState *cps, int setup)); +ChessProgramState *WhitePlayer(); char *GetInfoFromComment( int, char * ); // [HGM] PV time: returns stripped comment +void InitEngineUCI( const char * iniDir, ChessProgramState * cps ); // [HGM] moved here from winboard.c +char *ProbeBook P((int moveNr, char *book)); // [HGM] book: returns a book move +char *SendMoveToBookUser P((int nr, ChessProgramState *cps, int initial)); // [HGM] book +extern char installDir[MSG_SIZ]; extern int tinyLayout, smallLayout; static ChessProgramStats programStats; @@ -228,6 +232,7 @@ int startedFromPositionFile = FALSE; Board filePosition; /* [HGM] loadPos char endingGame = 0; /* [HGM] crash: flag to prevent recursion of GameEnds() */ int whiteNPS, blackNPS; /* [HGM] nps: for easily making clocks aware of NPS */ VariantClass currentlyInitializedVariant; /* [HGM] variantswitch */ +int lastIndex = 0; /* [HGM] autoinc: last game/position used in match mode */ /* States for ics_getting_history */ #define H_FALSE 0 @@ -575,6 +580,8 @@ InitBackEnd1() { int matched, min, sec; + ShowThinkingEvent(); // [HGM] thinking: make sure post/nopost state is set according to options + GetTimeMark(&programStartTime); ClearProgramStats(); @@ -776,15 +783,22 @@ InitBackEnd1() + strlen(PATCHLEVEL)); sprintf(programVersion, "%s %s.%s", PRODUCT, VERSION, PATCHLEVEL); } else { +#if 0 char *p, *q; q = first.program; while (*q != ' ' && *q != NULLCHAR) q++; p = q; - while (p > first.program && *(p-1) != '/') p--; + while (p > first.program && *(p-1) != '/' && *(p-1) != '\\') p--; /* [HGM] bckslash added */ programVersion = (char*) malloc(8 + strlen(PRODUCT) + strlen(VERSION) + strlen(PATCHLEVEL) + (q - p)); sprintf(programVersion, "%s %s.%s + ", PRODUCT, VERSION, PATCHLEVEL); strncat(programVersion, p, q - p); +#else + /* [HGM] tidy: use tidy name, in stead of full pathname (which was probably a bug due to / vs \ ) */ + programVersion = (char*) malloc(8 + strlen(PRODUCT) + strlen(VERSION) + + strlen(PATCHLEVEL) + strlen(first.tidy)); + sprintf(programVersion, "%s %s.%s + %s", PRODUCT, VERSION, PATCHLEVEL, first.tidy); +#endif } if (!appData.icsActive) { @@ -844,9 +858,14 @@ InitBackEnd1() case VariantShatranj: /* should work except for all win conditions */ case VariantBerolina: /* might work if TestLegality is off */ case VariantCapaRandom: /* should work */ + case VariantJanus: /* should work */ + case VariantSuper: /* experimental */ break; } } + + InitEngineUCI( installDir, &first ); // [HGM] moved here from winboard.c, to make available in xboard + InitEngineUCI( installDir, &second ); } int NextIntegerFromString( char ** str, long * value ) @@ -1023,6 +1042,12 @@ InitBackEnd2() } else if (appData.matchMode) { appData.matchGames = 1; } + if(appData.matchMode && appData.sameColorGames > 0) /* [HGM] alternate: overrule matchGames */ + appData.matchGames = appData.sameColorGames; + if(appData.rewindIndex > 1) { /* [HGM] autoinc: rewind implies auto-increment and overrules given index */ + if(appData.loadPositionIndex >= 0) appData.loadPositionIndex = -1; + if(appData.loadGameIndex >= 0) appData.loadGameIndex = -1; + } Reset(TRUE, FALSE); if (appData.noChessProgram || first.protocolVersion == 1) { InitBackEnd3(); @@ -1110,15 +1135,19 @@ InitBackEnd3 P((void)) matchMode = TRUE; matchGame = 1; if (*appData.loadGameFile != NULLCHAR) { + int index = appData.loadGameIndex; // [HGM] autoinc + if(index<0) lastIndex = index = 1; if (!LoadGameFromFile(appData.loadGameFile, - appData.loadGameIndex, + index, appData.loadGameFile, FALSE)) { DisplayFatalError("Bad game file", 0, 1); return; } } else if (*appData.loadPositionFile != NULLCHAR) { + int index = appData.loadPositionIndex; // [HGM] autoinc + if(index<0) lastIndex = index = 1; if (!LoadPositionFromFile(appData.loadPositionFile, - appData.loadPositionIndex, + index, appData.loadPositionFile)) { DisplayFatalError("Bad position file", 0, 1); return; @@ -1169,7 +1198,8 @@ InitBackEnd3 P((void)) } AnalyzeModeEvent(); } else if (initialMode == AnalyzeFile) { - ShowThinkingEvent(TRUE); + appData.showThinking = TRUE; // [HGM] thinking: moved out of ShowThinkingEvent + ShowThinkingEvent(); AnalyzeFileEvent(); AnalysisPeriodicEvent(1); } else if (initialMode == MachinePlaysWhite) { @@ -1640,6 +1670,9 @@ StringToVariant(e) case 48: v = VariantJanus; break; + case 49: + v = VariantSuper; + break; case -1: /* Found "wild" or "w" in the string but no number; must assume it's normal chess. */ @@ -2023,6 +2056,9 @@ read_from_ics(isr, closure, data, count, error) for (i = 0; i < count; i++) { if (data[i] != NULLCHAR && data[i] != '\r') buf[buf_len++] = data[i]; + if(buf_len >= 5 && buf[buf_len-5]=='\n' && buf[buf_len-4]=='\\' && + buf[buf_len-3]==' ' && buf[buf_len-2]==' ' && buf[buf_len-1]==' ') + buf_len -= 5; // [HGM] ICS: join continuation line of Lasker 2.2.3 server with previous } buf[buf_len] = NULLCHAR; @@ -3113,7 +3149,7 @@ read_from_ics(isr, closure, data, count, error) * Additional trailing fields may be added in the future. */ -#define PATTERN "%72c%c%d%d%d%d%d%d%d%s%s%d%d%d%d%d%d%d%d%s%s%s%d%d" +#define PATTERN "%c%d%d%d%d%d%d%d%s%s%d%d%d%d%d%d%d%d%s%s%s%d%d" #define RELATION_OBSERVING_PLAYED 0 #define RELATION_OBSERVING_STATIC -2 /* examined, oldmoves, or smoves */ @@ -3131,7 +3167,7 @@ ParseBoard12(string) int gamenum, newGame, newMove, relation, basetime, increment, ics_flip = 0; int j, k, n, moveNum, white_stren, black_stren, white_time, black_time; int double_push, castle_ws, castle_wl, castle_bs, castle_bl, irrev_count; - char to_play, board_chars[72]; + char to_play, board_chars[200]; char move_str[500], str[500], elapsed_time[500]; char black[32], white[32]; Board board; @@ -3140,6 +3176,8 @@ ParseBoard12(string) ChessMove moveType; int fromX, fromY, toX, toY; char promoChar; + int ranks=1, files=0; /* [HGM] ICS80: allow variable board size */ + char *bookHit = NULL; // [HGM] book fromX = fromY = toX = toY = -1; @@ -3150,14 +3188,25 @@ ParseBoard12(string) move_str[0] = NULLCHAR; elapsed_time[0] = NULLCHAR; - n = sscanf(string, PATTERN, board_chars, &to_play, &double_push, + { /* [HGM] figure out how many ranks and files the board has, for ICS extension used by Capablanca server */ + int i = 0, j; + while(i < 199 && (string[i] != ' ' || string[i+2] != ' ')) { + if(string[i] == ' ') { ranks++; files = 0; } + else files++; + i++; + } + for(j = 0; j 1) { board[k][0] = board[k][BOARD_WIDTH-1] = EmptySquare; board[k][1] = board[k][BOARD_WIDTH-2] = (ChessSquare) 0;; @@ -3380,7 +3432,7 @@ ParseBoard12(string) but in ICS mode that is not its job anyway. */ if(moveNum == 0 || gameInfo.variant != VariantFischeRandom) - { int i, j; + { int i, j; ChessSquare wKing = WhiteKing, bKing = BlackKing; for(i=BOARD_LEFT, j= -1; ialphaRank) { /* [HGM] shogi: temporarily convert to shogi coordinates before sending */ + AlphaRank(moveList[moveNum], 4); + SendToProgram(moveList[moveNum], cps); + AlphaRank(moveList[moveNum], 4); // and back + } else /* Added by Tord: Send castle moves in "O-O" in FRC games if required by * the engine. It would be nice to have a better way to identify castle * moves here. */ if((gameInfo.variant == VariantFischeRandom || gameInfo.variant == VariantCapaRandom) && cps->useOOCastle) { - if (appData.debugMode) { - fprintf(debugFP, "Tord's FRC castling code\n"); - } int fromX = moveList[moveNum][0] - AAA; int fromY = moveList[moveNum][1] - ONE; int toX = moveList[moveNum][2] - AAA; @@ -3850,7 +3918,6 @@ CoordsToComputerAlgebraic(rf, ff, rt, ft, promoChar, move) AAA + ff, ONE + rf, AAA + ft, ONE + rt, promoChar); } } - AlphaRank(move, 4); } void @@ -3873,8 +3940,6 @@ AlphaRank(char *move, int n) { char *p = move, c; int x, y; - if( !appData.alphaRank ) return; - if (appData.debugMode) { fprintf(debugFP, "alphaRank(%s,%d)\n", move, n); } @@ -3882,6 +3947,7 @@ AlphaRank(char *move, int n) if(move[1]=='*' && move[2]>='0' && move[2]<='9' && move[3]>='a' && move[3]<='x' ) { + move[1] = '@'; move[2] = BOARD_RGHT -1 - (move[2]-'1') + AAA; move[3] = BOARD_HEIGHT-1 - (move[3]-'a') + ONE; } else @@ -4126,6 +4192,19 @@ int squaresLeft[4]; int piecesLeft[(int)BlackPawn]; long long int seed, nrOfShuffles; +void GetPositionNumber() +{ // sets global variable seed + int i; + + seed = appData.defaultFrcPosition; + if(seed < 0) { // randomize based on time for negative FRC position numbers + srandom(time(0)); + for(i=0; i<50; i++) seed += random(); + seed = random() ^ random() >> 8 ^ random() << 8; + if(seed<0) seed = -seed; + } +} + int put(Board board, int pieceType, int rank, int n, int shade) // put the piece on the (n-1)-th empty squares of the given shade { @@ -4174,12 +4253,7 @@ void SetUpShuffle(Board board, int number) { int i, p, first=1; - seed = number, nrOfShuffles = 1; - if(number < 0) { - srand(time(0)); - for(i=0; i<50; i++) seed += rand(); - seed = rand() ^ rand()<<16; - } + GetPositionNumber(); nrOfShuffles = 1; squaresLeft[DARK] = (BOARD_RGHT - BOARD_LEFT + 1)/2; squaresLeft[ANY] = BOARD_RGHT - BOARD_LEFT; @@ -4265,11 +4339,11 @@ void SetUpShuffle(Board board, int number) #endif -BOOL SetCharTable( char *table, const char * map ) +int SetCharTable( char *table, const char * map ) /* [HGM] moved here from winboard.c because of its general usefulness */ /* Basically a safe strcpy that uses the last character as King */ { - BOOL result = FALSE; int NrPieces; + int result = FALSE; int NrPieces; if( map != NULL && (NrPieces=strlen(map)) <= (int) EmptySquare && NrPieces >= 12 && !(NrPieces&1)) { @@ -4289,6 +4363,42 @@ BOOL SetCharTable( char *table, const char * map ) return result; } +void Prelude(Board board) +{ // [HGM] superchess: random selection of exo-pieces + int i, j, k; ChessSquare p; + static ChessSquare exoPieces[4] = { WhiteAngel, WhiteMarshall, WhiteSilver, WhiteLance }; + + GetPositionNumber(); // use FRC position number + + if(appData.pieceToCharTable != NULL) { // select pieces to participate from given char table + SetCharTable(pieceToChar, appData.pieceToCharTable); + for(i=(int)WhiteQueen+1, j=0; i<(int)WhiteKing && j<4; i++) + if(PieceToChar((ChessSquare)i) != '.') exoPieces[j++] = (ChessSquare) i; + } + + j = seed%4; seed /= 4; + p = board[0][BOARD_LEFT+j]; board[0][BOARD_LEFT+j] = EmptySquare; k = PieceToNumber(p); + board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; + board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; + j = seed%3 + (seed%3 >= j); seed /= 3; + p = board[0][BOARD_LEFT+j]; board[0][BOARD_LEFT+j] = EmptySquare; k = PieceToNumber(p); + board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; + board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; + j = seed%3; seed /= 3; + p = board[0][BOARD_LEFT+j+5]; board[0][BOARD_LEFT+j+5] = EmptySquare; k = PieceToNumber(p); + board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; + board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; + j = seed%2 + (seed%2 >= j); seed /= 2; + p = board[0][BOARD_LEFT+j+5]; board[0][BOARD_LEFT+j+5] = EmptySquare; k = PieceToNumber(p); + board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; + board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; + j = seed%4; seed /= 4; put(board, exoPieces[3], 0, j, ANY); + j = seed%3; seed /= 3; put(board, exoPieces[2], 0, j, ANY); + j = seed%2; seed /= 2; put(board, exoPieces[1], 0, j, ANY); + put(board, exoPieces[0], 0, 0, ANY); + for(i=BOARD_LEFT; i>1; } + if(gameInfo.variant == VariantSuper) Prelude(initialPosition); #if 0 if(gameInfo.variant == VariantFischeRandom) { if( appData.defaultFrcPosition < 0 ) { @@ -4583,7 +4700,7 @@ SendBoard(cps, moveNum) PieceToChar((ChessSquare)(DEMOTED *bp)), AAA + j, ONE + i); } - if(appData.alphaRank) { + if(cps->alphaRank) { /* [HGM] shogi: translate coords */ message[1] = BOARD_RGHT - 1 - j + '1'; message[2] = BOARD_HEIGHT - 1 - i + 'a'; } @@ -4605,7 +4722,7 @@ SendBoard(cps, moveNum) PieceToChar((ChessSquare)(DEMOTED *bp)), AAA + j, ONE + i); } - if(appData.alphaRank) { + if(cps->alphaRank) { /* [HGM] shogi: translate coords */ message[1] = BOARD_RGHT - 1 - j + '1'; message[2] = BOARD_HEIGHT - 1 - i + 'a'; } @@ -4922,11 +5039,11 @@ UserMoveTest(fromX, fromY, toX, toY, promoChar) click-click move is possible */ if (toX == -2 || toY == -2) { boards[0][fromY][fromX] = EmptySquare; - DrawPosition(FALSE, boards[currentMove]); + return AmbiguousMove; } else if (toX >= 0 && toY >= 0) { boards[0][toY][toX] = boards[0][fromY][fromX]; boards[0][fromY][fromX] = EmptySquare; - DrawPosition(FALSE, boards[currentMove]); + return AmbiguousMove; } return ImpossibleMove; } @@ -4972,15 +5089,27 @@ UserMoveTest(fromX, fromY, toX, toY, promoChar) } /* Common tail of UserMoveEvent and DropMenuEvent */ -void +int FinishMove(moveType, fromX, fromY, toX, toY, promoChar) ChessMove moveType; int fromX, fromY, toX, toY; /*char*/int promoChar; { - /* [HGM] kludge to avoid having know the exact promotion + char *bookHit = 0; + + if(gameInfo.variant == VariantSuper && promoChar != NULLCHAR) { + // [HGM] superchess: suppress promotions to non-available piece + int k = PieceToNumber(CharToPiece(ToUpper(promoChar))); + if(WhiteOnMove(currentMove)) { + if(!boards[currentMove][k][BOARD_WIDTH-2]) return 0; + } else { + if(!boards[currentMove][BOARD_HEIGHT-1-k][1]) return 0; + } + } + + /* [HGM] kludge to avoid having to know the exact promotion move type in caller when we know the move is a legal promotion */ - if(moveType == NormalMove) + if(moveType == NormalMove && promoChar) moveType = PromoCharToMoveType(WhiteOnMove(currentMove), promoChar); /* [HGM] convert drag-and-drop piece drops to standard form */ @@ -5026,7 +5155,7 @@ FinishMove(moveType, fromX, fromY, toX, toY, promoChar) } else { DisplayError("Incorrect move", 0); } - return; + return 1; } /* Ok, now we know that the move is good, so we can kill @@ -5046,6 +5175,18 @@ FinishMove(moveType, fromX, fromY, toX, toY, promoChar) MakeMove(fromX, fromY, toX, toY, promoChar); /*updates forwardMostMove*/ + if(gameInfo.variant == VariantSuper && promoChar != NULLCHAR && gameInfo.holdingsSize) { + // [HGM] superchess: take promotion piece out of holdings + int k = PieceToNumber(CharToPiece(ToUpper(promoChar))); + if(WhiteOnMove(forwardMostMove-1)) { + if(!--boards[forwardMostMove][k][BOARD_WIDTH-2]) + boards[forwardMostMove][k][BOARD_WIDTH-1] = EmptySquare; + } else { + if(!--boards[forwardMostMove][BOARD_HEIGHT-1-k][1]) + boards[forwardMostMove][BOARD_HEIGHT-1-k][0] = EmptySquare; + } + } + if (gameMode == BeginningOfGame) { if (appData.noChessProgram) { gameMode = EditGame; @@ -5053,6 +5194,7 @@ FinishMove(moveType, fromX, fromY, toX, toY, promoChar) } else { char buf[MSG_SIZ]; gameMode = MachinePlaysBlack; + StartClocks(); SetGameInfo(); sprintf(buf, "%s vs. %s", gameInfo.white, gameInfo.black); DisplayTitle(buf); @@ -5078,10 +5220,11 @@ FinishMove(moveType, fromX, fromY, toX, toY, promoChar) gameMode == MachinePlaysBlack)) { SendTimeRemaining(&first, gameMode != MachinePlaysBlack); } - SendMoveToProgram(forwardMostMove-1, &first); if (gameMode != EditGame && gameMode != PlayFromGameFile) { - first.maybeThinking = TRUE; - } + // [HGM] book: if program might be playing, let it use book + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, FALSE); + first.maybeThinking = TRUE; + } else SendMoveToProgram(forwardMostMove-1, &first); if (currentMove == cmailOldMove + 1) { cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; } @@ -5118,6 +5261,19 @@ FinishMove(moveType, fromX, fromY, toX, toY, promoChar) default: break; } + + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookMove); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } + return 1; } void @@ -5164,6 +5320,50 @@ void SendProgramStatsToFrontend( ChessProgramState * cps, ChessProgramStats * cp SetProgramStats( &stats ); } +char *SendMoveToBookUser(int moveNr, ChessProgramState *cps, int initial) +{ // [HGM] book: this routine intercepts moves to simulate book replies + char *bookHit = NULL; + + //first determine if the incoming move brings opponent into his book + if(appData.usePolyglotBook && (cps == &first ? !appData.firstHasOwnBookUCI : !appData.secondHasOwnBookUCI)) + bookHit = ProbeBook(moveNr+1, appData.polyglotBook); // returns move + if(appData.debugMode && bookHit) fprintf(debugFP, "book hit = %s\n", bookHit); + if(bookHit != NULL && !cps->bookSuspend) { + // make sure opponent is not going to reply after receiving move to book position + SendToProgram("force\n", cps); + cps->bookSuspend = TRUE; // flag indicating it has to be restarted + } + if(!initial) SendMoveToProgram(moveNr, cps); // with hit on initial position there is no move + // now arrange restart after book miss + if(bookHit) { + // after a book hit we never send 'go', and the code after the call to this routine + // has '&& !bookHit' added to suppress potential sending there (based on 'firstMove'). + char buf[MSG_SIZ]; + if (cps->useUsermove) sprintf(buf, "usermove "); // sorry, no SAN yet :( + sprintf(buf, "%s\n", bookHit); // force book move into program supposed to play it + SendToProgram(buf, cps); + if(!initial) firstMove = FALSE; // normally we would clear the firstMove condition after return & sending 'go' + } else if(initial) { // 'go' was needed irrespective of firstMove, and it has to be done in this routine + SendToProgram("go\n", cps); + cps->bookSuspend = FALSE; // after a 'go' we are never suspended + } else { // 'go' might be sent based on 'firstMove' after this routine returns + if(cps->bookSuspend && !firstMove) // 'go' needed, and it will not be done after we return + SendToProgram("go\n", cps); + cps->bookSuspend = FALSE; // anyhow, we will not be suspended after a miss + } + return bookHit; // notify caller of hit, so it can take action to send move to opponent +} + +char *savedMessage; +ChessProgramState *savedState; +void DeferredBookMove(void) +{ + if(savedState->lastPing != savedState->lastPong) + ScheduleDelayedEvent(DeferredBookMove, 10); + else + HandleMachineMove(savedMessage, savedState); +} + void HandleMachineMove(message, cps) char *message; @@ -5176,7 +5376,9 @@ HandleMachineMove(message, cps) char promoChar; char *p; int machineWhite; + char *bookHit; +FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book hit /* * Kludge to ignore BEL characters */ @@ -5283,7 +5485,7 @@ HandleMachineMove(message, cps) fprintf(debugFP, "machine move %d, castling = %d %d %d %d %d %d\n", f, castlingRights[f][0],castlingRights[f][1],castlingRights[f][2],castlingRights[f][3],castlingRights[f][4],castlingRights[f][5]); } - AlphaRank(machineMove, 4); + if(cps->alphaRank) AlphaRank(machineMove, 4); if (!ParseOneMove(machineMove, forwardMostMove, &moveType, &fromX, &fromY, &toX, &toY, &promoChar)) { /* Machine move could not be parsed; ignore it. */ @@ -5409,12 +5611,12 @@ HandleMachineMove(message, cps) } } -#ifdef ADJUDICATE // [HGM] some adjudications useful with buggy engines + if( gameMode == TwoMachinesPlay ) { + // [HGM] some adjudications useful with buggy engines + int k, count = 0, epFile = epStatus[forwardMostMove]; static int bare = 1; + if(gameInfo.holdingsSize == 0 || gameInfo.variant == VariantSuper) { - if( gameMode == TwoMachinesPlay && gameInfo.holdingsSize == 0) { - int count = 0, epFile = epStatus[forwardMostMove]; - - if(appData.testLegality && appData.checkMates) + if(appData.testLegality) // don't wait for engine to announce game end if we can judge ourselves switch (MateTest(boards[forwardMostMove], PosFlags(forwardMostMove), epFile, @@ -5424,32 +5626,38 @@ HandleMachineMove(message, cps) default: break; case MT_STALEMATE: - ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ - GameEnds( GameIsDrawn, "Xboard adjudication: Stalemate", - GE_XBOARD ); + epStatus[forwardMostMove] = EP_STALEMATE; + if(appData.checkMates) { + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + GameEnds( GameIsDrawn, "Xboard adjudication: Stalemate", + GE_XBOARD ); + } break; case MT_CHECKMATE: - ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ - GameEnds( WhiteOnMove(forwardMostMove) ? BlackWins : WhiteWins, - "Xboard adjudication: Checkmate", - GE_XBOARD ); + epStatus[forwardMostMove] = EP_CHECKMATE; + if(appData.checkMates) { + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + GameEnds( WhiteOnMove(forwardMostMove) ? BlackWins : WhiteWins, + "Xboard adjudication: Checkmate", + GE_XBOARD ); + } break; } - if( appData.testLegality ) - { /* [HGM] Some more adjudications for obstinate engines */ - int NrWN=0, NrBN=0, NrWB=0, NrBB=0, NrWR=0, NrBR=0, - NrWQ=0, NrBQ=0, bishopsColor = 0, + if( appData.testLegality ) + { /* [HGM] Some more adjudications for obstinate engines */ + int NrWN=0, NrBN=0, NrWB=0, NrBB=0, NrWR=0, NrBR=0, + NrWQ=0, NrBQ=0, NrW=0, bishopsColor = 0, NrPieces=0, NrPawns=0, PawnAdvance=0, i, j, k; - static int moveCount; + static int moveCount = 6; /* First absolutely insufficient mating material. Count what is on board. */ - for(i=0; i 1 ? WhiteWins : NrPiece - NrW > 1 ? BlackWins : GameIsDrawn, + GameEnds( NrW > 1 ? WhiteWins : NrPieces - NrW > 1 ? BlackWins : GameIsDrawn, "Xboard adjudication: Bare king", GE_XBOARD ); return; } @@ -5520,7 +5729,9 @@ HandleMachineMove(message, cps) return; } } else moveCount = 6; -#if 0 + } + } +#if 1 if (appData.debugMode) { int i; fprintf(debugFP, "repeat test fmm=%d bmm=%d ep=%d, reps=%d\n", forwardMostMove, backwardMostMove, epStatus[backwardMostMove], @@ -5626,11 +5837,9 @@ HandleMachineMove(message, cps) } } - } - } -#endif + if( appData.adjudicateDrawMoves > 0 && forwardMostMove > (2*appData.adjudicateDrawMoves) ) { ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ @@ -5639,6 +5848,7 @@ HandleMachineMove(message, cps) return; } + bookHit = NULL; if (gameMode == TwoMachinesPlay) { /* [HGM] relaying draw offers moved to after reception of move */ /* and interpreting offer as claim if it brings draw condition */ @@ -5649,8 +5859,8 @@ HandleMachineMove(message, cps) SendTimeRemaining(cps->other, cps->other->twoMachinesColor[0] == 'w'); } - SendMoveToProgram(forwardMostMove-1, cps->other); - if (firstMove) { + bookHit = SendMoveToBookUser(forwardMostMove-1, cps->other, FALSE); + if (firstMove && !bookHit) { firstMove = FALSE; if (cps->other->useColors) { SendToProgram(cps->other->twoMachinesColor, cps->other); @@ -5673,6 +5883,29 @@ HandleMachineMove(message, cps) if (gameMode != TwoMachinesPlay) SetUserThinkingEnables(); + // [HGM] book: after book hit opponent has received move and is now in force mode + // force the book reply into it, and then fake that it outputted this move by jumping + // back to the beginning of HandleMachineMove, with cps toggled and message set to this move + if(bookHit) { + static char bookMove[MSG_SIZ]; // a bit generous? + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + message = bookMove; + cps = cps->other; + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookMove); + + if(cps->lastPing != cps->lastPong) { + savedMessage = message; // args for deferred call + savedState = cps; + ScheduleDelayedEvent(DeferredBookMove, 10); + return; + } + goto FakeBookMove; + } + return; } @@ -6132,7 +6365,9 @@ HandleMachineMove(message, cps) /* * Look for thinking output */ - if ( appData.showThinking) { + if ( appData.showThinking // [HGM] thinking: test all options that cause this output + || !appData.hideThinkingFromHuman || appData.adjudicateLossThreshold != 0 || EngineOutputIsUp() + ) { int plylev, mvleft, mvtot, curscore, time; char mvname[MOVE_LEN]; unsigned long nodes; @@ -6815,7 +7050,11 @@ ApplyMove(fromX, fromY, toX, toY, promoChar, board) } if (captured != EmptySquare && gameInfo.holdingsSize > 0 && gameInfo.variant != VariantBughouse ) { - /* Add to holdings, if holdings exist */ + /* [HGM] holdings: Add to holdings, if holdings exist */ + if(gameInfo.variant == VariantSuper) { + // [HGM] superchess: suppress flipping color of captured pieces by reverse pre-flip + captured = (int) captured >= (int) BlackPawn ? BLACK_TO_WHITE captured : WHITE_TO_BLACK captured; + } p = (int) captured; if (p >= (int) BlackPawn) { p -= (int)BlackPawn; @@ -6827,8 +7066,7 @@ ApplyMove(fromX, fromY, toX, toY, promoChar, board) p = PieceToNumber((ChessSquare)p); if(p >= gameInfo.holdingsSize) { p = 0; captured = BlackPawn; } board[p][BOARD_WIDTH-2]++; - board[p][BOARD_WIDTH-1] = - BLACK_TO_WHITE captured; + board[p][BOARD_WIDTH-1] = BLACK_TO_WHITE captured; } else { p -= (int)WhitePawn; if(gameInfo.variant == VariantShogi && DEMOTED p >= 0) { @@ -6838,8 +7076,7 @@ ApplyMove(fromX, fromY, toX, toY, promoChar, board) p = PieceToNumber((ChessSquare)p); if(p >= gameInfo.holdingsSize) { p = 0; captured = WhitePawn; } board[BOARD_HEIGHT-1-p][1]++; - board[BOARD_HEIGHT-1-p][0] = - WHITE_TO_BLACK captured; + board[BOARD_HEIGHT-1-p][0] = WHITE_TO_BLACK captured; } } @@ -6987,6 +7224,38 @@ ShowMove(fromX, fromY, toX, toY) HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1); } +void SendEgtPath(ChessProgramState *cps) +{ /* [HGM] EGT: match formats given in feature with those given by user, and send info for each match */ + char buf[MSG_SIZ], name[MSG_SIZ], *p; + + if((p = cps->egtFormats) == NULL || appData.egtFormats == NULL) return; + + while(*p) { + char c, *q = name+1, *r, *s; + + name[0] = ','; // extract next format name from feature and copy with prefixed ',' + while(*p && *p != ',') *q++ = *p++; + *q++ = ':'; *q = 0; + if( appData.defaultPathEGTB && appData.defaultPathEGTB[0] && + strcmp(name, ",nalimov:") == 0 ) { + // take nalimov path from the menu-changeable option first, if it is defined + sprintf(buf, "egtpath nalimov %s\n", appData.defaultPathEGTB); + SendToProgram(buf,cps); // send egtbpath command for nalimov + } else + if( (s = StrStr(appData.egtFormats, name+1)) == appData.egtFormats || + (s = StrStr(appData.egtFormats, name)) != NULL) { + // format name occurs amongst user-supplied formats, at beginning or immediately after comma + s = r = StrStr(s, ":") + 1; // beginning of path info + while(*r && *r != ',') r++; // path info is everything upto next ';' or end of string + c = *r; *r = 0; // temporarily null-terminate path info + *--q = 0; // strip of trailig ':' from name + sprintf(buf, "egtbpath %s %s\n", name+1, s); + *r = c; + SendToProgram(buf,cps); // send egtbpath command for this format + } + if(*p == ',') p++; // read away comma to position for next format name + } +} void InitChessProgram(cps, setup) @@ -6997,6 +7266,19 @@ InitChessProgram(cps, setup) if (appData.noChessProgram) return; hintRequested = FALSE; bookRequested = FALSE; + + /* [HGM] some new WB protocol commands to configure engine are sent now, if engine supports them */ + /* moved to before sending initstring in 4.3.15, so Polyglot can delay UCI 'isready' to recepton of 'new' */ + if(cps->memSize) { /* [HGM] memory */ + sprintf(buf, "memory %d\n", appData.defaultHashSize + appData.defaultCacheSizeEGTB); + SendToProgram(buf, cps); + } + SendEgtPath(cps); /* [HGM] EGT */ + if(cps->maxCores) { /* [HGM] SMP: (protocol specified must be last settings command before new!) */ + sprintf(buf, "cores %d\n", appData.smpCores); + SendToProgram(buf, cps); + } + SendToProgram(cps->initString, cps); if (gameInfo.variant != VariantNormal && gameInfo.variant != VariantLoadable @@ -7024,6 +7306,8 @@ InitChessProgram(cps, setup) overruled = gameInfo.boardWidth != 10 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 0; if( gameInfo.variant == VariantCourier ) overruled = gameInfo.boardWidth != 12 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 0; + if( gameInfo.variant == VariantSuper ) + overruled = gameInfo.boardWidth != 8 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 8; if(overruled) { sprintf(b, "%dx%d+%d_%s", gameInfo.boardWidth, gameInfo.boardHeight, @@ -7066,7 +7350,10 @@ InitChessProgram(cps, setup) timeIncrement, appData.searchDepth, searchTime); } - if (appData.showThinking) { + if (appData.showThinking + // [HGM] thinking: four options require thinking output to be sent + || !appData.hideThinkingFromHuman || appData.adjudicateLossThreshold != 0 || EngineOutputIsUp() + ) { SendToProgram("post\n", cps); } SendToProgram("hard\n", cps); @@ -7148,14 +7435,25 @@ TwoMachinesEventIfReady P((void)) void NextMatchGame P((void)) { + int index; /* [HGM] autoinc: step lod index during match */ Reset(FALSE, TRUE); if (*appData.loadGameFile != NULLCHAR) { + index = appData.loadGameIndex; + if(index < 0) { // [HGM] autoinc + lastIndex = index = (index == -2 && first.twoMachinesColor[0] == 'b') ? lastIndex : lastIndex+1; + if(appData.rewindIndex > 0 && index > appData.rewindIndex) lastIndex = index = 1; + } LoadGameFromFile(appData.loadGameFile, - appData.loadGameIndex, + index, appData.loadGameFile, FALSE); } else if (*appData.loadPositionFile != NULLCHAR) { + index = appData.loadPositionIndex; + if(index < 0) { // [HGM] autoinc + lastIndex = index = (index == -2 && first.twoMachinesColor[0] == 'b') ? lastIndex : lastIndex+1; + if(appData.rewindIndex > 0 && index > appData.rewindIndex) lastIndex = index = 1; + } LoadPositionFromFile(appData.loadPositionFile, - appData.loadPositionIndex, + index, appData.loadPositionFile); } TwoMachinesEventIfReady(); @@ -7236,57 +7534,71 @@ GameEnds(result, resultDetails, whosays) if (!isIcsGame || whosays == GE_ICS) { /* OK -- not an ICS game, or ICS said it was done */ StopClocks(); - if (appData.debugMode) { - fprintf(debugFP, "GameEnds(%d, %s, %d) clock stopped\n", - result, resultDetails ? resultDetails : "(null)", whosays); - } if (!isIcsGame && !appData.noChessProgram) SetUserThinkingEnables(); /* [HGM] if a machine claims the game end we verify this claim */ - if( appData.testLegality && gameMode == TwoMachinesPlay && - appData.testClaims && whosays >= GE_ENGINE1 ) { + if(gameMode == TwoMachinesPlay && appData.testClaims) { + if(appData.testLegality && whosays >= GE_ENGINE1 ) { char claimer; - if (appData.debugMode) { - fprintf(debugFP, "GameEnds(%d, %s, %d) test claims\n", - result, resultDetails ? resultDetails : "(null)", whosays); - } claimer = whosays == GE_ENGINE1 ? /* color of claimer */ first.twoMachinesColor[0] : second.twoMachinesColor[0] ; - if( gameInfo.holdingsWidth == 0 && + if( (gameInfo.holdingsWidth == 0 || gameInfo.variant == VariantSuper) && (result == WhiteWins && claimer == 'w' || result == BlackWins && claimer == 'b' ) ) { - /* Xboard immediately adjudicates all mates, so win claims must be false */ - sprintf(buf, "False win claim: '%s'", resultDetails); - result = claimer == 'w' ? BlackWins : WhiteWins; - resultDetails = buf; + if (appData.debugMode) { + fprintf(debugFP, "result=%d sp=%d move=%d\n", + result, epStatus[forwardMostMove], forwardMostMove); + } + /* [HGM] verify: engine mate claims accepted if they were flagged */ + if(epStatus[forwardMostMove] != EP_CHECKMATE && + result != (WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins)) { + sprintf(buf, "False win claim: '%s'", resultDetails); + result = claimer == 'w' ? BlackWins : WhiteWins; + resultDetails = buf; + } } else if( result == GameIsDrawn && epStatus[forwardMostMove] > EP_DRAWS && (forwardMostMove <= backwardMostMove || epStatus[forwardMostMove-1] > EP_DRAWS || (claimer=='b')==(forwardMostMove&1)) ) { - /* Draw that was not flagged by Xboard is false */ + /* [HGM] verify: draws that were not flagged are false claims */ sprintf(buf, "False draw claim: '%s'", resultDetails); result = claimer == 'w' ? BlackWins : WhiteWins; resultDetails = buf; } /* (Claiming a loss is accepted no questions asked!) */ + } + /* [HGM] bare: don't allow bare King to win */ + if((gameInfo.holdingsWidth == 0 || gameInfo.variant == VariantSuper) && result != GameIsDrawn) + { int i, j, k=0, color = (result==WhiteWins ? (int)WhitePawn : (int)BlackPawn); + for(j=BOARD_LEFT; j= 0 && p <= (int)WhiteKing) k++; + } + if (appData.debugMode) { + fprintf(debugFP, "GE(%d, %s, %d) bare king k=%d color=%d\n", + result, resultDetails ? resultDetails : "(null)", whosays, k, color); + } + if(k <= 1) { + result = GameIsDrawn; + sprintf(buf, "%s but bare king", resultDetails); + resultDetails = buf; + } + } } + if(serverMoves != NULL && !loadFlag) { char c = '='; if(result==WhiteWins) c = '+'; if(result==BlackWins) c = '-'; if(resultDetails != NULL) fprintf(serverMoves, ";%c;%s\n", c, resultDetails); } - if (appData.debugMode) { - fprintf(debugFP, "GameEnds(%d, %s, %d) after test\n", - result, resultDetails ? resultDetails : "(null)", whosays); - } - if (resultDetails != NULL) { + if (resultDetails != NULL) { gameInfo.result = result; gameInfo.resultDetails = StrSave(resultDetails); @@ -7470,9 +7782,11 @@ GameEnds(result, resultDetails, whosays) } if (matchGame < appData.matchGames) { char *tmp; - tmp = first.twoMachinesColor; - first.twoMachinesColor = second.twoMachinesColor; - second.twoMachinesColor = tmp; + if(appData.sameColorGames <= 1) { /* [HGM] alternate: suppress color swap */ + tmp = first.twoMachinesColor; + first.twoMachinesColor = second.twoMachinesColor; + second.twoMachinesColor = tmp; + } gameMode = nextGameMode; matchGame++; if(appData.matchPause>10000 || appData.matchPause<10) @@ -7580,6 +7894,8 @@ Reset(redraw, init) hintRequested = bookRequested = FALSE; first.maybeThinking = FALSE; second.maybeThinking = FALSE; + first.bookSuspend = FALSE; // [HGM] book + second.bookSuspend = FALSE; thinkOutput[0] = NULLCHAR; lastHint[0] = NULLCHAR; ClearGameInfo(&gameInfo); @@ -7750,6 +8066,8 @@ LoadGameOneMove(readAhead) case BlackPromotionChancellor: case WhitePromotionArchbishop: case BlackPromotionArchbishop: + case WhitePromotionCentaur: + case BlackPromotionCentaur: case WhitePromotionQueen: case BlackPromotionQueen: case WhitePromotionRook: @@ -7922,7 +8240,7 @@ LoadGameOneMove(readAhead) default: case ImpossibleMove: if (appData.debugMode) - fprintf(debugFP, "Parsed ImpossibleMove: %s\n", yy_text); + fprintf(debugFP, "Parsed ImpossibleMove (type = %d): %s\n", moveType, yy_text); sprintf(move, "Illegal move: %d.%s%s", (forwardMostMove / 2) + 1, WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); @@ -8373,13 +8691,6 @@ LoadGame(f, gameNumber, title, useList) return FALSE; } CopyBoard(boards[0], initial_position); - /* [HGM] copy FEN attributes as well */ - { int i; - initialRulePlies = FENrulePlies; - epStatus[0] = FENepStatus; - for( i=0; i< nrCastlingRights; i++ ) - initialRights[i] = castlingRights[0][i] = FENcastlingRights[i]; - } if (blackPlaysFirst) { currentMove = forwardMostMove = backwardMostMove = 1; CopyBoard(boards[1], initial_position); @@ -8394,6 +8705,13 @@ LoadGame(f, gameNumber, title, useList) } else { currentMove = forwardMostMove = backwardMostMove = 0; } + /* [HGM] copy FEN attributes as well. Bugfix 4.3.14m and 4.3.15e: moved to after 'blackPlaysFirst' */ + { int i; + initialRulePlies = FENrulePlies; + epStatus[forwardMostMove] = FENepStatus; + for( i=0; i< nrCastlingRights; i++ ) + initialRights[i] = castlingRights[forwardMostMove][i] = FENcastlingRights[i]; + } yyboardindex = forwardMostMove; free(gameInfo.fen); gameInfo.fen = NULL; @@ -8710,7 +9028,7 @@ LoadPosition(f, positionNumber, title) if (pn >= 2) { if (fenMode || line[0] == '#') pn--; while (pn > 0) { - /* skip postions before number pn */ + /* skip positions before number pn */ if (fgets(line, MSG_SIZ, f) == NULL) { Reset(TRUE, TRUE); DisplayError("Position not found in file", 0); @@ -8749,13 +9067,6 @@ LoadPosition(f, positionNumber, title) SendToProgram("force\n", &first); CopyBoard(boards[0], initial_position); - /* [HGM] copy FEN attributes as well */ - { int i; - initialRulePlies = FENrulePlies; - epStatus[0] = FENepStatus; - for( i=0; i< nrCastlingRights; i++ ) - castlingRights[0][i] = FENcastlingRights[i]; - } if (blackPlaysFirst) { currentMove = forwardMostMove = backwardMostMove = 1; strcpy(moveList[0], ""); @@ -8766,8 +9077,18 @@ LoadPosition(f, positionNumber, title) currentMove = forwardMostMove = backwardMostMove = 0; DisplayMessage("", "White to play"); } + /* [HGM] copy FEN attributes as well */ + { int i; + initialRulePlies = FENrulePlies; + epStatus[forwardMostMove] = FENepStatus; + for( i=0; i< nrCastlingRights; i++ ) + castlingRights[forwardMostMove][i] = FENcastlingRights[i]; + } SendBoard(&first, forwardMostMove); if (appData.debugMode) { +int i, j; + for(i=0;i<2;i++){for(j=0;j<6;j++)fprintf(debugFP, " %d", castlingRights[i][j]);fprintf(debugFP,"\n");} + for(j=0;j<6;j++)fprintf(debugFP, " %d", initialRights[j]);fprintf(debugFP,"\n"); fprintf(debugFP, "Load Position\n"); } @@ -9019,7 +9340,21 @@ SaveGamePGN(f) linelen += numlen; /* Get move */ - movetext = SavePart(parseList[i]); + movelen = strlen(parseList[i]); /* [HGM] pgn: line-break point before move */ + + /* Print move */ + blank = linelen > 0 && movelen > 0; + if (linelen + (blank ? 1 : 0) + movelen > PGN_MAX_LINE) { + fprintf(f, "\n"); + linelen = 0; + blank = 0; + } + if (blank) { + fprintf(f, " "); + linelen++; + } + fprintf(f, parseList[i]); + linelen += movelen; /* [AS] Add PV info if present */ if( i >= 0 && appData.saveExtendedInfoInPGN && pvInfoList[i].depth > 0 ) { @@ -9028,49 +9363,53 @@ SaveGamePGN(f) #if 0 if(i >= backwardMostMove) { - /* take the time that changed */ - seconds = timeRemaining[0][i] - timeRemaining[0][i+1]; - if(seconds <= 0) - seconds = timeRemaining[1][i] - timeRemaining[1][i+1]; + if(WhiteOnMove(i)) + seconds = timeRemaining[0][i] - timeRemaining[0][i+1] + + GetTimeQuota(i/2) / WhitePlayer()->timeOdds; + else + seconds = timeRemaining[1][i] - timeRemaining[1][i+1] + + GetTimeQuota(i/2) / WhitePlayer()->other->timeOdds; } - seconds /= 1000; + seconds = (seconds+50)/100; // deci-seconds, rounded to nearest +#else + seconds = (pvInfoList[i].time + 5)/10; // [HGM] PVtime: use engine time #endif - seconds = pvInfoList[i].time/100; // [HGM] PVtime: use engine time - if (appData.debugMode) { + if (appData.debugMode,0) { fprintf(debugFP, "times = %d %d %d %d, seconds=%d\n", timeRemaining[0][i+1], timeRemaining[0][i], timeRemaining[1][i+1], timeRemaining[1][i], seconds ); } - if( seconds < 0 ) buf[0] = 0; else - if( seconds < 60 ) sprintf(buf, " %d%c", seconds, 0); - else sprintf(buf, " %d:%02d%c", seconds/60, seconds%60, 0); + if( seconds <= 0) buf[0] = 0; else + if( seconds < 30 ) sprintf(buf, " %3.1f%c", seconds/10., 0); else { + seconds = (seconds + 4)/10; // round to full seconds + if( seconds < 60 ) sprintf(buf, " %d%c", seconds, 0); else + sprintf(buf, " %d:%02d%c", seconds/60, seconds%60, 0); + } - sprintf( move_buffer, "%s {%s%.2f/%d%s}", - movetext, + sprintf( move_buffer, "{%s%.2f/%d%s}", pvInfoList[i].score >= 0 ? "+" : "", pvInfoList[i].score / 100.0, pvInfoList[i].depth, - buf ); - movetext = move_buffer; - } + buf ); - movelen = strlen(movetext); + movelen = strlen(move_buffer); /* [HGM] pgn: line-break point after move */ - /* Print move */ - blank = linelen > 0 && movelen > 0; - if (linelen + (blank ? 1 : 0) + movelen > PGN_MAX_LINE) { - fprintf(f, "\n"); - linelen = 0; - blank = 0; - } - if (blank) { - fprintf(f, " "); - linelen++; - } - fprintf(f, movetext); - linelen += movelen; + /* Print score/depth */ + blank = linelen > 0 && movelen > 0; + if (linelen + (blank ? 1 : 0) + movelen > PGN_MAX_LINE) { + fprintf(f, "\n"); + linelen = 0; + blank = 0; + } + if (blank) { + fprintf(f, " "); + linelen++; + } + fprintf(f, move_buffer); + linelen += movelen; + } i++; } @@ -9601,7 +9940,7 @@ ExitEvent(status) GameEnds((ChessMove) 0, NULL, GE_PLAYER); #else /* [HGM] crash: leave writing PGN and position entirely to GameEnds() */ - GameEnds(gameInfo.result, gameInfo.resultDetails==NULL ? "aborted" : gameInfo.resultDetails, GE_PLAYER); + GameEnds(gameInfo.result, gameInfo.resultDetails==NULL ? "xboard exit" : gameInfo.resultDetails, GE_PLAYER); #endif /* [HGM] crash: the above GameEnds() is a dud if another one was running */ /* make sure this other one finishes before killing it! */ @@ -9785,6 +10124,7 @@ void MachineWhiteEvent() { char buf[MSG_SIZ]; + char *bookHit = NULL; if (appData.noChessProgram || (gameMode == MachinePlaysWhite)) return; @@ -9813,6 +10153,10 @@ MachineWhiteEvent() TruncateGame(); ResurrectChessProgram(); /* in case it isn't running */ + if(gameMode == BeginningOfGame) { /* [HGM] time odds: to get right odds in human mode */ + gameMode = MachinePlaysWhite; + ResetClocks(); + } else gameMode = MachinePlaysWhite; pausing = FALSE; ModeHighlight(); @@ -9830,10 +10174,9 @@ MachineWhiteEvent() SendTimeRemaining(&first, TRUE); } if (first.useColors) { - SendToProgram("white\ngo\n", &first); - } else { - SendToProgram("go\n", &first); + SendToProgram("white\n", &first); // [HGM] book: send 'go' separately } + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: send go or retrieve book move SetMachineThinkingEnables(); first.maybeThinking = TRUE; StartClocks(); @@ -9842,12 +10185,25 @@ MachineWhiteEvent() flipView = !flipView; DrawPosition(FALSE, NULL); } + + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookMove); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } } void MachineBlackEvent() { char buf[MSG_SIZ]; + char *bookHit = NULL; if (appData.noChessProgram || (gameMode == MachinePlaysBlack)) return; @@ -9893,10 +10249,9 @@ MachineBlackEvent() SendTimeRemaining(&first, FALSE); } if (first.useColors) { - SendToProgram("black\ngo\n", &first); - } else { - SendToProgram("go\n", &first); + SendToProgram("black\n", &first); // [HGM] book: 'go' sent separately } + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: send go or retrieve book move SetMachineThinkingEnables(); first.maybeThinking = TRUE; StartClocks(); @@ -9905,6 +10260,17 @@ MachineBlackEvent() flipView = !flipView; DrawPosition(FALSE, NULL); } + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookMove); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } } @@ -9936,6 +10302,7 @@ TwoMachinesEvent P((void)) int i; char buf[MSG_SIZ]; ChessProgramState *onmove; + char *bookHit = NULL; if (appData.noChessProgram) return; @@ -10018,8 +10385,8 @@ TwoMachinesEvent P((void)) SendToProgram(buf, &second); } + ResetClocks(); if (!first.sendTime || !second.sendTime) { - ResetClocks(); timeRemaining[0][forwardMostMove] = whiteTimeRemaining; timeRemaining[1][forwardMostMove] = blackTimeRemaining; } @@ -10032,11 +10399,24 @@ TwoMachinesEvent P((void)) if (onmove->useColors) { SendToProgram(onmove->twoMachinesColor, onmove); } - SendToProgram("go\n", onmove); + bookHit = SendMoveToBookUser(forwardMostMove-1, onmove, TRUE); // [HGM] book: send go or retrieve book move +// SendToProgram("go\n", onmove); onmove->maybeThinking = TRUE; SetMachineThinkingEnables(); StartClocks(); + + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookMove); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } } void @@ -10232,6 +10612,11 @@ EditPositionDone() strcpy(parseList[0], ""); currentMove = forwardMostMove = backwardMostMove = 1; CopyBoard(boards[1], boards[0]); + /* [HGM] copy rights as well, as this code is also used after pasting a FEN */ + { int i; + epStatus[1] = epStatus[0]; + for(i=0; i 0 ) { int score = 0; int depth = 0; - int time = -1, sec = 0; + int time = -1, sec = 0, deci; char * s_eval = FindStr( text, "[%eval " ); char * s_emt = FindStr( text, "[%emt " ); @@ -11362,8 +11748,9 @@ char *GetInfoFromComment( int index, char * text ) return text; } - time = -1; sec = -1; + time = -1; sec = -1; deci = -1; if( sscanf( text, "%d.%d/%d %d:%d", &score, &score_lo, &depth, &time, &sec ) != 5 && + sscanf( text, "%d.%d/%d %d.%d", &score, &score_lo, &depth, &time, &deci ) != 5 && sscanf( text, "%d.%d/%d %d", &score, &score_lo, &depth, &time ) != 4 && sscanf( text, "%d.%d/%d", &score, &score_lo, &depth ) != 3 ) { return text; @@ -11373,7 +11760,9 @@ char *GetInfoFromComment( int index, char * text ) return text; } - if(sec >= 0) time = 60*time + sec; + if(sec >= 0) time = 600*time + 10*sec; else + if(deci >= 0) time = 10*time + deci; else time *= 10; // deci-sec + score = score >= 0 ? score*100 + score_lo : score*100 - score_lo; /* [HGM] PV time: now locate end of PV info */ @@ -11382,6 +11771,8 @@ char *GetInfoFromComment( int index, char * text ) while( *++sep >= '0' && *sep <= '9'); // strip time if(sec >= 0) while( *++sep >= '0' && *sep <= '9'); // strip seconds + if(deci >= 0) + while( *++sep >= '0' && *sep <= '9'); // strip fractional seconds while(*sep == ' ') sep++; } @@ -11395,7 +11786,7 @@ char *GetInfoFromComment( int index, char * text ) pvInfoList[index-1].depth = depth; pvInfoList[index-1].score = score; - pvInfoList[index-1].time = time; + pvInfoList[index-1].time = 10*time; // centi-sec } return sep; } @@ -11500,8 +11891,7 @@ ReceiveFromProgram(isr, closure, message, count, error) sscanf(message, "resign%c", &c)!=1 && sscanf(message, "feature %c", &c)!=1 && sscanf(message, "error %c", &c)!=1 && sscanf(message, "illegal %c", &c)!=1 && sscanf(message, "tell%c", &c)!=1 && sscanf(message, "0-1 %c", &c)!=1 && - sscanf(message, "askuser%c", &c)!=1 && sscanf(message, "1-0 %c", &c)!=1 && - sscanf(message, "1/2-1/2 %c", &c)!=1 && start != '#') + sscanf(message, "1-0 %c", &c)!=1 && sscanf(message, "1/2-1/2 %c", &c)!=1 && start != '#') { quote = "# "; print = (appData.engineComments == 2); } message[0] = start; // restore original message } @@ -11587,7 +11977,8 @@ SendTimeControl(cps, mps, tc, inc, sd, st) ChessProgramState *WhitePlayer() /* [HGM] return pointer to 'first' or 'second', depending on who plays white */ { - if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'b') + if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'b' || + gameMode == BeginningOfGame || gameMode == MachinePlaysBlack) return &second; return &first; } @@ -11748,9 +12139,6 @@ ParseFeatures(args, cps) if (BoolFeature(&p, "ics", &cps->sendICS, cps)) continue; if (BoolFeature(&p, "name", &cps->sendName, cps)) continue; if (BoolFeature(&p, "pause", &val, cps)) continue; /* unused at present */ - if (BoolFeature(&p, "debug", &cps->debug, cps)) continue; - if (BoolFeature(&p, "nps", &cps->supportsNPS, cps)) continue; - if (IntFeature(&p, "level", &cps->maxNrOfSessions, cps)) continue; if (IntFeature(&p, "done", &val, cps)) { FeatureDone(cps, val); continue; @@ -11760,6 +12148,15 @@ ParseFeatures(args, cps) if (BoolFeature(&p, "oocastle", &cps->useOOCastle, cps)) continue; /* End of additions by Tord */ + /* [HGM] added features: */ + if (BoolFeature(&p, "debug", &cps->debug, cps)) continue; + if (BoolFeature(&p, "nps", &cps->supportsNPS, cps)) continue; + if (IntFeature(&p, "level", &cps->maxNrOfSessions, cps)) continue; + if (BoolFeature(&p, "memory", &cps->memSize, cps)) continue; + if (BoolFeature(&p, "smp", &cps->maxCores, cps)) continue; + if (StringFeature(&p, "egt", &cps->egtFormats, cps)) continue; + /* End of additions by HGM */ + /* unknown feature: complain and skip */ q = p; while (*q && *q != '=') q++; @@ -11821,12 +12218,33 @@ PonderNextMoveEvent(newState) } void -ShowThinkingEvent(newState) - int newState; +NewSettingEvent(option, command, value) + char *command; + int option, value; { - if (newState == appData.showThinking) return; + char buf[MSG_SIZ]; + if (gameMode == EditPosition) EditPositionDone(); - if (newState) { + sprintf(buf, "%s%s %d\n", (option ? "option ": ""), command, value); + SendToProgram(buf, &first); + if (gameMode == TwoMachinesPlay) { + SendToProgram(buf, &second); + } +} + +void +ShowThinkingEvent() +// [HGM] thinking: this routine is now also called from "Options -> Engine..." popup +{ + static int oldState = 2; // kludge alert! Neither true nor fals, so first time oldState is always updated + int newState = appData.showThinking + // [HGM] thinking: other features now need thinking output as well + || !appData.hideThinkingFromHuman || appData.adjudicateLossThreshold != 0 || EngineOutputIsUp(); + + if (oldState == newState) return; + oldState = newState; + if (gameMode == EditPosition) EditPositionDone(); + if (oldState) { SendToProgram("post\n", &first); if (gameMode == TwoMachinesPlay) { SendToProgram("post\n", &second); @@ -11838,7 +12256,7 @@ ShowThinkingEvent(newState) SendToProgram("nopost\n", &second); } } - appData.showThinking = newState; +// appData.showThinking = newState; // [HGM] thinking: responsible option should already have be changed when calling this routine! } void @@ -12015,7 +12433,7 @@ DisplayComment(moveNumber, text) if(text == NULL) text = ""; score = pvInfoList[moveNumber].score; sprintf(buf, "%s%.2f/%d %d\n%s", score>0 ? "+" : "", score/100., - depth, pvInfoList[moveNumber].time, text); + depth, (pvInfoList[moveNumber].time+50)/100, text); CommentPopUp(title, buf); } else if (text != NULL) @@ -12113,7 +12531,7 @@ CheckTimeControl() gameMode == PlayFromGameFile || forwardMostMove == 0) return; /* - * add time to clocks when time control is achieved ([HGM] now also used fot increment) + * add time to clocks when time control is achieved ([HGM] now also used for increment) */ if ( !WhiteOnMove(forwardMostMove) ) /* White made time control */ @@ -12326,14 +12744,14 @@ SwitchClocks() if(blackNPS >= 0) lastTickLength = 0; blackTimeRemaining -= lastTickLength; /* [HGM] PGNtime: save time for PGN file if engine did not give it */ - if(pvInfoList[forwardMostMove-1].time == -1) - pvInfoList[forwardMostMove-1].time = +// if(pvInfoList[forwardMostMove-1].time == -1) + pvInfoList[forwardMostMove-1].time = // use GUI time (timeRemaining[1][forwardMostMove-1] - blackTimeRemaining)/10; } else { if(whiteNPS >= 0) lastTickLength = 0; whiteTimeRemaining -= lastTickLength; /* [HGM] PGNtime: save time for PGN file if engine did not give it */ - if(pvInfoList[forwardMostMove-1].time == -1) +// if(pvInfoList[forwardMostMove-1].time == -1) pvInfoList[forwardMostMove-1].time = (timeRemaining[0][forwardMostMove-1] - whiteTimeRemaining)/10; } @@ -12817,12 +13235,14 @@ ParseFEN(board, blackPlaysFirst, fen) *p++; if((int) piece >= (int) BlackPawn ) { i = (int)piece - (int)BlackPawn; - if( i >= BOARD_HEIGHT ) return FALSE; + i = PieceToNumber((ChessSquare)i); + if( i >= gameInfo.holdingsSize ) return FALSE; board[BOARD_HEIGHT-1-i][0] = piece; /* black holdings */ board[BOARD_HEIGHT-1-i][1]++; /* black counts */ } else { i = (int)piece - (int)WhitePawn; - if( i >= BOARD_HEIGHT ) return FALSE; + i = PieceToNumber((ChessSquare)i); + if( i >= gameInfo.holdingsSize ) return FALSE; board[i][BOARD_WIDTH-1] = piece; /* white holdings */ board[i][BOARD_WIDTH-2]++; /* black holdings */ } diff --git a/backend.h b/backend.h index 217aa94..995890d 100644 --- a/backend.h +++ b/backend.h @@ -119,7 +119,8 @@ void UserAdjudicationEvent P((int result)); void StopObservingEvent P((void)); void StopExaminingEvent P((void)); void PonderNextMoveEvent P((int newState)); -void ShowThinkingEvent P((int newState)); +void NewSettingeEvent P((int option, char *command, int value)); +void ShowThinkingEvent P(()); void PeriodicUpdatesEvent P((int newState)); void HintEvent P((void)); void BookEvent P((void)); @@ -259,6 +260,11 @@ typedef struct _CPS { int accumulateTC; /* [HGM] secondary TC: how to handle extra sessions */ int nps; /* [HGM] nps: factor for node count to replace time */ int supportsNPS; + int alphaRank; /* [HGM] shogi: engine uses shogi-type coordinates */ + int maxCores; /* [HGM] SMP: engine understands cores command */ + int memSize; /* [HGM] memsize: engine understands memory command */ + char egtFormats[MSG_SIZ]; /* [HGM] EGT: supported tablebase formats */ + int bookSuspend; /* HGM book: go was deferred bcause of book hit */ } ChessProgramState; extern ChessProgramState first, second; diff --git a/bitmaps/dopkbm.sh b/bitmaps/dopkbm.sh old mode 100755 new mode 100644 diff --git a/bitmaps/dopkbm1.sh b/bitmaps/dopkbm1.sh old mode 100755 new mode 100644 diff --git a/bitmaps/unsigned.sh b/bitmaps/unsigned.sh old mode 100755 new mode 100644 diff --git a/book.c b/book.c new file mode 100644 index 0000000..7e59a7f --- /dev/null +++ b/book.c @@ -0,0 +1,472 @@ +/* + * book.c -- code for probing P0lyglot opening books + * + * This code was first released in the public domain by Michel Van den Bergh. + * The array Random64 is taken from the Polyglot source code. + * I am pretty sure that a table of random numbers is never protected + * by copyright. + * + * It s adapted by H.G. Muller for working with xboard / Winboard + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + +#include +#include + +#include "common.h" +#include "backend.h" + +#ifdef _MSC_VER + typedef unsigned __int64 uint64; +#else + typedef unsigned long long int uint64; +#endif + + +#ifdef _MSC_VER +# define U64(u) (u##ui64) +#else +# define U64(u) (u##ULL) +#endif + +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; + +typedef struct { + uint64 key; + uint16 move; + uint16 weight; + uint32 learn; +} entry_t; + +entry_t entry_none = { + 0, 0, 0, 0 +}; + +char *promote_pieces=" nbrq"; +extern char castlingRights[][BOARD_SIZE]; +extern char epStatus[]; + +uint64 Random64[781] = { + U64(0x9D39247E33776D41), U64(0x2AF7398005AAA5C7), U64(0x44DB015024623547), U64(0x9C15F73E62A76AE2), + U64(0x75834465489C0C89), U64(0x3290AC3A203001BF), U64(0x0FBBAD1F61042279), U64(0xE83A908FF2FB60CA), + U64(0x0D7E765D58755C10), U64(0x1A083822CEAFE02D), U64(0x9605D5F0E25EC3B0), U64(0xD021FF5CD13A2ED5), + U64(0x40BDF15D4A672E32), U64(0x011355146FD56395), U64(0x5DB4832046F3D9E5), U64(0x239F8B2D7FF719CC), + U64(0x05D1A1AE85B49AA1), U64(0x679F848F6E8FC971), U64(0x7449BBFF801FED0B), U64(0x7D11CDB1C3B7ADF0), + U64(0x82C7709E781EB7CC), U64(0xF3218F1C9510786C), U64(0x331478F3AF51BBE6), U64(0x4BB38DE5E7219443), + U64(0xAA649C6EBCFD50FC), U64(0x8DBD98A352AFD40B), U64(0x87D2074B81D79217), U64(0x19F3C751D3E92AE1), + U64(0xB4AB30F062B19ABF), U64(0x7B0500AC42047AC4), U64(0xC9452CA81A09D85D), U64(0x24AA6C514DA27500), + U64(0x4C9F34427501B447), U64(0x14A68FD73C910841), U64(0xA71B9B83461CBD93), U64(0x03488B95B0F1850F), + U64(0x637B2B34FF93C040), U64(0x09D1BC9A3DD90A94), U64(0x3575668334A1DD3B), U64(0x735E2B97A4C45A23), + U64(0x18727070F1BD400B), U64(0x1FCBACD259BF02E7), U64(0xD310A7C2CE9B6555), U64(0xBF983FE0FE5D8244), + U64(0x9F74D14F7454A824), U64(0x51EBDC4AB9BA3035), U64(0x5C82C505DB9AB0FA), U64(0xFCF7FE8A3430B241), + U64(0x3253A729B9BA3DDE), U64(0x8C74C368081B3075), U64(0xB9BC6C87167C33E7), U64(0x7EF48F2B83024E20), + U64(0x11D505D4C351BD7F), U64(0x6568FCA92C76A243), U64(0x4DE0B0F40F32A7B8), U64(0x96D693460CC37E5D), + U64(0x42E240CB63689F2F), U64(0x6D2BDCDAE2919661), U64(0x42880B0236E4D951), U64(0x5F0F4A5898171BB6), + U64(0x39F890F579F92F88), U64(0x93C5B5F47356388B), U64(0x63DC359D8D231B78), U64(0xEC16CA8AEA98AD76), + U64(0x5355F900C2A82DC7), U64(0x07FB9F855A997142), U64(0x5093417AA8A7ED5E), U64(0x7BCBC38DA25A7F3C), + U64(0x19FC8A768CF4B6D4), U64(0x637A7780DECFC0D9), U64(0x8249A47AEE0E41F7), U64(0x79AD695501E7D1E8), + U64(0x14ACBAF4777D5776), U64(0xF145B6BECCDEA195), U64(0xDABF2AC8201752FC), U64(0x24C3C94DF9C8D3F6), + U64(0xBB6E2924F03912EA), U64(0x0CE26C0B95C980D9), U64(0xA49CD132BFBF7CC4), U64(0xE99D662AF4243939), + U64(0x27E6AD7891165C3F), U64(0x8535F040B9744FF1), U64(0x54B3F4FA5F40D873), U64(0x72B12C32127FED2B), + U64(0xEE954D3C7B411F47), U64(0x9A85AC909A24EAA1), U64(0x70AC4CD9F04F21F5), U64(0xF9B89D3E99A075C2), + U64(0x87B3E2B2B5C907B1), U64(0xA366E5B8C54F48B8), U64(0xAE4A9346CC3F7CF2), U64(0x1920C04D47267BBD), + U64(0x87BF02C6B49E2AE9), U64(0x092237AC237F3859), U64(0xFF07F64EF8ED14D0), U64(0x8DE8DCA9F03CC54E), + U64(0x9C1633264DB49C89), U64(0xB3F22C3D0B0B38ED), U64(0x390E5FB44D01144B), U64(0x5BFEA5B4712768E9), + U64(0x1E1032911FA78984), U64(0x9A74ACB964E78CB3), U64(0x4F80F7A035DAFB04), U64(0x6304D09A0B3738C4), + U64(0x2171E64683023A08), U64(0x5B9B63EB9CEFF80C), U64(0x506AACF489889342), U64(0x1881AFC9A3A701D6), + U64(0x6503080440750644), U64(0xDFD395339CDBF4A7), U64(0xEF927DBCF00C20F2), U64(0x7B32F7D1E03680EC), + U64(0xB9FD7620E7316243), U64(0x05A7E8A57DB91B77), U64(0xB5889C6E15630A75), U64(0x4A750A09CE9573F7), + U64(0xCF464CEC899A2F8A), U64(0xF538639CE705B824), U64(0x3C79A0FF5580EF7F), U64(0xEDE6C87F8477609D), + U64(0x799E81F05BC93F31), U64(0x86536B8CF3428A8C), U64(0x97D7374C60087B73), U64(0xA246637CFF328532), + U64(0x043FCAE60CC0EBA0), U64(0x920E449535DD359E), U64(0x70EB093B15B290CC), U64(0x73A1921916591CBD), + U64(0x56436C9FE1A1AA8D), U64(0xEFAC4B70633B8F81), U64(0xBB215798D45DF7AF), U64(0x45F20042F24F1768), + U64(0x930F80F4E8EB7462), U64(0xFF6712FFCFD75EA1), U64(0xAE623FD67468AA70), U64(0xDD2C5BC84BC8D8FC), + U64(0x7EED120D54CF2DD9), U64(0x22FE545401165F1C), U64(0xC91800E98FB99929), U64(0x808BD68E6AC10365), + U64(0xDEC468145B7605F6), U64(0x1BEDE3A3AEF53302), U64(0x43539603D6C55602), U64(0xAA969B5C691CCB7A), + U64(0xA87832D392EFEE56), U64(0x65942C7B3C7E11AE), U64(0xDED2D633CAD004F6), U64(0x21F08570F420E565), + U64(0xB415938D7DA94E3C), U64(0x91B859E59ECB6350), U64(0x10CFF333E0ED804A), U64(0x28AED140BE0BB7DD), + U64(0xC5CC1D89724FA456), U64(0x5648F680F11A2741), U64(0x2D255069F0B7DAB3), U64(0x9BC5A38EF729ABD4), + U64(0xEF2F054308F6A2BC), U64(0xAF2042F5CC5C2858), U64(0x480412BAB7F5BE2A), U64(0xAEF3AF4A563DFE43), + U64(0x19AFE59AE451497F), U64(0x52593803DFF1E840), U64(0xF4F076E65F2CE6F0), U64(0x11379625747D5AF3), + U64(0xBCE5D2248682C115), U64(0x9DA4243DE836994F), U64(0x066F70B33FE09017), U64(0x4DC4DE189B671A1C), + U64(0x51039AB7712457C3), U64(0xC07A3F80C31FB4B4), U64(0xB46EE9C5E64A6E7C), U64(0xB3819A42ABE61C87), + U64(0x21A007933A522A20), U64(0x2DF16F761598AA4F), U64(0x763C4A1371B368FD), U64(0xF793C46702E086A0), + U64(0xD7288E012AEB8D31), U64(0xDE336A2A4BC1C44B), U64(0x0BF692B38D079F23), U64(0x2C604A7A177326B3), + U64(0x4850E73E03EB6064), U64(0xCFC447F1E53C8E1B), U64(0xB05CA3F564268D99), U64(0x9AE182C8BC9474E8), + U64(0xA4FC4BD4FC5558CA), U64(0xE755178D58FC4E76), U64(0x69B97DB1A4C03DFE), U64(0xF9B5B7C4ACC67C96), + U64(0xFC6A82D64B8655FB), U64(0x9C684CB6C4D24417), U64(0x8EC97D2917456ED0), U64(0x6703DF9D2924E97E), + U64(0xC547F57E42A7444E), U64(0x78E37644E7CAD29E), U64(0xFE9A44E9362F05FA), U64(0x08BD35CC38336615), + U64(0x9315E5EB3A129ACE), U64(0x94061B871E04DF75), U64(0xDF1D9F9D784BA010), U64(0x3BBA57B68871B59D), + U64(0xD2B7ADEEDED1F73F), U64(0xF7A255D83BC373F8), U64(0xD7F4F2448C0CEB81), U64(0xD95BE88CD210FFA7), + U64(0x336F52F8FF4728E7), U64(0xA74049DAC312AC71), U64(0xA2F61BB6E437FDB5), U64(0x4F2A5CB07F6A35B3), + U64(0x87D380BDA5BF7859), U64(0x16B9F7E06C453A21), U64(0x7BA2484C8A0FD54E), U64(0xF3A678CAD9A2E38C), + U64(0x39B0BF7DDE437BA2), U64(0xFCAF55C1BF8A4424), U64(0x18FCF680573FA594), U64(0x4C0563B89F495AC3), + U64(0x40E087931A00930D), U64(0x8CFFA9412EB642C1), U64(0x68CA39053261169F), U64(0x7A1EE967D27579E2), + U64(0x9D1D60E5076F5B6F), U64(0x3810E399B6F65BA2), U64(0x32095B6D4AB5F9B1), U64(0x35CAB62109DD038A), + U64(0xA90B24499FCFAFB1), U64(0x77A225A07CC2C6BD), U64(0x513E5E634C70E331), U64(0x4361C0CA3F692F12), + U64(0xD941ACA44B20A45B), U64(0x528F7C8602C5807B), U64(0x52AB92BEB9613989), U64(0x9D1DFA2EFC557F73), + U64(0x722FF175F572C348), U64(0x1D1260A51107FE97), U64(0x7A249A57EC0C9BA2), U64(0x04208FE9E8F7F2D6), + U64(0x5A110C6058B920A0), U64(0x0CD9A497658A5698), U64(0x56FD23C8F9715A4C), U64(0x284C847B9D887AAE), + U64(0x04FEABFBBDB619CB), U64(0x742E1E651C60BA83), U64(0x9A9632E65904AD3C), U64(0x881B82A13B51B9E2), + U64(0x506E6744CD974924), U64(0xB0183DB56FFC6A79), U64(0x0ED9B915C66ED37E), U64(0x5E11E86D5873D484), + U64(0xF678647E3519AC6E), U64(0x1B85D488D0F20CC5), U64(0xDAB9FE6525D89021), U64(0x0D151D86ADB73615), + U64(0xA865A54EDCC0F019), U64(0x93C42566AEF98FFB), U64(0x99E7AFEABE000731), U64(0x48CBFF086DDF285A), + U64(0x7F9B6AF1EBF78BAF), U64(0x58627E1A149BBA21), U64(0x2CD16E2ABD791E33), U64(0xD363EFF5F0977996), + U64(0x0CE2A38C344A6EED), U64(0x1A804AADB9CFA741), U64(0x907F30421D78C5DE), U64(0x501F65EDB3034D07), + U64(0x37624AE5A48FA6E9), U64(0x957BAF61700CFF4E), U64(0x3A6C27934E31188A), U64(0xD49503536ABCA345), + U64(0x088E049589C432E0), U64(0xF943AEE7FEBF21B8), U64(0x6C3B8E3E336139D3), U64(0x364F6FFA464EE52E), + U64(0xD60F6DCEDC314222), U64(0x56963B0DCA418FC0), U64(0x16F50EDF91E513AF), U64(0xEF1955914B609F93), + U64(0x565601C0364E3228), U64(0xECB53939887E8175), U64(0xBAC7A9A18531294B), U64(0xB344C470397BBA52), + U64(0x65D34954DAF3CEBD), U64(0xB4B81B3FA97511E2), U64(0xB422061193D6F6A7), U64(0x071582401C38434D), + U64(0x7A13F18BBEDC4FF5), U64(0xBC4097B116C524D2), U64(0x59B97885E2F2EA28), U64(0x99170A5DC3115544), + U64(0x6F423357E7C6A9F9), U64(0x325928EE6E6F8794), U64(0xD0E4366228B03343), U64(0x565C31F7DE89EA27), + U64(0x30F5611484119414), U64(0xD873DB391292ED4F), U64(0x7BD94E1D8E17DEBC), U64(0xC7D9F16864A76E94), + U64(0x947AE053EE56E63C), U64(0xC8C93882F9475F5F), U64(0x3A9BF55BA91F81CA), U64(0xD9A11FBB3D9808E4), + U64(0x0FD22063EDC29FCA), U64(0xB3F256D8ACA0B0B9), U64(0xB03031A8B4516E84), U64(0x35DD37D5871448AF), + U64(0xE9F6082B05542E4E), U64(0xEBFAFA33D7254B59), U64(0x9255ABB50D532280), U64(0xB9AB4CE57F2D34F3), + U64(0x693501D628297551), U64(0xC62C58F97DD949BF), U64(0xCD454F8F19C5126A), U64(0xBBE83F4ECC2BDECB), + U64(0xDC842B7E2819E230), U64(0xBA89142E007503B8), U64(0xA3BC941D0A5061CB), U64(0xE9F6760E32CD8021), + U64(0x09C7E552BC76492F), U64(0x852F54934DA55CC9), U64(0x8107FCCF064FCF56), U64(0x098954D51FFF6580), + U64(0x23B70EDB1955C4BF), U64(0xC330DE426430F69D), U64(0x4715ED43E8A45C0A), U64(0xA8D7E4DAB780A08D), + U64(0x0572B974F03CE0BB), U64(0xB57D2E985E1419C7), U64(0xE8D9ECBE2CF3D73F), U64(0x2FE4B17170E59750), + U64(0x11317BA87905E790), U64(0x7FBF21EC8A1F45EC), U64(0x1725CABFCB045B00), U64(0x964E915CD5E2B207), + U64(0x3E2B8BCBF016D66D), U64(0xBE7444E39328A0AC), U64(0xF85B2B4FBCDE44B7), U64(0x49353FEA39BA63B1), + U64(0x1DD01AAFCD53486A), U64(0x1FCA8A92FD719F85), U64(0xFC7C95D827357AFA), U64(0x18A6A990C8B35EBD), + U64(0xCCCB7005C6B9C28D), U64(0x3BDBB92C43B17F26), U64(0xAA70B5B4F89695A2), U64(0xE94C39A54A98307F), + U64(0xB7A0B174CFF6F36E), U64(0xD4DBA84729AF48AD), U64(0x2E18BC1AD9704A68), U64(0x2DE0966DAF2F8B1C), + U64(0xB9C11D5B1E43A07E), U64(0x64972D68DEE33360), U64(0x94628D38D0C20584), U64(0xDBC0D2B6AB90A559), + U64(0xD2733C4335C6A72F), U64(0x7E75D99D94A70F4D), U64(0x6CED1983376FA72B), U64(0x97FCAACBF030BC24), + U64(0x7B77497B32503B12), U64(0x8547EDDFB81CCB94), U64(0x79999CDFF70902CB), U64(0xCFFE1939438E9B24), + U64(0x829626E3892D95D7), U64(0x92FAE24291F2B3F1), U64(0x63E22C147B9C3403), U64(0xC678B6D860284A1C), + U64(0x5873888850659AE7), U64(0x0981DCD296A8736D), U64(0x9F65789A6509A440), U64(0x9FF38FED72E9052F), + U64(0xE479EE5B9930578C), U64(0xE7F28ECD2D49EECD), U64(0x56C074A581EA17FE), U64(0x5544F7D774B14AEF), + U64(0x7B3F0195FC6F290F), U64(0x12153635B2C0CF57), U64(0x7F5126DBBA5E0CA7), U64(0x7A76956C3EAFB413), + U64(0x3D5774A11D31AB39), U64(0x8A1B083821F40CB4), U64(0x7B4A38E32537DF62), U64(0x950113646D1D6E03), + U64(0x4DA8979A0041E8A9), U64(0x3BC36E078F7515D7), U64(0x5D0A12F27AD310D1), U64(0x7F9D1A2E1EBE1327), + U64(0xDA3A361B1C5157B1), U64(0xDCDD7D20903D0C25), U64(0x36833336D068F707), U64(0xCE68341F79893389), + U64(0xAB9090168DD05F34), U64(0x43954B3252DC25E5), U64(0xB438C2B67F98E5E9), U64(0x10DCD78E3851A492), + U64(0xDBC27AB5447822BF), U64(0x9B3CDB65F82CA382), U64(0xB67B7896167B4C84), U64(0xBFCED1B0048EAC50), + U64(0xA9119B60369FFEBD), U64(0x1FFF7AC80904BF45), U64(0xAC12FB171817EEE7), U64(0xAF08DA9177DDA93D), + U64(0x1B0CAB936E65C744), U64(0xB559EB1D04E5E932), U64(0xC37B45B3F8D6F2BA), U64(0xC3A9DC228CAAC9E9), + U64(0xF3B8B6675A6507FF), U64(0x9FC477DE4ED681DA), U64(0x67378D8ECCEF96CB), U64(0x6DD856D94D259236), + U64(0xA319CE15B0B4DB31), U64(0x073973751F12DD5E), U64(0x8A8E849EB32781A5), U64(0xE1925C71285279F5), + U64(0x74C04BF1790C0EFE), U64(0x4DDA48153C94938A), U64(0x9D266D6A1CC0542C), U64(0x7440FB816508C4FE), + U64(0x13328503DF48229F), U64(0xD6BF7BAEE43CAC40), U64(0x4838D65F6EF6748F), U64(0x1E152328F3318DEA), + U64(0x8F8419A348F296BF), U64(0x72C8834A5957B511), U64(0xD7A023A73260B45C), U64(0x94EBC8ABCFB56DAE), + U64(0x9FC10D0F989993E0), U64(0xDE68A2355B93CAE6), U64(0xA44CFE79AE538BBE), U64(0x9D1D84FCCE371425), + U64(0x51D2B1AB2DDFB636), U64(0x2FD7E4B9E72CD38C), U64(0x65CA5B96B7552210), U64(0xDD69A0D8AB3B546D), + U64(0x604D51B25FBF70E2), U64(0x73AA8A564FB7AC9E), U64(0x1A8C1E992B941148), U64(0xAAC40A2703D9BEA0), + U64(0x764DBEAE7FA4F3A6), U64(0x1E99B96E70A9BE8B), U64(0x2C5E9DEB57EF4743), U64(0x3A938FEE32D29981), + U64(0x26E6DB8FFDF5ADFE), U64(0x469356C504EC9F9D), U64(0xC8763C5B08D1908C), U64(0x3F6C6AF859D80055), + U64(0x7F7CC39420A3A545), U64(0x9BFB227EBDF4C5CE), U64(0x89039D79D6FC5C5C), U64(0x8FE88B57305E2AB6), + U64(0xA09E8C8C35AB96DE), U64(0xFA7E393983325753), U64(0xD6B6D0ECC617C699), U64(0xDFEA21EA9E7557E3), + U64(0xB67C1FA481680AF8), U64(0xCA1E3785A9E724E5), U64(0x1CFC8BED0D681639), U64(0xD18D8549D140CAEA), + U64(0x4ED0FE7E9DC91335), U64(0xE4DBF0634473F5D2), U64(0x1761F93A44D5AEFE), U64(0x53898E4C3910DA55), + U64(0x734DE8181F6EC39A), U64(0x2680B122BAA28D97), U64(0x298AF231C85BAFAB), U64(0x7983EED3740847D5), + U64(0x66C1A2A1A60CD889), U64(0x9E17E49642A3E4C1), U64(0xEDB454E7BADC0805), U64(0x50B704CAB602C329), + U64(0x4CC317FB9CDDD023), U64(0x66B4835D9EAFEA22), U64(0x219B97E26FFC81BD), U64(0x261E4E4C0A333A9D), + U64(0x1FE2CCA76517DB90), U64(0xD7504DFA8816EDBB), U64(0xB9571FA04DC089C8), U64(0x1DDC0325259B27DE), + U64(0xCF3F4688801EB9AA), U64(0xF4F5D05C10CAB243), U64(0x38B6525C21A42B0E), U64(0x36F60E2BA4FA6800), + U64(0xEB3593803173E0CE), U64(0x9C4CD6257C5A3603), U64(0xAF0C317D32ADAA8A), U64(0x258E5A80C7204C4B), + U64(0x8B889D624D44885D), U64(0xF4D14597E660F855), U64(0xD4347F66EC8941C3), U64(0xE699ED85B0DFB40D), + U64(0x2472F6207C2D0484), U64(0xC2A1E7B5B459AEB5), U64(0xAB4F6451CC1D45EC), U64(0x63767572AE3D6174), + U64(0xA59E0BD101731A28), U64(0x116D0016CB948F09), U64(0x2CF9C8CA052F6E9F), U64(0x0B090A7560A968E3), + U64(0xABEEDDB2DDE06FF1), U64(0x58EFC10B06A2068D), U64(0xC6E57A78FBD986E0), U64(0x2EAB8CA63CE802D7), + U64(0x14A195640116F336), U64(0x7C0828DD624EC390), U64(0xD74BBE77E6116AC7), U64(0x804456AF10F5FB53), + U64(0xEBE9EA2ADF4321C7), U64(0x03219A39EE587A30), U64(0x49787FEF17AF9924), U64(0xA1E9300CD8520548), + U64(0x5B45E522E4B1B4EF), U64(0xB49C3B3995091A36), U64(0xD4490AD526F14431), U64(0x12A8F216AF9418C2), + U64(0x001F837CC7350524), U64(0x1877B51E57A764D5), U64(0xA2853B80F17F58EE), U64(0x993E1DE72D36D310), + U64(0xB3598080CE64A656), U64(0x252F59CF0D9F04BB), U64(0xD23C8E176D113600), U64(0x1BDA0492E7E4586E), + U64(0x21E0BD5026C619BF), U64(0x3B097ADAF088F94E), U64(0x8D14DEDB30BE846E), U64(0xF95CFFA23AF5F6F4), + U64(0x3871700761B3F743), U64(0xCA672B91E9E4FA16), U64(0x64C8E531BFF53B55), U64(0x241260ED4AD1E87D), + U64(0x106C09B972D2E822), U64(0x7FBA195410E5CA30), U64(0x7884D9BC6CB569D8), U64(0x0647DFEDCD894A29), + U64(0x63573FF03E224774), U64(0x4FC8E9560F91B123), U64(0x1DB956E450275779), U64(0xB8D91274B9E9D4FB), + U64(0xA2EBEE47E2FBFCE1), U64(0xD9F1F30CCD97FB09), U64(0xEFED53D75FD64E6B), U64(0x2E6D02C36017F67F), + U64(0xA9AA4D20DB084E9B), U64(0xB64BE8D8B25396C1), U64(0x70CB6AF7C2D5BCF0), U64(0x98F076A4F7A2322E), + U64(0xBF84470805E69B5F), U64(0x94C3251F06F90CF3), U64(0x3E003E616A6591E9), U64(0xB925A6CD0421AFF3), + U64(0x61BDD1307C66E300), U64(0xBF8D5108E27E0D48), U64(0x240AB57A8B888B20), U64(0xFC87614BAF287E07), + U64(0xEF02CDD06FFDB432), U64(0xA1082C0466DF6C0A), U64(0x8215E577001332C8), U64(0xD39BB9C3A48DB6CF), + U64(0x2738259634305C14), U64(0x61CF4F94C97DF93D), U64(0x1B6BACA2AE4E125B), U64(0x758F450C88572E0B), + U64(0x959F587D507A8359), U64(0xB063E962E045F54D), U64(0x60E8ED72C0DFF5D1), U64(0x7B64978555326F9F), + U64(0xFD080D236DA814BA), U64(0x8C90FD9B083F4558), U64(0x106F72FE81E2C590), U64(0x7976033A39F7D952), + U64(0xA4EC0132764CA04B), U64(0x733EA705FAE4FA77), U64(0xB4D8F77BC3E56167), U64(0x9E21F4F903B33FD9), + U64(0x9D765E419FB69F6D), U64(0xD30C088BA61EA5EF), U64(0x5D94337FBFAF7F5B), U64(0x1A4E4822EB4D7A59), + U64(0x6FFE73E81B637FB3), U64(0xDDF957BC36D8B9CA), U64(0x64D0E29EEA8838B3), U64(0x08DD9BDFD96B9F63), + U64(0x087E79E5A57D1D13), U64(0xE328E230E3E2B3FB), U64(0x1C2559E30F0946BE), U64(0x720BF5F26F4D2EAA), + U64(0xB0774D261CC609DB), U64(0x443F64EC5A371195), U64(0x4112CF68649A260E), U64(0xD813F2FAB7F5C5CA), + U64(0x660D3257380841EE), U64(0x59AC2C7873F910A3), U64(0xE846963877671A17), U64(0x93B633ABFA3469F8), + U64(0xC0C0F5A60EF4CDCF), U64(0xCAF21ECD4377B28C), U64(0x57277707199B8175), U64(0x506C11B9D90E8B1D), + U64(0xD83CC2687A19255F), U64(0x4A29C6465A314CD1), U64(0xED2DF21216235097), U64(0xB5635C95FF7296E2), + U64(0x22AF003AB672E811), U64(0x52E762596BF68235), U64(0x9AEBA33AC6ECC6B0), U64(0x944F6DE09134DFB6), + U64(0x6C47BEC883A7DE39), U64(0x6AD047C430A12104), U64(0xA5B1CFDBA0AB4067), U64(0x7C45D833AFF07862), + U64(0x5092EF950A16DA0B), U64(0x9338E69C052B8E7B), U64(0x455A4B4CFE30E3F5), U64(0x6B02E63195AD0CF8), + U64(0x6B17B224BAD6BF27), U64(0xD1E0CCD25BB9C169), U64(0xDE0C89A556B9AE70), U64(0x50065E535A213CF6), + U64(0x9C1169FA2777B874), U64(0x78EDEFD694AF1EED), U64(0x6DC93D9526A50E68), U64(0xEE97F453F06791ED), + U64(0x32AB0EDB696703D3), U64(0x3A6853C7E70757A7), U64(0x31865CED6120F37D), U64(0x67FEF95D92607890), + U64(0x1F2B1D1F15F6DC9C), U64(0xB69E38A8965C6B65), U64(0xAA9119FF184CCCF4), U64(0xF43C732873F24C13), + U64(0xFB4A3D794A9A80D2), U64(0x3550C2321FD6109C), U64(0x371F77E76BB8417E), U64(0x6BFA9AAE5EC05779), + U64(0xCD04F3FF001A4778), U64(0xE3273522064480CA), U64(0x9F91508BFFCFC14A), U64(0x049A7F41061A9E60), + U64(0xFCB6BE43A9F2FE9B), U64(0x08DE8A1C7797DA9B), U64(0x8F9887E6078735A1), U64(0xB5B4071DBFC73A66), + U64(0x230E343DFBA08D33), U64(0x43ED7F5A0FAE657D), U64(0x3A88A0FBBCB05C63), U64(0x21874B8B4D2DBC4F), + U64(0x1BDEA12E35F6A8C9), U64(0x53C065C6C8E63528), U64(0xE34A1D250E7A8D6B), U64(0xD6B04D3B7651DD7E), + U64(0x5E90277E7CB39E2D), U64(0x2C046F22062DC67D), U64(0xB10BB459132D0A26), U64(0x3FA9DDFB67E2F199), + U64(0x0E09B88E1914F7AF), U64(0x10E8B35AF3EEAB37), U64(0x9EEDECA8E272B933), U64(0xD4C718BC4AE8AE5F), + U64(0x81536D601170FC20), U64(0x91B534F885818A06), U64(0xEC8177F83F900978), U64(0x190E714FADA5156E), + U64(0xB592BF39B0364963), U64(0x89C350C893AE7DC1), U64(0xAC042E70F8B383F2), U64(0xB49B52E587A1EE60), + U64(0xFB152FE3FF26DA89), U64(0x3E666E6F69AE2C15), U64(0x3B544EBE544C19F9), U64(0xE805A1E290CF2456), + U64(0x24B33C9D7ED25117), U64(0xE74733427B72F0C1), U64(0x0A804D18B7097475), U64(0x57E3306D881EDB4F), + U64(0x4AE7D6A36EB5DBCB), U64(0x2D8D5432157064C8), U64(0xD1E649DE1E7F268B), U64(0x8A328A1CEDFE552C), + U64(0x07A3AEC79624C7DA), U64(0x84547DDC3E203C94), U64(0x990A98FD5071D263), U64(0x1A4FF12616EEFC89), + U64(0xF6F7FD1431714200), U64(0x30C05B1BA332F41C), U64(0x8D2636B81555A786), U64(0x46C9FEB55D120902), + U64(0xCCEC0A73B49C9921), U64(0x4E9D2827355FC492), U64(0x19EBB029435DCB0F), U64(0x4659D2B743848A2C), + U64(0x963EF2C96B33BE31), U64(0x74F85198B05A2E7D), U64(0x5A0F544DD2B1FB18), U64(0x03727073C2E134B1), + U64(0xC7F6AA2DE59AEA61), U64(0x352787BAA0D7C22F), U64(0x9853EAB63B5E0B35), U64(0xABBDCDD7ED5C0860), + U64(0xCF05DAF5AC8D77B0), U64(0x49CAD48CEBF4A71E), U64(0x7A4C10EC2158C4A6), U64(0xD9E92AA246BF719E), + U64(0x13AE978D09FE5557), U64(0x730499AF921549FF), U64(0x4E4B705B92903BA4), U64(0xFF577222C14F0A3A), + U64(0x55B6344CF97AAFAE), U64(0xB862225B055B6960), U64(0xCAC09AFBDDD2CDB4), U64(0xDAF8E9829FE96B5F), + U64(0xB5FDFC5D3132C498), U64(0x310CB380DB6F7503), U64(0xE87FBB46217A360E), U64(0x2102AE466EBB1148), + U64(0xF8549E1A3AA5E00D), U64(0x07A69AFDCC42261A), U64(0xC4C118BFE78FEAAE), U64(0xF9F4892ED96BD438), + U64(0x1AF3DBE25D8F45DA), U64(0xF5B4B0B0D2DEEEB4), U64(0x962ACEEFA82E1C84), U64(0x046E3ECAAF453CE9), + U64(0xF05D129681949A4C), U64(0x964781CE734B3C84), U64(0x9C2ED44081CE5FBD), U64(0x522E23F3925E319E), + U64(0x177E00F9FC32F791), U64(0x2BC60A63A6F3B3F2), U64(0x222BBFAE61725606), U64(0x486289DDCC3D6780), + U64(0x7DC7785B8EFDFC80), U64(0x8AF38731C02BA980), U64(0x1FAB64EA29A2DDF7), U64(0xE4D9429322CD065A), + U64(0x9DA058C67844F20C), U64(0x24C0E332B70019B0), U64(0x233003B5A6CFE6AD), U64(0xD586BD01C5C217F6), + U64(0x5E5637885F29BC2B), U64(0x7EBA726D8C94094B), U64(0x0A56A5F0BFE39272), U64(0xD79476A84EE20D06), + U64(0x9E4C1269BAA4BF37), U64(0x17EFEE45B0DEE640), U64(0x1D95B0A5FCF90BC6), U64(0x93CBE0B699C2585D), + U64(0x65FA4F227A2B6D79), U64(0xD5F9E858292504D5), U64(0xC2B5A03F71471A6F), U64(0x59300222B4561E00), + U64(0xCE2F8642CA0712DC), U64(0x7CA9723FBB2E8988), U64(0x2785338347F2BA08), U64(0xC61BB3A141E50E8C), + U64(0x150F361DAB9DEC26), U64(0x9F6A419D382595F4), U64(0x64A53DC924FE7AC9), U64(0x142DE49FFF7A7C3D), + U64(0x0C335248857FA9E7), U64(0x0A9C32D5EAE45305), U64(0xE6C42178C4BBB92E), U64(0x71F1CE2490D20B07), + U64(0xF1BCC3D275AFE51A), U64(0xE728E8C83C334074), U64(0x96FBF83A12884624), U64(0x81A1549FD6573DA5), + U64(0x5FA7867CAF35E149), U64(0x56986E2EF3ED091B), U64(0x917F1DD5F8886C61), U64(0xD20D8C88C8FFE65F), + U64(0x31D71DCE64B2C310), U64(0xF165B587DF898190), U64(0xA57E6339DD2CF3A0), U64(0x1EF6E6DBB1961EC9), + U64(0x70CC73D90BC26E24), U64(0xE21A6B35DF0C3AD7), U64(0x003A93D8B2806962), U64(0x1C99DED33CB890A1), + U64(0xCF3145DE0ADD4289), U64(0xD0E4427A5514FB72), U64(0x77C621CC9FB3A483), U64(0x67A34DAC4356550B), + U64(0xF8D626AAAF278509), +}; + +uint64 *RandomPiece =Random64; +uint64 *RandomCastle =Random64+768; +uint64 *RandomEnPassant =Random64+772; +uint64 *RandomTurn =Random64+780; + + +uint64 hash(int moveNr) +{ + char c; + int p, r, f, i, p_enc; + uint64 key=0; + + for(f=BOARD_LEFT; f= (int)BlackPawn) ? (int)BlackPawn :(int)WhitePawn; + p_enc = 2*j + ((int)p < (int)BlackPawn); + if(p_enc >= 2*(int)WhiteKing) // king code is not contiguous! + p_enc += 2*((int)WhiteQueen - (int)WhiteKing + 1); + key ^= RandomPiece[64*p_enc+8*r+f]; + } + } + } + if(castlingRights[moveNr][2] >= 0) { + if(castlingRights[moveNr][0] >= 0) key^=RandomCastle[0]; + if(castlingRights[moveNr][1] >= 0) key^=RandomCastle[1]; + } + if(castlingRights[moveNr][5] >= 0) { + if(castlingRights[moveNr][3] >= 0) key^=RandomCastle[2]; + if(castlingRights[moveNr][4] >= 0) key^=RandomCastle[3]; + } + + f = epStatus[moveNr]; + if(f >= 0 && f < 8){ + if(!WhiteOnMove(moveNr)){ + // the test for neighboring Pawns might not be needed, + // as epStatus already kept track of it, but better safe than sorry. + if((f>0 && boards[moveNr][3][f-1]==BlackPawn)|| + (f<7 && boards[moveNr][3][f+1]==BlackPawn)){ + key^=RandomEnPassant[f]; + } + }else{ + if((f>0 && boards[moveNr][4][f-1]==WhitePawn)|| + (f<7 && boards[moveNr][4][f+1]==WhitePawn)){ + key^=RandomEnPassant[f]; + } + } + } + + if(WhiteOnMove(moveNr)){ + key^=RandomTurn[0]; + } + return key; +} + +#define MOVE_BUF 100 + +int int_from_file(FILE *f, int l, uint64 *r) +{ + int i,c; + for(i=0;ikey=r; + ret=int_from_file(f,2,&r); + if(ret) return 1; + entry->move=r; + ret=int_from_file(f,2,&r); + if(ret) return 1; + entry->weight=r; + ret=int_from_file(f,4,&r); + if(ret) return 1; + entry->learn=r; + return 0; +} + +int find_key(FILE *f, uint64 key, entry_t *entry) +{ + int first, last, middle; + entry_t first_entry=entry_none, last_entry,middle_entry; + first=-1; + if(fseek(f,-16,SEEK_END)){ + *entry=entry_none; + entry->key=key+1; //hack + return -1; + } + last=ftell(f)/16; + entry_from_file(f,&last_entry); + while(1){ + if(last-first==1){ + *entry=last_entry; + return last; + } + middle=(first+last)/2; + fseek(f,16*middle,SEEK_SET); + entry_from_file(f,&middle_entry); + if(key<=middle_entry.key){ + last=middle; + last_entry=middle_entry; + }else{ + first=middle; + first_entry=middle_entry; + } + } +} + +void move_to_string(char move_s[6], uint16 move) +{ + int f,fr,ff,t,tr,tf,p; + f=(move>>6)&077; + fr=(f>>3)&0x7; + ff=f&0x7; + t=move&077; + tr=(t>>3)&0x7; + tf=t&0x7; + p=(move>>12)&0x7; + move_s[0]=ff+'a'; + move_s[1]=fr+'1'; + move_s[2]=tf+'a'; + move_s[3]=tr+'1'; + if(p){ + move_s[4]=promote_pieces[p]; + move_s[5]='\0'; + }else{ + move_s[4]='\0'; + } + if(!strcmp(move_s,"e1h1")){ + strcpy(move_s,"e1g1"); + }else if(!strcmp(move_s,"e1a1")){ + strcpy(move_s,"e1c1"); + }else if(!strcmp(move_s,"e8h8")){ + strcpy(move_s,"e8g8"); + }else if(!strcmp(move_s,"e8a8")){ + strcpy(move_s,"e8c8"); + } +} + +char *ProbeBook(int moveNr, char *book) +{ + FILE *f; + entry_t entry; + int offset; + uint64 key; + entry_t entries[MOVE_BUF]; + int count=0; + int ret, i, j; + static char move_s[6]; + int total_weight; + + if(book == NULL) return NULL; + if(gameInfo.variant != VariantNormal) return NULL; // Zobrist scheme only works for normal Chess, so far + f=fopen(book,"rb"); + if(!f){ + DisplayError("Polyglot book not valid", 0); + appData.usePolyglotBook = FALSE; + return NULL; + } + + key = hash(moveNr); + + offset=find_key(f, key, &entry); + if(entry.key != key) return NULL; + entries[0] = entry; + count=1; + fseek(f, 16*(offset+1), SEEK_SET); + while(1){ + ret=entry_from_file(f, &entry); + if(ret){ + break; + } + if(entry.key != key){ + break; + } + if(count == MOVE_BUF) break; + entries[count++] = entry; + } + total_weight = 0; + for(i=0; i> 15; // create random < total_weight + total_weight = 0; + for(i=0; i j) break; + } + if(i >= count) DisplayFatalError("Book Fault", 0, 1); // safety catch, cannot happen + move_to_string(move_s, entries[i].move); + + return move_s; +} diff --git a/common.h b/common.h index cde32fb..6d8a6ec 100644 --- a/common.h +++ b/common.h @@ -100,7 +100,11 @@ int pclose(FILE *); /* End compatibility grunge */ -#define PROTOVER 2 /* engine protocol version */ +#define PROTOVER 2 /* engine protocol version */ + +// [HGM] license: Messages that engines must print to satisfy their license requirements for patented variants +#define GOTHIC "Gothic Chess (see www.GothicChess.com) is licensed under U.S. Patent #6,481,716 by Ed Trice" +#define NOFALCON "Falcon Chess (see www.chessvariants.com) is licensed under U.S. Patent #5,690,334 by George W. Duke" /* [HGM] Some notes about board sizes: In games that allow piece drops, the holdings are considered part of the @@ -221,10 +225,10 @@ typedef enum { BlackHSideCastleFR, BlackASideCastleFR, WhitePromotionKnight, WhitePromotionBishop, WhitePromotionRook, WhitePromotionQueen, WhitePromotionKing, - WhitePromotionChancellor, WhitePromotionArchbishop, + WhitePromotionChancellor, WhitePromotionArchbishop, WhitePromotionCentaur, BlackPromotionKnight, BlackPromotionBishop, BlackPromotionRook, BlackPromotionQueen, BlackPromotionKing, - BlackPromotionChancellor, BlackPromotionArchbishop, + BlackPromotionChancellor, BlackPromotionArchbishop, BlackPromotionCentaur, WhiteCapturesEnPassant, BlackCapturesEnPassant, WhiteDrop, BlackDrop, NormalMove, AmbiguousMove, IllegalMove, ImpossibleMove, @@ -244,13 +248,6 @@ typedef enum { SoundIcsDraw, SoundIcsUnfinished, NSoundClasses } SoundClass; -typedef enum { - SizeTiny, SizeTeeny, SizeDinky, SizePetite, SizeSlim, SizeSmall, - SizeMediocre, SizeMiddling, SizeAverage, SizeModerate, SizeMedium, - SizeBulky, SizeLarge, SizeBig, SizeHuge, SizeGiant, SizeColossal, - SizeTitanic, NUM_SIZES -} BoardSize; - /* Names for chess variants, not necessarily supported */ typedef enum { VariantNormal, /* Normal chess */ @@ -288,6 +285,7 @@ typedef enum { VariantCapaRandom, VariantBerolina, VariantJanus, + VariantSuper, VariantUnknown /* Catchall for other unknown variants */ } VariantClass; @@ -326,6 +324,8 @@ typedef enum { "falcon",\ "caparandom",\ "berolina",\ + "janus",\ + "super",\ "unknown" \ } @@ -573,6 +573,10 @@ typedef struct { Boolean autoKibitz; int engineComments; char *userName; + int rewindIndex; /* [HGM] autoinc */ + int sameColorGames; /* [HGM] alternate */ + int smpCores; + char *egtFormats; } AppData, *AppDataPtr; /* [AS] PGN tags (for showing in the game list) */ diff --git a/config.guess b/config.guess old mode 100755 new mode 100644 diff --git a/config.h.in b/config.h.in index 5f518f1..b07e8e1 100644 --- a/config.h.in +++ b/config.h.in @@ -1,27 +1,18 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ +/* config.h.in. Generated from configure.in by autoheader. */ +/* This file is just here to make autoheader happy, so it will generate + config.h for me. */ -/* Define if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H +#define FIRST_PTY_LETTER 'p' -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE +#define HAVE_FCNTL_H 0 -/* Define as the return type of signal handlers (int or void). */ -#undef RETSIGTYPE +#define HAVE_GETHOSTNAME 0 -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS +#define HAVE_GETTIMEOFDAY 0 -/* Define if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME +#define HAVE_RANDOM 0 -/* Define if the X Window System is missing or not being used. */ -#undef X_DISPLAY_MISSING - -/* Define if lex declares yytext as a char * by default, not a char[]. */ -#undef YYTEXT_POINTER - -#define FIRST_PTY_LETTER 'p' +#define HAVE_SYS_SOCKET_H 0 #undef IBMRTAIX @@ -35,6 +26,8 @@ #undef PTY_NAME_SPRINTF +#undef PTY_OPEN + #undef PTY_TTY_NAME_SPRINTF #define REMOTE_SHELL "rsh" @@ -57,79 +50,151 @@ #undef HAVE_LIBXPM +#define HAVE_USLEEP 0 + #undef USE_XAW3D -/* Define if you have the _getpty function. */ -#undef HAVE__GETPTY +#define X_LOCALE -/* Define if you have the ftime function. */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `ftime' function. */ #undef HAVE_FTIME -/* Define if you have the gethostname function. */ +/* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME -/* Define if you have the gettimeofday function. */ +/* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY -/* Define if you have the grantpt function. */ +/* Define to 1 if you have the `grantpt' function. */ #undef HAVE_GRANTPT -/* Define if you have the rand48 function. */ -#undef HAVE_RAND48 +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H -/* Define if you have the random function. */ -#undef HAVE_RANDOM +/* Define to 1 if you have the header file. */ +#undef HAVE_LAN_SOCKET_H -/* Define if you have the sysinfo function. */ -#undef HAVE_SYSINFO +/* Define to 1 if you have the `i' library (-li). */ +#undef HAVE_LIBI -/* Define if you have the usleep function. */ -#undef HAVE_USLEEP +/* Define to 1 if you have the `seq' library (-lseq). */ +#undef HAVE_LIBSEQ -/* Define if you have the header file. */ -#undef HAVE_X11_XPM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H -/* Define if you have the header file. */ -#undef HAVE_DIRENT_H +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H -/* Define if you have the header file. */ -#undef HAVE_FCNTL_H +/* Define to 1 if you have the `rand48' function. */ +#undef HAVE_RAND48 -/* Define if you have the header file. */ -#undef HAVE_LAN_SOCKET_H +/* Define to 1 if you have the `random' function. */ +#undef HAVE_RANDOM -/* Define if you have the header file. */ -#undef HAVE_NDIR_H +/* Define to 1 if you have the `setitimer' function. */ +#undef HAVE_SETITIMER -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H -/* Define if you have the header file. */ +/* Define to 1 if you have the `sysinfo' function. */ +#undef HAVE_SYSINFO + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ #undef HAVE_SYS_DIR_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_FCNTL_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file, and it defines `DIR'. + */ #undef HAVE_SYS_NDIR_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSTEMINFO_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define if you have the i library (-li). */ -#undef HAVE_LIBI +/* Define to 1 if you have the `usleep' function. */ +#undef HAVE_USLEEP -/* Define if you have the seq library (-lseq). */ -#undef HAVE_LIBSEQ +/* Define to 1 if you have the header file. */ +#undef HAVE_X11_XPM_H + +/* Define to 1 if you have the `_getpty' function. */ +#undef HAVE__GETPTY + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER diff --git a/config.sub b/config.sub old mode 100755 new mode 100644 diff --git a/configure b/configure old mode 100755 new mode 100644 index 16030dd..631b067 --- a/configure +++ b/configure @@ -1,36 +1,100 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. +# Generated by GNU Autoconf 2.61 for xboard 4.3. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -41,21 +105,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,253 +128,613 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= +PACKAGE_NAME='xboard' +PACKAGE_TARNAME='xboard' +PACKAGE_VERSION='4.3' +PACKAGE_STRING='xboard 4.3' +PACKAGE_BUGREPORT='' -ac_unique_file="xboard.c" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LEX LEXLIB LEX_OUTPUT_ROOT RSH NROFF NROFFFLAGS AWKPATH PERLPATH XAW_LIBS EGREP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os PRE_XMULIB POST_XMULIB CONF_CFLAGS CONF_LDFLAGS ZIPPY_O ZIPPY_H PRODUCT VERSION PATCHLEVEL LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +LIBOBJS +LTLIBOBJS +CPP +LEX +LEX_OUTPUT_ROOT +LEXLIB +RSH +MINFO +NROFF +NROFFFLAGS +AWKPATH +PERLPATH +GREP +EGREP +XMKMF +X_CFLAGS +X_PRE_LIBS +X_LIBS +X_EXTRA_LIBS +XAW_LIBS +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +PRE_XMULIB +POST_XMULIB +CONF_CFLAGS +CONF_LDFLAGS +ZIPPY_O +ZIPPY_H +PRODUCT +PATCHLEVEL' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +XMKMF' + # Initialize some variables set by options. ac_init_help= @@ -336,34 +761,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -385,33 +824,45 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -438,6 +889,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -462,13 +919,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -533,6 +993,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -585,24 +1055,20 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -633,8 +1099,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -654,27 +1119,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -701,74 +1158,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -777,7 +1236,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. +\`configure' configures xboard 4.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -797,14 +1256,11 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -817,19 +1273,31 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/xboard] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR @@ -841,12 +1309,16 @@ _ACEOF fi if test -n "$ac_init_help"; then - + case $ac_init_help in + short | recursive ) echo "Configuration of xboard 4.3:";; + esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors --enable-xpm libXpm will be used if found (default) --disable-xpm libXpm will not be used --enable-ptys force use of pseudo-ttys with child processes @@ -859,102 +1331,104 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-Xaw3d use Xaw3d instead of Xaw --with-x use the X Window System + --with-Xaw3d use Xaw3d instead of Xaw Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor + XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +xboard configure 4.3 +generated by GNU Autoconf 2.61 -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +It was created by xboard $as_me 4.3, which was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -973,7 +1447,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -987,6 +1461,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1008,7 +1483,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1019,7 +1493,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1027,23 +1501,21 @@ do 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1054,8 +1526,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1068,20 +1540,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1092,22 +1578,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1119,26 +1611,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1169,14 +1659,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1192,8 +1685,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1205,12 +1698,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1223,20 +1715,19 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1253,6 +1744,30 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi + + + + + + + + + + + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1260,48 +1775,388 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +am__api_version='1.10' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_save_IFS +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS +fi + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + test -n "$AWK" && break +done - ac_config_headers="$ac_config_headers config.h" +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null -PRODUCT=xboard -VERSION=4.3 -PATCHLEVEL=14k +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi -if test -z "$CFLAGS" ; then - CFLAGS=" " +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then + + +# Define the identity of the package. + PACKAGE='xboard' + VERSION='4.3' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -1309,37 +2164,39 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -1347,36 +2204,70 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else - CC="$ac_cv_prog_CC" + STRIP="$ac_cv_prog_STRIP" fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1389,32 +2280,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1427,36 +2320,91 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1470,7 +2418,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1481,6 +2429,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1498,22 +2447,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1526,36 +2476,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1568,29 +2520,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1603,27 +2571,40 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1643,47 +2624,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; + # We found the default executable, but exeext='' is most + # certainly right. + break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; * ) - break;; + break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1695,19 +2706,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -1726,22 +2739,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -1752,10 +2770,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + break;; * ) break;; esac done @@ -1768,19 +2785,18 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1796,14 +2812,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -1821,17 +2843,16 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1850,41 +2871,49 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1900,28 +2929,118 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -1937,15 +3056,14 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1973,6 +3091,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) va_end (v); return s; } + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -1987,181 +3120,2356 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_config_headers="$ac_config_headers config.h" + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by xboard $as_me 4.3, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +xboard config.status 4.3 +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 77; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_arg=$ac_file +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + +PRODUCT=xboard +#VERSION=4.3 # version is already defined +PATCHLEVEL=15 + + +if test -z "$CFLAGS" ; then + CFLAGS=" " +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -$ac_declaration + int main () { -exit (42); +#ifndef __GNUC__ + choke me +#endif + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2183,7 +5491,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2194,25 +5501,24 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -2221,12 +5527,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2234,23 +5540,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -2261,6 +5566,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2278,8 +5584,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -2290,7 +5596,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2301,25 +5606,24 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -2328,12 +5632,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2341,23 +5645,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -2368,6 +5671,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2390,136 +5694,88 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for library containing strerror" >&5 -echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char strerror (); int main () { -strerror (); +return strerror (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_strerror" = no; then - for ac_lib in cposix; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char strerror (); -int -main () -{ -strerror (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_strerror="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_strerror+set}" = set; then + break fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done +done +if test "${ac_cv_search_strerror+set}" = set; then + : +else + ac_cv_search_strerror=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 -echo "${ECHO_T}$ac_cv_search_strerror" >&6 -if test "$ac_cv_search_strerror" != no; then - test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" - -fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} - { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2532,9 +5788,10 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2548,6 +5805,7 @@ do case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -2555,40 +5813,41 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2602,8 +5861,8 @@ for ac_prog in lex flex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2616,25 +5875,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6 + { echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$LEX" && break done test -n "$LEX" || LEX="lex_not_found" @@ -2644,8 +5905,8 @@ if test "$LEX" != lex_not_found ; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2658,222 +5919,182 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6 + { echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$LEX" && break done test -n "$LEX" || LEX=":" -if test -z "$LEXLIB" -then - echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 -echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 -if test "${ac_cv_lib_fl_yywrap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" +if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%% +a { ECHO; } +b { REJECT; } +c { yymore (); } +d { yyless (1); } +e { yyless (input () != 0); } +f { unput (yytext[0]); } +. { BEGIN INITIAL; } +%% +#ifdef YYTEXT_POINTER +extern char *yytext; #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); int -main () +main (void) { -yywrap (); - ; - return 0; + return ! yylex () + ! yywrap (); } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +{ (ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$LEX conftest.l") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_fl_yywrap=yes + (exit $ac_status); } +{ echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; } +if test "${ac_cv_prog_lex_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_fl_yywrap=no +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 -if test $ac_cv_lib_fl_yywrap = yes; then - LEXLIB="-lfl" -else - echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 -echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 -if test "${ac_cv_lib_l_yywrap+set}" = set; then +{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; } +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +if test -z "${LEXLIB+set}"; then + { echo "$as_me:$LINENO: checking lex library" >&5 +echo $ECHO_N "checking lex library... $ECHO_C" >&6; } +if test "${ac_cv_lib_lex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ll $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap (); -int -main () -{ -yywrap (); - ; - return 0; -} + ac_save_LIBS=$LIBS + ac_cv_lib_lex='none needed' + for ac_lib in '' -lfl -ll; do + LIBS="$ac_lib $ac_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +`cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_l_yywrap=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_lex=$ac_lib else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_l_yywrap=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 -if test $ac_cv_lib_l_yywrap = yes; then - LEXLIB="-ll" -fi fi -fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + test "$ac_cv_lib_lex" != 'none needed' && break + done + LIBS=$ac_save_LIBS -if test "x$LEX" != "x:"; then - echo "$as_me:$LINENO: checking lex output file root" >&5 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 -if test "${ac_cv_prog_lex_root+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # The minimal lex program is just a single line: %%. But some broken lexes -# (Solaris, I think it was) want two %% lines, so accommodate them. -cat >conftest.l <<_ACEOF -%% -%% -_ACEOF -{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 - (eval $LEX conftest.l) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy -else - { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 -echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} - { (exit 1); exit 1; }; } fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 +echo "${ECHO_T}$ac_cv_lib_lex" >&6; } + test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 -rm -f conftest.l -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 + +{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; } if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since +# default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no -echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS -LIBS="$LIBS $LEXLIB" +LIBS="$LEXLIB $ac_save_LIBS" cat >conftest.$ac_ext <<_ACEOF +#define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS -rm -f "${LEX_OUTPUT_ROOT}.c" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF @@ -2881,6 +6102,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi +rm -f conftest.l $LEX_OUTPUT_ROOT.c fi fi @@ -2888,8 +6110,8 @@ for ac_prog in remsh rsh do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RSH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2902,37 +6124,86 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RSH="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RSH=$ac_cv_prog_RSH if test -n "$RSH"; then - echo "$as_me:$LINENO: result: $RSH" >&5 -echo "${ECHO_T}$RSH" >&6 + { echo "$as_me:$LINENO: result: $RSH" >&5 +echo "${ECHO_T}$RSH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$RSH" && break done test -n "$RSH" || RSH="rsh" +for ac_prog in makeinfo +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_MINFO+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$MINFO"; then + ac_cv_prog_MINFO="$MINFO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MINFO="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +MINFO=$ac_cv_prog_MINFO +if test -n "$MINFO"; then + { echo "$as_me:$LINENO: result: $MINFO" >&5 +echo "${ECHO_T}$MINFO" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$MINFO" && break +done +test -n "$MINFO" || MINFO="makeinfo_not_found" + +if test "$MINFO" == makeinfo_not_found ; then + echo Please install \"makeinfo\" + exit 1 +fi cat >>confdefs.h <<_ACEOF #define REMOTE_SHELL "$RSH" _ACEOF # Extract the first word of "nroff", so it can be a program name with args. set dummy nroff; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NROFF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2945,33 +6216,35 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NROFF="nroff -man" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_prog_NROFF" && ac_cv_prog_NROFF="cat" fi fi NROFF=$ac_cv_prog_NROFF if test -n "$NROFF"; then - echo "$as_me:$LINENO: result: $NROFF" >&5 -echo "${ECHO_T}$NROFF" >&6 + { echo "$as_me:$LINENO: result: $NROFF" >&5 +echo "${ECHO_T}$NROFF" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + for ac_prog in awk mawk gawk nawk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_AWKPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2986,27 +6259,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AWKPATH="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi AWKPATH=$ac_cv_path_AWKPATH - if test -n "$AWKPATH"; then - echo "$as_me:$LINENO: result: $AWKPATH" >&5 -echo "${ECHO_T}$AWKPATH" >&6 + { echo "$as_me:$LINENO: result: $AWKPATH" >&5 +echo "${ECHO_T}$AWKPATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AWKPATH" && break done @@ -3014,8 +6288,8 @@ for ac_prog in perl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PERLPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3030,68 +6304,204 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERLPATH="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi PERLPATH=$ac_cv_path_PERLPATH - if test -n "$PERLPATH"; then - echo "$as_me:$LINENO: result: $PERLPATH" >&5 -echo "${ECHO_T}$PERLPATH" >&6 + { echo "$as_me:$LINENO: result: $PERLPATH" >&5 +echo "${ECHO_T}$PERLPATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$PERLPATH" && break done -# Check whether --with-Xaw3d or --without-Xaw3d was given. -if test "${with_Xaw3d+set}" = set; then - withval="$with_Xaw3d" - cat >>confdefs.h <<\_ACEOF -#define USE_XAW3D 1 -_ACEOF - XAW_LIBS="-lXaw3d" + + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + else - XAW_LIBS="-lXaw" -fi; + ac_cv_path_GREP=$GREP +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +else + ac_cv_path_EGREP=$EGREP +fi -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3111,30 +6521,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3156,7 +6571,6 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3181,21 +6595,21 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -3206,19 +6620,28 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + || toupper (i) != TOUPPER (i)) + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3231,12 +6654,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3245,13 +6670,12 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3271,28 +6695,34 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_time=no + ac_cv_header_time=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -3301,13 +6731,12 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 -echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3316,7 +6745,7 @@ cat >>conftest.$ac_ext <<_ACEOF #include #include #ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) @@ -3333,28 +6762,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_sys_wait_h=no + ac_cv_header_sys_wait_h=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -3371,13 +6806,12 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3396,28 +6830,35 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 @@ -3429,228 +6870,181 @@ fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char opendir (); int main () { -opendir (); +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in dir; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char opendir (); int main () { -opendir (); +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in x; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi -echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3658,46 +7052,44 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include -#ifdef signal -# undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif int main () { -int i; +return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_signal=void + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_signal=int else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_signal=int + ac_cv_type_signal=void fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal @@ -3715,16 +7107,15 @@ _ACEOF for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3735,28 +7126,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3775,20 +7173,20 @@ done for ac_header in stropts.h sys/time.h string.h unistd.h sys/systeminfo.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3798,33 +7196,38 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3832,23 +7235,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -3856,52 +7258,46 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -3918,20 +7314,20 @@ done for ac_header in fcntl.h sys/fcntl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3941,33 +7337,38 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3975,23 +7376,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -3999,52 +7399,46 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -4061,20 +7455,20 @@ done for ac_header in sys/socket.h lan/socket.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4084,33 +7478,38 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4118,23 +7517,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -4142,52 +7540,46 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -4200,19 +7592,18 @@ fi done if test "${ac_cv_header_stddef_h+set}" = set; then - echo "$as_me:$LINENO: checking for stddef.h" >&5 -echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for stddef.h" >&5 +echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; } if test "${ac_cv_header_stddef_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 -echo "${ECHO_T}$ac_cv_header_stddef_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 +echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking stddef.h usability" >&5 -echo $ECHO_N "checking stddef.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking stddef.h usability" >&5 +echo $ECHO_N "checking stddef.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4222,33 +7613,38 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking stddef.h presence" >&5 -echo $ECHO_N "checking stddef.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking stddef.h presence" >&5 +echo $ECHO_N "checking stddef.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4256,23 +7652,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -4280,52 +7675,45 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stddef.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stddef.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: stddef.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stddef.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stddef.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stddef.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stddef.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stddef.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stddef.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stddef.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stddef.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: stddef.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stddef.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for stddef.h" >&5 -echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for stddef.h" >&5 +echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; } if test "${ac_cv_header_stddef_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stddef_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 -echo "${ECHO_T}$ac_cv_header_stddef_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 +echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; } fi if test $ac_cv_header_stddef_h = yes; then @@ -4346,78 +7734,88 @@ fi for ac_func in _getpty grantpt setitimer usleep do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -4431,78 +7829,88 @@ done for ac_func in gettimeofday ftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -4516,78 +7924,88 @@ done for ac_func in random rand48 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -4601,78 +8019,88 @@ done for ac_func in gethostname sysinfo do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -4681,136 +8109,152 @@ _ACEOF fi done -echo "$as_me:$LINENO: checking for setlocale" >&5 -echo $ECHO_N "checking for setlocale... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for setlocale" >&5 +echo $ECHO_N "checking for setlocale... $ECHO_C" >&6; } if test "${ac_cv_func_setlocale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define setlocale to an innocuous variant, in case declares setlocale. + For example, HP-UX 11i declares gettimeofday. */ +#define setlocale innocuous_setlocale + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setlocale (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef setlocale + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char setlocale (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_setlocale) || defined (__stub___setlocale) +#if defined __stub_setlocale || defined __stub___setlocale choke me -#else -char (*f) () = setlocale; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != setlocale; +return setlocale (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_setlocale=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_setlocale=no + ac_cv_func_setlocale=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_setlocale" >&5 -echo "${ECHO_T}$ac_cv_func_setlocale" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_setlocale" >&5 +echo "${ECHO_T}$ac_cv_func_setlocale" >&6; } if test $ac_cv_func_setlocale = yes; then : else -echo "$as_me:$LINENO: checking for setlocale in -li" >&5 -echo $ECHO_N "checking for setlocale in -li... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for setlocale in -li" >&5 +echo $ECHO_N "checking for setlocale in -li... $ECHO_C" >&6; } if test "${ac_cv_lib_i_setlocale+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-li $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char setlocale (); int main () { -setlocale (); +return setlocale (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_i_setlocale=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_i_setlocale=no + ac_cv_lib_i_setlocale=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_i_setlocale" >&5 -echo "${ECHO_T}$ac_cv_lib_i_setlocale" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_i_setlocale" >&5 +echo "${ECHO_T}$ac_cv_lib_i_setlocale" >&6; } if test $ac_cv_lib_i_setlocale = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBI 1 @@ -4829,60 +8273,67 @@ fi -echo "$as_me:$LINENO: checking for getpseudotty in -lseq" >&5 -echo $ECHO_N "checking for getpseudotty in -lseq... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for getpseudotty in -lseq" >&5 +echo $ECHO_N "checking for getpseudotty in -lseq... $ECHO_C" >&6; } if test "${ac_cv_lib_seq_getpseudotty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lseq $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char getpseudotty (); int main () { -getpseudotty (); +return getpseudotty (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_seq_getpseudotty=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_seq_getpseudotty=no + ac_cv_lib_seq_getpseudotty=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getpseudotty" >&5 -echo "${ECHO_T}$ac_cv_lib_seq_getpseudotty" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getpseudotty" >&5 +echo "${ECHO_T}$ac_cv_lib_seq_getpseudotty" >&6; } if test $ac_cv_lib_seq_getpseudotty = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSEQ 1 @@ -4893,52 +8344,57 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for X" >&5 -echo $ECHO_N "checking for X... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6; } -# Check whether --with-x or --without-x was given. +# Check whether --with-x was given. if test "${with_x+set}" = set; then - withval="$with_x" + withval=$with_x; +fi -fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else - if test "${ac_cv_have_x+set}" = set; then + case $x_includes,$x_libraries in #( + *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 +echo "$as_me: error: Cannot use X directory names containing '" >&2;} + { (exit 1); exit 1; }; };; #( + *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no -rm -fr conftest.dir +rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -_ACEOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in - /usr/include) ;; + /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in @@ -4947,7 +8403,7 @@ _ACEOF esac fi cd .. - rm -fr conftest.dir + rm -f -r conftest.dir fi # Standard set of common directories for X headers. @@ -4988,34 +8444,32 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. + # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # We can compile using X headers with no special include directory. ac_x_includes= else @@ -5023,12 +8477,13 @@ else sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then + if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi + rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no @@ -5037,35 +8492,40 @@ if test "$ac_x_libraries" = no; then # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS - LIBS="-lXt $LIBS" + LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -XtMalloc (0) +XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= @@ -5073,48 +8533,54 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -LIBS=$ac_save_LIBS + LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do - if test -r $ac_dir/libXt.$ac_extension; then + if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no -if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac fi - - fi +;; #( + *) have_x=yes;; + esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then - echo "$as_me:$LINENO: result: $have_x" >&5 -echo "${ECHO_T}$have_x" >&6 + { echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then @@ -5135,13 +8601,12 @@ else X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . - case `(uname -sr) 2>/dev/null` in - "SunOS 5"*) - echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 -echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 - ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 +echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + ac_xsave_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5157,33 +8622,32 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_R_nospace=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + X_LIBS="$X_LIBS -R$x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_R_nospace=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - if test $ac_R_nospace = yes; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - X_LIBS="$X_LIBS -R$x_libraries" - else LIBS="$ac_xsave_LIBS -R $x_libraries" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5199,36 +8663,42 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_R_space=yes + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_R_space=no + { echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6; } fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - if test $ac_R_space = yes; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - X_LIBS="$X_LIBS -R $x_libraries" - else - echo "$as_me:$LINENO: result: neither works" >&5 -echo "${ECHO_T}neither works" >&6 - fi - fi - LIBS=$ac_xsave_LIBS - esac + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$ac_xsave_c_werror_flag + LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. @@ -5243,165 +8713,186 @@ echo "${ECHO_T}neither works" >&6 # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int main () { -XOpenDisplay (); +return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 -echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { -dnet_ntoa (); +return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dnet_dnet_ntoa=no + ac_cv_lib_dnet_dnet_ntoa=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then - echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 -echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { -dnet_ntoa (); +return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dnet_stub_dnet_ntoa=no + ac_cv_lib_dnet_stub_dnet_ntoa=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, @@ -5412,193 +8903,216 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - echo "$as_me:$LINENO: checking for gethostbyname" >&5 -echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef gethostbyname + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +#if defined __stub_gethostbyname || defined __stub___gethostbyname choke me -#else -char (*f) () = gethostbyname; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != gethostbyname; +return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_gethostbyname=no + ac_cv_func_gethostbyname=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then - echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 -echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { -gethostbyname (); +return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_nsl_gethostbyname=no + ac_cv_lib_nsl_gethostbyname=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then - echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 -echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 +echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { -gethostbyname (); +return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_bsd_gethostbyname=no + ac_cv_lib_bsd_gethostbyname=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi @@ -5613,134 +9127,150 @@ fi # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. - echo "$as_me:$LINENO: checking for connect" >&5 -echo $ECHO_N "checking for connect... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef connect + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) +#if defined __stub_connect || defined __stub___connect choke me -#else -char (*f) () = connect; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != connect; +return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_connect=no + ac_cv_func_connect=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then - echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 -echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char connect (); int main () { -connect (); +return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_socket_connect=no + ac_cv_lib_socket_connect=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi @@ -5748,134 +9278,150 @@ fi fi # Guillermo Gomez says -lposix is necessary on A/UX. - echo "$as_me:$LINENO: checking for remove" >&5 -echo $ECHO_N "checking for remove... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for remove" >&5 +echo $ECHO_N "checking for remove... $ECHO_C" >&6; } if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define remove to an innocuous variant, in case declares remove. + For example, HP-UX 11i declares gettimeofday. */ +#define remove innocuous_remove + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef remove + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_remove) || defined (__stub___remove) +#if defined __stub_remove || defined __stub___remove choke me -#else -char (*f) () = remove; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != remove; +return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_remove=no + ac_cv_func_remove=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 -echo "${ECHO_T}$ac_cv_func_remove" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 +echo "${ECHO_T}$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then - echo "$as_me:$LINENO: checking for remove in -lposix" >&5 -echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 +echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char remove (); int main () { -remove (); +return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_posix_remove=no + ac_cv_lib_posix_remove=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 -echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 +echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi @@ -5883,134 +9429,150 @@ fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo "$as_me:$LINENO: checking for shmat" >&5 -echo $ECHO_N "checking for shmat... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shmat" >&5 +echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define shmat to an innocuous variant, in case declares shmat. + For example, HP-UX 11i declares gettimeofday. */ +#define shmat innocuous_shmat + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef shmat + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_shmat) || defined (__stub___shmat) +#if defined __stub_shmat || defined __stub___shmat choke me -#else -char (*f) () = shmat; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != shmat; +return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_shmat=no + ac_cv_func_shmat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 -echo "${ECHO_T}$ac_cv_func_shmat" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 +echo "${ECHO_T}$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then - echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 -echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 +echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shmat (); int main () { -shmat (); +return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ipc_shmat=no + ac_cv_lib_ipc_shmat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 -echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 +echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi @@ -6027,60 +9589,67 @@ fi # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry - echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 -echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 +echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char IceConnectionNumber (); int main () { -IceConnectionNumber (); +return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ICE_IceConnectionNumber=no + ac_cv_lib_ICE_IceConnectionNumber=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 -echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi @@ -6096,58 +9665,727 @@ if test -n "$no_x" ; then exit 1 fi +if test "${ac_cv_header_X11_Intrinsic_h+set}" = set; then + { echo "$as_me:$LINENO: checking for X11/Intrinsic.h" >&5 +echo $ECHO_N "checking for X11/Intrinsic.h... $ECHO_C" >&6; } +if test "${ac_cv_header_X11_Intrinsic_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Intrinsic_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Intrinsic_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking X11/Intrinsic.h usability" >&5 +echo $ECHO_N "checking X11/Intrinsic.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking X11/Intrinsic.h presence" >&5 +echo $ECHO_N "checking X11/Intrinsic.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: X11/Intrinsic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: X11/Intrinsic.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: X11/Intrinsic.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: X11/Intrinsic.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: X11/Intrinsic.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: X11/Intrinsic.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: X11/Intrinsic.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: X11/Intrinsic.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for X11/Intrinsic.h" >&5 +echo $ECHO_N "checking for X11/Intrinsic.h... $ECHO_C" >&6; } +if test "${ac_cv_header_X11_Intrinsic_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_X11_Intrinsic_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Intrinsic_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Intrinsic_h" >&6; } + +fi +if test $ac_cv_header_X11_Intrinsic_h = yes; then + xt="yes" +else + xt="no" +fi + + + +if test "$xt" == "no" ; then + echo Xt headers not found + exit 1 +fi + + +# Check whether --with-Xaw3d was given. +if test "${with_Xaw3d+set}" = set; then + withval=$with_Xaw3d; with_xaw3d="yes" +else + with_xaw3d="no" +fi + + + +xaw_headers="no" +if test "$with_xaw3d" == "yes" ; then + XAW_LIBS="-lXaw3d" + { echo "$as_me:$LINENO: checking for XawTextReplace in -lXaw3d" >&5 +echo $ECHO_N "checking for XawTextReplace in -lXaw3d... $ECHO_C" >&6; } +if test "${ac_cv_lib_Xaw3d_XawTextReplace+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXaw3d $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XawTextReplace (); +int +main () +{ +return XawTextReplace (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_Xaw3d_XawTextReplace=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Xaw3d_XawTextReplace=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw3d_XawTextReplace" >&5 +echo "${ECHO_T}$ac_cv_lib_Xaw3d_XawTextReplace" >&6; } +if test $ac_cv_lib_Xaw3d_XawTextReplace = yes; then + xaw3d_lib="yes" +else + xaw3d_lib="no" +fi + + if test "$xaw3d_lib" == "no" ; then + echo Xaw3d libraries not found + exit 1 + else + if test "${ac_cv_header_X11_Xaw3d_Dialog_h+set}" = set; then + { echo "$as_me:$LINENO: checking for X11/Xaw3d/Dialog.h" >&5 +echo $ECHO_N "checking for X11/Xaw3d/Dialog.h... $ECHO_C" >&6; } +if test "${ac_cv_header_X11_Xaw3d_Dialog_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_Dialog_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Xaw3d_Dialog_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking X11/Xaw3d/Dialog.h usability" >&5 +echo $ECHO_N "checking X11/Xaw3d/Dialog.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking X11/Xaw3d/Dialog.h presence" >&5 +echo $ECHO_N "checking X11/Xaw3d/Dialog.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for X11/Xaw3d/Dialog.h" >&5 +echo $ECHO_N "checking for X11/Xaw3d/Dialog.h... $ECHO_C" >&6; } +if test "${ac_cv_header_X11_Xaw3d_Dialog_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_X11_Xaw3d_Dialog_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_Dialog_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Xaw3d_Dialog_h" >&6; } + +fi +if test $ac_cv_header_X11_Xaw3d_Dialog_h = yes; then + xaw3d_headers="yes" +else + xaw3d_headers="no" +fi + + + if test "$xaw3d_headers" == "yes" ; then + cat >>confdefs.h <<\_ACEOF +#define USE_XAW3D 1 +_ACEOF + + xaw_headers="yes" + else + if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then + { echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 +echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } +if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h usability" >&5 +echo $ECHO_N "checking X11/Xaw/Dialog.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h presence" >&5 +echo $ECHO_N "checking X11/Xaw/Dialog.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 +echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } +if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_X11_Xaw_Dialog_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } + +fi +if test $ac_cv_header_X11_Xaw_Dialog_h = yes; then + xaw_headers="yes" +fi + + + fi + fi +else + XAW_LIBS="-lXaw" + if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then + { echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 +echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } +if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h usability" >&5 +echo $ECHO_N "checking X11/Xaw/Dialog.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h presence" >&5 +echo $ECHO_N "checking X11/Xaw/Dialog.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 +echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } +if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_X11_Xaw_Dialog_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } + +fi +if test $ac_cv_header_X11_Xaw_Dialog_h = yes; then + xaw_headers="yes" +fi + + +fi + + + + + +if test "$xaw_headers" == "no" ; then + echo Xaw headers not found + exit 1 + +fi + + + + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac @@ -6333,13 +10571,13 @@ _ACEOF ;; esac -# Check whether --enable-xpm or --disable-xpm was given. +# Check whether --enable-xpm was given. if test "${enable_xpm+set}" = set; then - enableval="$enable_xpm" - enable_xpm="$enableval" + enableval=$enable_xpm; enable_xpm="$enableval" else enable_xpm="yes" -fi; +fi + if test "$enable_xpm" = "yes"; then save_cflags="$CFLAGS" @@ -6349,20 +10587,20 @@ if test "$enable_xpm" = "yes"; then for ac_header in X11/xpm.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6372,33 +10610,38 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6406,23 +10649,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -6430,52 +10672,46 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -6491,60 +10727,67 @@ done if test "$ac_cv_header_X11_xpm_h" = "yes"; then save_ldflags="$LDFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" - echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5 -echo $ECHO_N "checking for XpmReadFileToPixmap in -lXpm... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5 +echo $ECHO_N "checking for XpmReadFileToPixmap in -lXpm... $ECHO_C" >&6; } if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XpmReadFileToPixmap (); int main () { -XpmReadFileToPixmap (); +return XpmReadFileToPixmap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_Xpm_XpmReadFileToPixmap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_Xpm_XpmReadFileToPixmap=no + ac_cv_lib_Xpm_XpmReadFileToPixmap=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5 -echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5 +echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; } if test $ac_cv_lib_Xpm_XpmReadFileToPixmap = yes; then X_PRE_LIBS="-lXpm $X_PRE_LIBS"; cat >>confdefs.h <<\_ACEOF #define HAVE_LIBXPM 1 @@ -6561,42 +10804,42 @@ fi -echo "$as_me:$LINENO: checking whether ptys or pipes should be used" >&5 -echo $ECHO_N "checking whether ptys or pipes should be used... $ECHO_C" >&6 -# Check whether --enable-ptys or --disable-ptys was given. +{ echo "$as_me:$LINENO: checking whether ptys or pipes should be used" >&5 +echo $ECHO_N "checking whether ptys or pipes should be used... $ECHO_C" >&6; } +# Check whether --enable-ptys was given. if test "${enable_ptys+set}" = set; then - enableval="$enable_ptys" - if test "$enableval" = yes; then + enableval=$enable_ptys; if test "$enableval" = yes; then USE_PTYS=1 - echo "$as_me:$LINENO: result: ptys (user override)" >&5 -echo "${ECHO_T}ptys (user override)" >&6 + { echo "$as_me:$LINENO: result: ptys (user override)" >&5 +echo "${ECHO_T}ptys (user override)" >&6; } fi if test "$enableval" = no; then USE_PTYS=0 - echo "$as_me:$LINENO: result: pipes (user override)" >&5 -echo "${ECHO_T}pipes (user override)" >&6 + { echo "$as_me:$LINENO: result: pipes (user override)" >&5 +echo "${ECHO_T}pipes (user override)" >&6; } fi else if test "$USE_PTYS" = 1; then - echo "$as_me:$LINENO: result: ptys" >&5 -echo "${ECHO_T}ptys" >&6 + { echo "$as_me:$LINENO: result: ptys" >&5 +echo "${ECHO_T}ptys" >&6; } else - echo "$as_me:$LINENO: result: pipes" >&5 -echo "${ECHO_T}pipes" >&6 + { echo "$as_me:$LINENO: result: pipes" >&5 +echo "${ECHO_T}pipes" >&6; } +fi fi -fi; + cat >>confdefs.h <<_ACEOF #define USE_PTYS $USE_PTYS _ACEOF -# Check whether --enable-zippy or --disable-zippy was given. +# Check whether --enable-zippy was given. if test "${enable_zippy+set}" = set; then - enableval="$enable_zippy" - enable_zippy="$enableval" + enableval=$enable_zippy; enable_zippy="$enableval" else enable_zippy="yes" -fi; +fi + if test "$enable_zippy" = yes; then cat >>confdefs.h <<\_ACEOF #define ZIPPY 1 @@ -6608,10 +10851,9 @@ fi -# Check whether --enable-sigint or --disable-sigint was given. +# Check whether --enable-sigint was given. if test "${enable_sigint+set}" = set; then - enableval="$enable_sigint" - if test "$enableval" = yes; then + enableval=$enable_sigint; if test "$enableval" = yes; then cat >>confdefs.h <<\_ACEOF #define ATTENTION 1 _ACEOF @@ -6622,7 +10864,8 @@ else #define ATTENTION 1 _ACEOF -fi; +fi + cat >>confdefs.h <<_ACEOF #define PRODUCT "$PRODUCT" @@ -6640,8 +10883,10 @@ _ACEOF - ac_config_files="$ac_config_files Makefile cmail xboard.texinfo" - ac_config_commands="$ac_config_commands default" +ac_config_files="$ac_config_files cmail xboard.texinfo" + +ac_config_commands="$ac_config_commands default" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -6660,39 +10905,58 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -6701,38 +10965,45 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -6757,27 +11028,91 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -6788,21 +11123,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -6810,200 +11146,166 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +# values after options handling. +ac_log=" +This file was extended by xboard $as_me 4.3, which was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7011,30 +11313,20 @@ generated by GNU Autoconf 2.57. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -7042,14 +11334,14 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + instantiate the configuration header FILE Configuration files: $config_files @@ -7061,20 +11353,22 @@ Configuration commands: $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +xboard config.status 4.3 +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -7085,39 +11379,24 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -7127,18 +11406,24 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -7154,32 +11439,52 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "cmail" ) CONFIG_FILES="$CONFIG_FILES cmail" ;; - "xboard.texinfo" ) CONFIG_FILES="$CONFIG_FILES xboard.texinfo" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "cmail") CONFIG_FILES="$CONFIG_FILES cmail" ;; + "xboard.texinfo") CONFIG_FILES="$CONFIG_FILES xboard.texinfo" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -7191,609 +11496,777 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@LEX@,$LEX,;t t -s,@LEXLIB@,$LEXLIB,;t t -s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t -s,@RSH@,$RSH,;t t -s,@NROFF@,$NROFF,;t t -s,@NROFFFLAGS@,$NROFFFLAGS,;t t -s,@AWKPATH@,$AWKPATH,;t t -s,@PERLPATH@,$PERLPATH,;t t -s,@XAW_LIBS@,$XAW_LIBS,;t t -s,@EGREP@,$EGREP,;t t -s,@X_CFLAGS@,$X_CFLAGS,;t t -s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t -s,@X_LIBS@,$X_LIBS,;t t -s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@PRE_XMULIB@,$PRE_XMULIB,;t t -s,@POST_XMULIB@,$POST_XMULIB,;t t -s,@CONF_CFLAGS@,$CONF_CFLAGS,;t t -s,@CONF_LDFLAGS@,$CONF_LDFLAGS,;t t -s,@ZIPPY_O@,$ZIPPY_O,;t t -s,@ZIPPY_H@,$ZIPPY_H,;t t -s,@PRODUCT@,$PRODUCT,;t t -s,@VERSION@,$VERSION,;t t -s,@PATCHLEVEL@,$PATCHLEVEL,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +CPP!$CPP$ac_delim +LEX!$LEX$ac_delim +LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim +LEXLIB!$LEXLIB$ac_delim +RSH!$RSH$ac_delim +MINFO!$MINFO$ac_delim +NROFF!$NROFF$ac_delim +NROFFFLAGS!$NROFFFLAGS$ac_delim +AWKPATH!$AWKPATH$ac_delim +PERLPATH!$PERLPATH$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +XMKMF!$XMKMF$ac_delim +X_CFLAGS!$X_CFLAGS$ac_delim +X_PRE_LIBS!$X_PRE_LIBS$ac_delim +X_LIBS!$X_LIBS$ac_delim +X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim +XAW_LIBS!$XAW_LIBS$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +PRE_XMULIB!$PRE_XMULIB$ac_delim +POST_XMULIB!$POST_XMULIB$ac_delim +CONF_CFLAGS!$CONF_CFLAGS$ac_delim +CONF_LDFLAGS!$CONF_LDFLAGS$ac_delim +ZIPPY_O!$ZIPPY_O$ac_delim +ZIPPY_H!$ZIPPY_H$ac_delim +PRODUCT!$PRODUCT$ac_delim +PATCHLEVEL!$PATCHLEVEL$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 14; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_arg=$ac_file +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - ac_builddir=. + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - default ) test -z "$CONFIG_HEADERS" || date > stamp-h + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + "default":C) test -z "$CONFIG_HEADERS" || date > stamp-h chmod 755 cmail ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF diff --git a/configure.in b/configure.in index c7f55f6..da09924 100644 --- a/configure.in +++ b/configure.in @@ -9,12 +9,18 @@ dnl| it portable to sites and systems other than your own), and run autoconf dnl| to regenerate configure. Then submit your changes to be folded into dnl| the standard version of xboard. -AC_INIT(xboard.c) -AC_CONFIG_HEADER(config.h) - +AC_INIT([xboard],[4.3]) +AM_INIT_AUTOMAKE +AC_PROG_CC +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([ +Makefile +]) +AC_OUTPUT PRODUCT=xboard -VERSION=4.2 -PATCHLEVEL=7 +#VERSION=4.3 # version is already defined +PATCHLEVEL=15 + if test -z "$CFLAGS" ; then dnl| Prevent the next macro from setting CFLAGS to -g @@ -29,17 +35,19 @@ if test "$LEX" != lex_not_found ; then AC_DECL_YYTEXT fi AC_CHECK_PROGS(RSH, remsh rsh, rsh) +AC_CHECK_PROGS(MINFO, makeinfo, makeinfo_not_found) +if test "$MINFO" == makeinfo_not_found ; then + echo Please install \"makeinfo\" + exit 1 +fi AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$RSH") AC_CHECK_PROG(NROFF, nroff, [nroff -man], cat) AC_SUBST(NROFFFLAGS) AC_PATH_PROGS(AWKPATH, awk mawk gawk nawk) AC_PATH_PROGS(PERLPATH, perl) -AC_ARG_WITH(Xaw3d, [ --with-Xaw3d use Xaw3d instead of Xaw], - [AC_DEFINE(USE_XAW3D) - XAW_LIBS="-lXaw3d"], - XAW_LIBS="-lXaw") -AC_SUBST(XAW_LIBS) + + AC_HEADER_STDC AC_HEADER_TIME @@ -68,6 +76,51 @@ if test -n "$no_x" ; then exit 1 fi +AC_CHECK_HEADER(X11/Intrinsic.h,xt="yes",xt="no") + +if test "$xt" == "no" ; then + echo Xt headers not found + exit 1 +fi + +AC_ARG_WITH(Xaw3d, [ --with-Xaw3d use Xaw3d instead of Xaw], + with_xaw3d="yes", with_xaw3d="no") + + +xaw_headers="no" +if test "$with_xaw3d" == "yes" ; then + XAW_LIBS="-lXaw3d" + AC_CHECK_LIB([Xaw3d], [XawTextReplace], xaw3d_lib="yes", xaw3d_lib="no") + if test "$xaw3d_lib" == "no" ; then + echo Xaw3d libraries not found + exit 1 + else + AC_CHECK_HEADER(X11/Xaw3d/Dialog.h,xaw3d_headers="yes",xaw3d_headers="no") + if test "$xaw3d_headers" == "yes" ; then + AC_DEFINE(USE_XAW3D) + xaw_headers="yes" + else + AC_CHECK_HEADER(X11/Xaw/Dialog.h,xaw_headers="yes") + fi + fi +else + XAW_LIBS="-lXaw" + AC_CHECK_HEADER(X11/Xaw/Dialog.h,xaw_headers="yes") +fi + +AC_SUBST(XAW_LIBS) + + + +if test "$xaw_headers" == "no" ; then + echo Xaw headers not found + exit 1 + +fi + + + + AC_CANONICAL_HOST dnl| The following info is mostly gathered from GNU Emacs 19.24. Basically, @@ -315,7 +368,7 @@ AC_SUBST(PRODUCT) AC_SUBST(VERSION) AC_SUBST(PATCHLEVEL) -AC_OUTPUT(Makefile cmail xboard.texinfo, +AC_OUTPUT(cmail xboard.texinfo, [test -z "$CONFIG_HEADERS" || date > stamp-h chmod 755 cmail ]) diff --git a/copyright.texi b/copyright.texi index 661d27a..ab2be49 100644 --- a/copyright.texi +++ b/copyright.texi @@ -1,3 +1,5 @@ +@setfilename copyright.info + Copyright @copyright{} 1991 Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved. diff --git a/engine-intf.html b/engine-intf.html index 01f0e5b..b2cd121 100644 --- a/engine-intf.html +++ b/engine-intf.html @@ -12,7 +12,8 @@ $Id: engine-intf.html,v 2.1 2003/10/27 19:21:00 mann Exp $
Version 2; implemented in xboard/WinBoard 4.2.1 and later.
Changes since version 1 are indicated in red.
-Changes for WinBoard 4.3.xx are indicated in green. +Changes for WinBoard 4.3.xx are indicated in green.
+Proposed changes, implemented only in alpha versions are indicated in blue.
    @@ -535,6 +536,8 @@ or by having no legal moves (ICC) shuffle variant like FRC (10x8 board) cylinder Pieces wrap around between side edges, like board is a cylinder +super +Superchess: a shuffle variant with 4 fairy pieces on 8x8 board unknownUnknown variant (not supported)

    @@ -655,7 +658,7 @@ otim clock with the opposite color. that many engines implement it wrong. The clocks in fact always remain with the color. Which clock reading is relayed with "time", and which by "otim", is determined by which side the engine plays. -Not that the way the clocks operate and receive extra time (in accordance with the selected time control) +Note that the way the clocks operate and receive extra time (in accordance with the selected time control) is not affected in any way by which moves are made by the engine, which by the opponent, and which were forced.

    @@ -1004,6 +1007,52 @@ paused thinking or pondering (if any) resumes from exactly where it left off, and the clock of the player on move resumes running from where it stopped. +

    + +

    memory N +
    +This command informs the engine on how much memory it is allowed to use maximally, in MegaBytes. +On receipt of this command, the engine should adapt the size of its hash tables accordingly. +This command does only fix the total memory use, +the engine has to decide for itself +(or be configured by the user by other means) +how to divide up the available memory between the various tables it wants to use +(e.g. main hash, pawn hash, tablebase cache, bitbases). +This command will only be sent to engines that have requested it through the memory feature, +and only at the beginning of a game +(before any moves have been done). + +

    + +

    cores N +
    +This command informs the engine on how many CPU cores it is allowed to use maximally. +This could be interpreted as the number of search threads for SMP engines. +(Threads that do not consume significant amounts of CPU time, like I/O threads, need not be included in the count.) +This command will only be sent to engines that have requested it through the smp feature. +The engine should be able to respond to the "cores" command any time during a game, +but it is allowed to finish a search in progress before procesing the command. +(Reaction during ponder time should be immediate, though.) + +

    + +

    egtpath TYPE PATH +
    +This command informs the engine in which directory (given by the PATH argument) +it can find end-game tables of the specified TYPE. +The TYPE argument can be any character string which does not contain spaces. +Currently nalimov and scorpio are defined types, +for Nalimov tablebases and Scorpio bitbases, respectively, +but future developers of other formats are free to define their own format names. +The GUI simply matches the TYPE names the engine says it supports +with those that the user supplied when configuring xboard. +For every match, it sends a separate "y" command. +The PATH argument would normally (for Nalimov) be the pathname of the directory the EGT files are in, +but could also be the name of a file, or in fact anything the particular EGT type requires. +It is upto the developer of the EGT format to specify the syntax of this parameter. +This command will only be sent to engines that have told the GUI they support EGTs of the given TYPE +through the egt feature. +

    Bughouse commands:

    @@ -1252,9 +1301,9 @@ Zippy mode.) It is recommended that you set this feature to the correct value for your engine (just "normal" in most cases) rather than leaving the default in place, so that the user will get an appropriate error message if he tries to play a variant that your -engine does not support. +engine does not support.
    -If your engine can play variants on a deviating board size, +If your engine can play variants on a deviating board size, like capablanca on an 8x8 board, or capablanca crazyhouse, it can list them amongst the variants with a prefix spcifying board size plus holdings size, like 8x8+0_capablanca or 10x8+7_capablanca. @@ -1328,6 +1377,33 @@ engines must refrain from sending the debug output, or do so at their own risk. +
    +memory (boolean, default 0) + +
    +If memory=1, the size of the total amount of memory available for the memory-consuming tables of the engine +(e.g. hash, EGTB cache) +will be set by the GUI through the "memory" command. + + +
    +smp (boolean, default 0) + +
    +If smp=1, the GUI will send the "cores" command to the engine to inform it how many CPU cores it can use. + + +
    +egt (string, see text below) + +
    +This feature indicates which end-game table formats the engine supports. +It should be a comma-separated list of format names. +See under the "egtpath" command in section 8 above. +If you do not set this feature, xboard will assume the engine does not support end-game tables, +and will not send any "egtpath" commands to inform the engine about their whereabouts. + +
    done (integer, no default) @@ -1720,7 +1796,7 @@ can go negative and then become positive again because of the increment.)

    -

    +

    The number of moves given in the level command (when non-zero) should be taken as the number of moves still to do before the specified time will be added to the clock, if the "level" command is received after @@ -1739,7 +1815,7 @@ and the engine receives "level 20 22 0" just before move 41, it should understand that it should do the next 20 moves in 22 minutes (pehaps because the secondary session was 20 moves per 15 minutes, and it had 7 minutes left on its clock after the first 40 moves). -

    +

    A special rule on some ICS implementations: if you ask for a game with diff --git a/install-sh b/install-sh old mode 100755 new mode 100644 diff --git a/manual.html b/manual.html new file mode 100644 index 0000000..1d89a86 --- /dev/null +++ b/manual.html @@ -0,0 +1,535 @@ + + + + +WinBoard 4.3.15 + + + +
    +

    WinBoard 4.3.15

    +

    "For the ultimate WinBoard experience"

    +

    Introduction

    +

    +The WinBoard 4.3 series is a continuation of the WinBoard_x line by Allessandro Scotti. +It is been further developed, and is maintained, by H.G. Muller. +Most addtions and improvements that went into this since the last version produced +by the GNU-Savannah xboard project team, WinBoard 4.2.7b, +are unfortunately not parallelled in xboard. +On the contrary, they have destroyed the compatibility of the back-end sources +shared by WinBoard and xboard with the xboard front-end of version 4.2.7b. +Since WinBoard 4.3.14, however, the releases again coms with a compatible xboard front-end. +That does not mean that all the features added to WinBoard can already be used +in this xboard version. +But some can, an in 4.3.15 many more have been added. +

    +The description below applies specifically to WinBoard, +although we have tried to mark features that can also be used in xboard by (x) everywhere. +This version of xboard does does have som new menus added to control such features. +Other functionss, if they work at all, must be switched on from the command line. +

    +
    + + +
    +

    New features since 4.2.7b

    +

    +Below follows a table that lists the new features, +the command-line option needed to control them, +and if there is a menu provided that can switch the option while WinBoard is running +(command-line options exert their effect only at startup). +Note that, unlike WinBoard 4.2.7, the WinBoard 4.3 series is fully castling and e.p. aware, +and handles the castling, e.p. and 50-move field in FENs on input and output as should be expected. +

    +
    +

    command-line option

    +
    +

    description

    +
    +

    menu

    +
    + + + ENGINE-ENGINE ADJUDICATION OPTIONS + + +
    + -adjudicateLossThreshold 0 (*x) + + adjudicates engine-engine game based on score + + Options -> Engine... (x) +
    + -checkMates false (*x) + + detect and end game on checkmates and stalemates + + Options -> Engine... (x) +
    + -testClaims false (*x) + + WinBoard corrects false RESULT claims + + Options -> Engine.. (x) +
    + -materialDraws false (*x) + + adjudicate draw when no mating material present + + Options -> Engine.. (x) +
    + -trivialDraws false (*x) + + adjudicate draw in endgames like KRKR and KNNK + + Options -> Engine.. (x) +
    + -adjudicateDrawMoves 0 (*) + + adjudicate draw when game lasts too long + + Options -> Engine.. (x) +
    + -ruleMoves 51 (*x) + + number of reversible moves after which to adjudicate draw + + Options -> Engine.. (x) +
    + -repeatsToDraw 6 (*x) + + adjudicate draw when a position occurs this many times + + Options -> Engine.. (x) +
    + -firstScoreAbs false (x) +
    + -secondScoreAbs false (x) +
    + Engine indicates score for white, even when playing black + + Options -> Adjudications.. (xboard-only) +
    + - + + Adjudicate the game in progress as win to white, win to black, or draw + + Action -> Adjudicate to White +
    + Action -> Adjudicate to Black +
    + Action -> Adjudicate Draw +
    + + + TIME-CONTROL AND TIMING OPTIONS + + +
    + -firstTimeOdds 1 (x) +
    + -secondTimeOdds 1 (x) +
    + reduce the thinking time of the mentioned engine by the given factor + + Options -> Engine Settings.. (xboard only) +
    + -timeOddsMode 1 (*x) + + determines what happens when both engine have time odds + + Options -> Engine Settings.. (xboard only) +
    + -firstNPS -1 (x) +
    + -secondNPS -1 (x) +
    + engine must use node count for its time control, as if running at specified rate + + - +
    + -matchPause 10000 (*x) + + number of msec to wait between games in match mode + + - +
    + -delayBeforeQuit 0 (*) +
    + -delayAfterQuit 0 (*) +
    + timing parameter specifying how to terminate the engine processes + + - +
    + - + + adjust the clocks by 1 minute (up or down) + + left- or right-cick on clock in edit-game mode +
    + + + DISPLAY-LOOK OPTIONS + + +
    + -liteBackTextureFile "" (*) +
    + -darkBackTextureFile "" (*) +
    + -liteBackTextureMode 1 (*) +
    + -darkBackTextureMode 1 (*) +
    + Allows you to use any bitmap picture for displaying the board square + + - +
    + -renderPiecesWithFont "" (*) + + specifies a true-type Chess font to be used for piece symbols + + - +
    + -fontPieceToCharTable "" (*) + + specifies which font character to use for the various piece types + + - +
    + -overrideLineGap 1 (*) + + controls the width of the black grid lines between squares + + - +
    + -fontPieceBackColorWhite #0 (*) +
    + -fontPieceForeColorWhite #0 (*) +
    + -fontPieceBackColorBlack #0 (*) +
    + -fontPieceForeColorBlack #0 (*) +
    + control piece colors in font-based rendering + + - +
    + -fontPieceSize 80 (*) + + tunes the size of pieces in font-based rendering (% of square size) + + - +
    + -highlightMoveWithArrow false (*) + + draws a big arrow to indicate the move last played + + Options -> General... +
    + -highlightArrowColor #FFFF80 (*) + + controls the color of the highlight arrow + + - +
    + - + + Swap white and black clock + + Options -> Swap Clocks +
    + + + UCI ENGINE OPTIONS + + +
    + -polyglotDir "" (*) + + tells WinBoard where you installed Polyglot, for automatic invocation with UCI engines + + Options -> UCI... (x) +
    + -polyglotBook "" (*) + + tells WinBoard which opening book it should use, or should make Polyglot use. + + Options -> UCI... (x) +
    + -usePolyglotBook false (*) + + turns the use of the Polygot book on or off + + Options -> UCI... (x) +
    + -defaultPathEGTB "c:\egtb" (*) + + folder where to find end-game tables + + Options -> UCI... (x) +
    + -defaultCacheSizeEGTB 4 (*) + + specifies the cache size for UCI engines + + Options -> UCI... (x) +
    + -defaultHashSize 64 (*) + + Specifies the size of the main hash table for UCI engines + + Options -> UCI... (x) +
    + -firstIsUCI false +
    + -secondIsUCI false +
    + -fUCI +
    + -sUCI +
    + tells WinBoard the corresponding engine should be run through Polyglot + + - +
    + -firstHasOwnBookUCI true +
    + -secondHasOwnBookUCI true +
    + -fNoOwnBookUCI true +
    + -sNoOwnBookUCI true +
    + tells Polyglot if the engine should use its own opening book + + Options -> Engine Settings... (xboard only) +
    + -smpCores 1 (*x) + + Sets the maximum number of CPUs an SMP engine can use. + (only affects engines that support the cores command of WB protocol) + + Options -> Engine Settings... (xboard only) +
    + -egtFormats "" (*x) + + Specifies which end-game tables are installed on the computer, + and where they can be found + (e.g. "nalimov:\chess\egtb,scorpio:\chess\bitbases") + + - +
    + + + CHESS-VARIANT OPTIONS + + +
    + -boardHeight -1 (*x) +
    + -boardWidth -1 (*x) +
    + -holdingsSize -1 (*x) +
    + specifies the board format and nr of piece types that can be dropped, + when you want it to be different from what is usual in the chosen varint + + File -> New Variant... +
    + -variant normal (x) + + supports many new variants: xiangqi, shogi, fischerandom, capabanca, gothic, caparandom, janus, + shatranj, courier, knightmate, berolina, falcon, cylinder, fairy, super + + File -> New Variant... (x) +
    + -defaultFrcOpening -1 (x) + + allows you to play from a specific opening shuffle, or make a new shuffle each game + + File -> New Shuffle Game... (x) +
    + -pieceToCharTable "" (x) + + allows you to specify by which letters pieces are referred to in FEN and SAN, + if you want to deviate from what is usual for the current variant + + - +
    + -flipBlack fase (*x) + + displays opponent pieces uppside down (for Shogi) + + Options -> Board... +
    + -allWhite false (*x) + + use white bitmaps (with black outline) also for display of black pieces (for Shogi) + + Options -> Board... +
    + + + PGN FILE OPTIONS + + +
    + -pgnExtendedInfo false (*x) + + save engine output (depth, score time) in PGN + + Options->General... +
    + -pgnEventHeader
    "Computer Chess Game" (*x) +
    + specify the event for the PGN event tag + + - +
    + -saveOutOfBookInfo true (*) + + include an 'annotator' tag in the PGN file + + +
    + -hideThinkingFromHuman false (*x) + + suppresses the engine thinking output in the display, without the need to switch it off + (so it can still appear in the PGN file) + + Options -> General... (x) +
    + + + USER-INTERFACE OPTIONS AND WINDOW CONTROL + + +
    + -moveHistoryUP true (*) +
    + -moveHistoryX 0 (*) +
    + -moveHistoryY 0 (*) +
    + -moveHistoryW 0 (*) +
    + -moveHistoryH 0 (*) +
    + controls opening, placement and size of a window containing the moves of the current game + + Mode -> Show Move History (x) +
    + -evalGraphUp true (*) +
    + -evalGraphX 0 (*) +
    + -evalGraphY 0 (*) +
    + -evalGraphW 0 (*) +
    + -evalGraphH 0 (*) +
    + controls opening, placement and size of a window containing a graph of the + evaluation score of the engine(s) as a function of move number of the current game + + Mode -> Show Evaluation Graph +
    + -engineOutputUp true (*) +
    + -engineOutputX 0 (*) +
    + -engineOutputY 0 (*) +
    + -engineOutputW 0 (*) +
    + -engineOutputH 0 (*) +
    + controls opening, placement and size of a window containing the thinking output of the engine(s) + + Mode -> Show Engine Output (x) +
    + -stickyWindows true (*) + + make the various windows snap onto each other, and stick together + + - +
    + -showEvalInMoveHistory true (*) + + depth/score info of the engine is included as comments in the move history window + + Options -> General... +
    + -evalHistColorWhite #FFFFB0 (*) +
    + -evalHistColorBlack #AD5D3D (*) +
    + determines the color of the eval-score comments in the move-history window + + - +
    + -autoDisplayComment true (*) + + causes a window for displaying PGN comments to pop up automatically when such a comment is encountered + + - +
    + -autoDisplayTags true (*) + + causes a window with PGN tags to be displayed as soon as a PGN file is loaded + + - +
    + -gameListTags "eprd" (*) + + specifies the PGN tags that should be displayed in the game list + + Options -> Game List... +
    + + + MISCELLANEOUS + + +
    + -debugFile "winboard.debug" +
    + -nameOfDebugFile "winboard.debug" +
    + allows you to specify an alternative name for saving the debug information + + - +
    + - + + save chess-board display as diagram in bitmap file + (only works for the smaller board formats!) + + File -> Save Diagram... +
    + - + + display only those lines in the game list that contain a given string + + in Game-List window +
    + -rewindFile 0 (x) + + A nonzero value for this option causes the loadGameIndex or loadPositionIndex + to rewind to the beginning of the Games or Position file when it reaches + the given value in auto-increment match mode. + This mode is specified by a negative value as argument of the /lgi or /lpi options, + where -1 increments the index after every game of the match, + and -2 after every two games (so that each position is played with black and white). + + - +
    +

    +The value with which the option is listed is the default value. +If it is false or true, it is a Boolean option, a number implies an integer option. +A value starting with # indicates an RGB color indication in hexadecimal notation. +Options the settings of which are saved into the winboard.ini file are marked with (*). +

    + diff --git a/mkinstalldirs b/mkinstalldirs old mode 100755 new mode 100644 diff --git a/moves.c b/moves.c index edccef8..0def075 100644 --- a/moves.c +++ b/moves.c @@ -117,89 +117,26 @@ ChessSquare PromoPiece(moveType) return WhiteKing; case BlackPromotionKing: return BlackKing; -#ifdef FAIRY case WhitePromotionChancellor: return WhiteMarshall; case BlackPromotionChancellor: return BlackMarshall; case WhitePromotionArchbishop: - return WhiteCardinal; + return WhiteAngel; case BlackPromotionArchbishop: - return BlackCardinal; -#endif - } -} - -ChessMove PromoCharToMoveType(whiteOnMove, promoChar) - int whiteOnMove; - int promoChar; -{ - if (whiteOnMove) { - switch (promoChar) { - case 'n': - case 'N': - return WhitePromotionKnight; - case 'b': - case 'B': - return WhitePromotionBishop; - case 'r': - case 'R': - return WhitePromotionRook; -#ifdef FAIRY - case 'a': - case 'A': - return WhitePromotionArchbishop; - case 'c': - case 'C': - return WhitePromotionChancellor; -#endif - case 'q': - case 'Q': - return WhitePromotionQueen; - case 'k': - case 'K': - return WhitePromotionKing; - case NULLCHAR: - default: - return NormalMove; - } - } else { - switch (promoChar) { - case 'n': - case 'N': - return BlackPromotionKnight; - case 'b': - case 'B': - return BlackPromotionBishop; - case 'r': - case 'R': - return BlackPromotionRook; -#ifdef FAIRY - case 'a': - case 'A': - return BlackPromotionArchbishop; - case 'c': - case 'C': - return BlackPromotionChancellor; -#endif - case 'q': - case 'Q': - return BlackPromotionQueen; - case 'k': - case 'K': - return BlackPromotionKing; - case NULLCHAR: - default: - return NormalMove; - } + return BlackAngel; + case WhitePromotionCentaur: + return WhiteSilver; + case BlackPromotionCentaur: + return BlackSilver; } } char pieceToChar[] = { 'P', 'N', 'B', 'R', 'Q', 'F', 'E', 'A', 'C', 'W', 'M', - 'O', 'H', 'I', 'J', 'G', 'D', 'V', 'S', 'L', 'U', 'K', + 'O', 'H', 'I', 'J', 'G', 'D', 'V', 'L', 's', 'U', 'K', 'p', 'n', 'b', 'r', 'q', 'f', 'e', 'a', 'c', 'w', 'm', - 'o', 'h', 'i', 'j', 'g', 'd', 'v', 's', 'l', 'u', 'k', + 'o', 'h', 'i', 'j', 'g', 'd', 'v', 'l', 's', 'u', 'k', 'x' }; char PieceToChar(p) @@ -228,6 +165,51 @@ ChessSquare CharToPiece(c) return EmptySquare; } +ChessMove PromoCharToMoveType(whiteOnMove, promoChar) + int whiteOnMove; + int promoChar; +{ /* [HGM] made dependent on CharToPiece to alow alternate piece letters */ + ChessSquare piece = CharToPiece(whiteOnMove ? ToUpper(promoChar) : ToLower(promoChar) ); + + switch(piece) { + case WhiteQueen: + return WhitePromotionQueen; + case WhiteRook: + return WhitePromotionRook; + case WhiteBishop: + return WhitePromotionBishop; + case WhiteKnight: + return WhitePromotionKnight; + case WhiteKing: + return WhitePromotionKing; + case WhiteAngel: + return WhitePromotionArchbishop; + case WhiteMarshall: + return WhitePromotionChancellor; + case WhiteSilver: + return WhitePromotionCentaur; + case BlackQueen: + return BlackPromotionQueen; + case BlackRook: + return BlackPromotionRook; + case BlackBishop: + return BlackPromotionBishop; + case BlackKnight: + return BlackPromotionKnight; + case BlackKing: + return BlackPromotionKing; + case BlackAngel: + return BlackPromotionArchbishop; + case BlackMarshall: + return BlackPromotionChancellor; + case BlackSilver: + return BlackPromotionCentaur; + default: + // not all promotion implemented yet! Take Queen for those we don't know. + return (whiteOnMove ? WhitePromotionQueen : BlackPromotionQueen); + } +} + void CopyBoard(to, from) Board to, from; { @@ -650,6 +632,9 @@ void GenPseudoLegal(board, flags, epfile, callback, closure) } break; + case WhiteSilver: + case BlackSilver: + m++; // [HGM] superchess: use for Centaur case WhiteMan: case BlackMan: case SHOGI WhiteKing: @@ -667,6 +652,7 @@ void GenPseudoLegal(board, flags, epfile, callback, closure) callback(board, flags, NormalMove, rf, ff, rt, ft, closure); } + if(m==1) goto mounted; break; case WhiteNightrider: @@ -1557,8 +1543,6 @@ ChessMove CoordsToAlgebraic(board, flags, epfile, /* [HGM] Always long notation for fairies we don't know */ case WhiteFalcon: case BlackFalcon: - case WhiteSilver: - case BlackSilver: case WhiteLance: case BlackLance: case WhiteGrasshopper: diff --git a/moves.h b/moves.h index 569fc89..d48b9f2 100644 --- a/moves.h +++ b/moves.h @@ -1,160 +1,162 @@ -/* - * moves.h - Move generation and checking - * $Id: moves.h,v 2.1 2003/10/27 19:21:00 mann Exp $ - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-95 Free Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - */ - -extern ChessSquare PromoPiece P((ChessMove moveType)); -extern ChessMove PromoCharToMoveType P((int whiteOnMove, int promoChar)); -extern char PieceToChar P((ChessSquare p)); -extern ChessSquare CharToPiece P((int c)); -extern int PieceToNumber P((ChessSquare p)); - -extern void CopyBoard P((Board to, Board from)); -extern int CompareBoards P((Board board1, Board board2)); -extern char pieceToChar[(int)EmptySquare+1]; - -typedef void (*MoveCallback) P((Board board, int flags, ChessMove kind, - int rf, int ff, int rt, int ft, - VOIDSTAR closure)); - -/* Values for flags arguments */ -#define F_WHITE_ON_MOVE 1 -#define F_WHITE_KCASTLE_OK 2 -#define F_WHITE_QCASTLE_OK 4 -#define F_BLACK_KCASTLE_OK 8 -#define F_BLACK_QCASTLE_OK 16 -#define F_ALL_CASTLE_OK (F_WHITE_KCASTLE_OK | F_WHITE_QCASTLE_OK | \ - F_BLACK_KCASTLE_OK | F_BLACK_QCASTLE_OK) -#define F_IGNORE_CHECK 32 -#define F_KRIEGSPIEL_CAPTURE 64 /* pawns can try to capture invisible pieces */ -#define F_ATOMIC_CAPTURE 128 /* capturing piece explodes, destroying itself - and all non-pawns on adjacent squares; - destroying your own king is illegal */ -#define F_FRC_TYPE_CASTLING 256 /* generate castlings as captures of own Rook */ - -/* Special epfile values. [HGM] positive values are non-reversible moves! */ -#define EP_NONE (-4) /* [HGM] Tricky! order matters: */ -#define EP_UNKNOWN (-1) /* >= EP_UNKNOWN spils rep-draw */ -#define EP_CAPTURE (-2) /* <= EP_NONE is reversible move */ -#define EP_PAWN_MOVE (-3) -#define EP_REP_DRAW (-15) -#define EP_RULE_DRAW (-14) -#define EP_INSUF_DRAW (-13) -#define EP_DRAWS (-10) -#define EP_BEROLIN_A 16 /* [HGM] berolina: add to file if pawn to be taken of a-side of e.p.file */ - -/* Call callback once for each pseudo-legal move in the given - position, except castling moves. A move is pseudo-legal if it is - legal, or if it would be legal except that it leaves the king in - check. In the arguments, epfile is EP_NONE if the previous move - was not a double pawn push, or the file 0..7 if it was, or - EP_UNKNOWN if we don't know and want to allow all e.p. captures. - Promotion moves generated are to Queen only. -*/ -extern void GenPseudoLegal P((Board board, int flags, int epfile, - MoveCallback callback, VOIDSTAR closure)); - -/* Like GenPseudoLegal, but include castling moves and (unless - F_IGNORE_CHECK is set in the flags) omit moves that would leave the - king in check. The CASTLE_OK flags are true if castling is not yet - ruled out by a move of the king or rook. Return TRUE if the player - on move is currently in check and F_IGNORE_CHECK is not set. -*/ -extern int GenLegal P((Board board, int flags, int epfile, - char castlingRights[], /* [HGM] */ - MoveCallback callback, VOIDSTAR closure)); - -/* If the player on move were to move from (rf, ff) to (rt, ft), would - he leave himself in check? Or if rf == -1, is the player on move - in check now? enPassant must be TRUE if the indicated move is an - e.p. capture. The possibility of castling out of a check along the - back rank is not accounted for (i.e., we still return nonzero), as - this is illegal anyway. Return value is the number of times the - king is in check. */ -extern int CheckTest P((Board board, int flags, - int rf, int ff, int rt, int ft, int enPassant)); - -/* Is a move from (rf, ff) to (rt, ft) legal for the player whom the - flags say is on move? Other arguments as in GenPseudoLegal. - Returns the type of move made, taking promoChar into account. */ -extern ChessMove LegalityTest P((Board board, int flags, int epfile, - char castlingRights[], /* [HGM] */ - int rf, int ff, int rt, int ft, - int promoChar)); - -#define MT_NONE 0 -#define MT_CHECK 1 -#define MT_CHECKMATE 2 -#define MT_STALEMATE 3 - -/* Return MT_NONE, MT_CHECK, MT_CHECKMATE, or MT_STALEMATE */ -extern int MateTest P((Board board, int flags, int epfile, - char castlingRights[])); /* [HGM] */ - -typedef struct { - /* Input data */ - ChessSquare pieceIn; /* EmptySquare if unknown */ - int rfIn, ffIn, rtIn, ftIn; /* -1 if unknown */ - int promoCharIn; /* NULLCHAR if unknown */ - /* Output data for matched move */ - ChessMove kind; - ChessSquare piece; - int rf, ff, rt, ft; - int promoChar; /* 'q' if a promotion and promoCharIn was NULLCHAR */ - int count; /* Number of possibilities found */ -} DisambiguateClosure; - -/* Disambiguate a partially-known move */ -void Disambiguate P((Board board, int flags, int epfile, - DisambiguateClosure *closure)); - - -/* Convert coordinates to normal algebraic notation. - promoChar must be NULLCHAR or '.' if not a promotion. -*/ -ChessMove CoordsToAlgebraic P((Board board, int flags, int epfile, - int rf, int ff, int rt, int ft, - int promoChar, char out[MOVE_LEN])); +/* + * moves.h - Move generation and checking + * $Id: moves.h,v 2.1 2003/10/27 19:21:00 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-95 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + +extern ChessSquare PromoPiece P((ChessMove moveType)); +extern ChessMove PromoCharToMoveType P((int whiteOnMove, int promoChar)); +extern char PieceToChar P((ChessSquare p)); +extern ChessSquare CharToPiece P((int c)); +extern int PieceToNumber P((ChessSquare p)); + +extern void CopyBoard P((Board to, Board from)); +extern int CompareBoards P((Board board1, Board board2)); +extern char pieceToChar[(int)EmptySquare+1]; + +typedef void (*MoveCallback) P((Board board, int flags, ChessMove kind, + int rf, int ff, int rt, int ft, + VOIDSTAR closure)); + +/* Values for flags arguments */ +#define F_WHITE_ON_MOVE 1 +#define F_WHITE_KCASTLE_OK 2 +#define F_WHITE_QCASTLE_OK 4 +#define F_BLACK_KCASTLE_OK 8 +#define F_BLACK_QCASTLE_OK 16 +#define F_ALL_CASTLE_OK (F_WHITE_KCASTLE_OK | F_WHITE_QCASTLE_OK | \ + F_BLACK_KCASTLE_OK | F_BLACK_QCASTLE_OK) +#define F_IGNORE_CHECK 32 +#define F_KRIEGSPIEL_CAPTURE 64 /* pawns can try to capture invisible pieces */ +#define F_ATOMIC_CAPTURE 128 /* capturing piece explodes, destroying itself + and all non-pawns on adjacent squares; + destroying your own king is illegal */ +#define F_FRC_TYPE_CASTLING 256 /* generate castlings as captures of own Rook */ + +/* Special epfile values. [HGM] positive values are non-reversible moves! */ +#define EP_NONE (-4) /* [HGM] Tricky! order matters: */ +#define EP_UNKNOWN (-1) /* >= EP_UNKNOWN spils rep-draw */ +#define EP_CAPTURE (-2) /* <= EP_NONE is reversible move */ +#define EP_PAWN_MOVE (-3) +#define EP_REP_DRAW (-15) +#define EP_RULE_DRAW (-14) +#define EP_INSUF_DRAW (-13) +#define EP_DRAWS (-10) +#define EP_BEROLIN_A 16 /* [HGM] berolina: add to file if pawn to be taken of a-side of e.p.file */ +#define EP_CHECKMATE 100 /* [HGM] verify: record mates in epStatus for easy claim verification */ +#define EP_STALEMATE -16 + +/* Call callback once for each pseudo-legal move in the given + position, except castling moves. A move is pseudo-legal if it is + legal, or if it would be legal except that it leaves the king in + check. In the arguments, epfile is EP_NONE if the previous move + was not a double pawn push, or the file 0..7 if it was, or + EP_UNKNOWN if we don't know and want to allow all e.p. captures. + Promotion moves generated are to Queen only. +*/ +extern void GenPseudoLegal P((Board board, int flags, int epfile, + MoveCallback callback, VOIDSTAR closure)); + +/* Like GenPseudoLegal, but include castling moves and (unless + F_IGNORE_CHECK is set in the flags) omit moves that would leave the + king in check. The CASTLE_OK flags are true if castling is not yet + ruled out by a move of the king or rook. Return TRUE if the player + on move is currently in check and F_IGNORE_CHECK is not set. +*/ +extern int GenLegal P((Board board, int flags, int epfile, + char castlingRights[], /* [HGM] */ + MoveCallback callback, VOIDSTAR closure)); + +/* If the player on move were to move from (rf, ff) to (rt, ft), would + he leave himself in check? Or if rf == -1, is the player on move + in check now? enPassant must be TRUE if the indicated move is an + e.p. capture. The possibility of castling out of a check along the + back rank is not accounted for (i.e., we still return nonzero), as + this is illegal anyway. Return value is the number of times the + king is in check. */ +extern int CheckTest P((Board board, int flags, + int rf, int ff, int rt, int ft, int enPassant)); + +/* Is a move from (rf, ff) to (rt, ft) legal for the player whom the + flags say is on move? Other arguments as in GenPseudoLegal. + Returns the type of move made, taking promoChar into account. */ +extern ChessMove LegalityTest P((Board board, int flags, int epfile, + char castlingRights[], /* [HGM] */ + int rf, int ff, int rt, int ft, + int promoChar)); + +#define MT_NONE 0 +#define MT_CHECK 1 +#define MT_CHECKMATE 2 +#define MT_STALEMATE 3 + +/* Return MT_NONE, MT_CHECK, MT_CHECKMATE, or MT_STALEMATE */ +extern int MateTest P((Board board, int flags, int epfile, + char castlingRights[])); /* [HGM] */ + +typedef struct { + /* Input data */ + ChessSquare pieceIn; /* EmptySquare if unknown */ + int rfIn, ffIn, rtIn, ftIn; /* -1 if unknown */ + int promoCharIn; /* NULLCHAR if unknown */ + /* Output data for matched move */ + ChessMove kind; + ChessSquare piece; + int rf, ff, rt, ft; + int promoChar; /* 'q' if a promotion and promoCharIn was NULLCHAR */ + int count; /* Number of possibilities found */ +} DisambiguateClosure; + +/* Disambiguate a partially-known move */ +void Disambiguate P((Board board, int flags, int epfile, + DisambiguateClosure *closure)); + + +/* Convert coordinates to normal algebraic notation. + promoChar must be NULLCHAR or '.' if not a promotion. +*/ +ChessMove CoordsToAlgebraic P((Board board, int flags, int epfile, + int rf, int ff, int rt, int ft, + int promoChar, char out[MOVE_LEN])); diff --git a/pg_key.c b/pg_key.c new file mode 100644 index 0000000..6d946bc --- /dev/null +++ b/pg_key.c @@ -0,0 +1,340 @@ + +/* + * This little proof of concept utility for educational purposes + * computes the Polyglot key of a fen. + * + * Usage: + * pg_key "" + * + * + * For brevity this code does ZERO error checking and will + * unceremoniously segfault in case of an illegal fen. + * + * + * This code is released in the public domain by Michel Van den Bergh. + * The array Random64 is taken from the Polyglot source code. + * I am pretty sure that a table of random numbers is never protected + * by copyright. + * + */ + + +#include +#include + +#ifdef _MSC_VER + typedef unsigned __int64 uint64; +#else + typedef unsigned long long int uint64; +#endif + + +#ifdef _MSC_VER +# define U64(u) (u##ui64) +#else +# define U64(u) (u##ULL) +#endif + +uint64 Random64[781] = { + U64(0x9D39247E33776D41), U64(0x2AF7398005AAA5C7), U64(0x44DB015024623547), U64(0x9C15F73E62A76AE2), + U64(0x75834465489C0C89), U64(0x3290AC3A203001BF), U64(0x0FBBAD1F61042279), U64(0xE83A908FF2FB60CA), + U64(0x0D7E765D58755C10), U64(0x1A083822CEAFE02D), U64(0x9605D5F0E25EC3B0), U64(0xD021FF5CD13A2ED5), + U64(0x40BDF15D4A672E32), U64(0x011355146FD56395), U64(0x5DB4832046F3D9E5), U64(0x239F8B2D7FF719CC), + U64(0x05D1A1AE85B49AA1), U64(0x679F848F6E8FC971), U64(0x7449BBFF801FED0B), U64(0x7D11CDB1C3B7ADF0), + U64(0x82C7709E781EB7CC), U64(0xF3218F1C9510786C), U64(0x331478F3AF51BBE6), U64(0x4BB38DE5E7219443), + U64(0xAA649C6EBCFD50FC), U64(0x8DBD98A352AFD40B), U64(0x87D2074B81D79217), U64(0x19F3C751D3E92AE1), + U64(0xB4AB30F062B19ABF), U64(0x7B0500AC42047AC4), U64(0xC9452CA81A09D85D), U64(0x24AA6C514DA27500), + U64(0x4C9F34427501B447), U64(0x14A68FD73C910841), U64(0xA71B9B83461CBD93), U64(0x03488B95B0F1850F), + U64(0x637B2B34FF93C040), U64(0x09D1BC9A3DD90A94), U64(0x3575668334A1DD3B), U64(0x735E2B97A4C45A23), + U64(0x18727070F1BD400B), U64(0x1FCBACD259BF02E7), U64(0xD310A7C2CE9B6555), U64(0xBF983FE0FE5D8244), + U64(0x9F74D14F7454A824), U64(0x51EBDC4AB9BA3035), U64(0x5C82C505DB9AB0FA), U64(0xFCF7FE8A3430B241), + U64(0x3253A729B9BA3DDE), U64(0x8C74C368081B3075), U64(0xB9BC6C87167C33E7), U64(0x7EF48F2B83024E20), + U64(0x11D505D4C351BD7F), U64(0x6568FCA92C76A243), U64(0x4DE0B0F40F32A7B8), U64(0x96D693460CC37E5D), + U64(0x42E240CB63689F2F), U64(0x6D2BDCDAE2919661), U64(0x42880B0236E4D951), U64(0x5F0F4A5898171BB6), + U64(0x39F890F579F92F88), U64(0x93C5B5F47356388B), U64(0x63DC359D8D231B78), U64(0xEC16CA8AEA98AD76), + U64(0x5355F900C2A82DC7), U64(0x07FB9F855A997142), U64(0x5093417AA8A7ED5E), U64(0x7BCBC38DA25A7F3C), + U64(0x19FC8A768CF4B6D4), U64(0x637A7780DECFC0D9), U64(0x8249A47AEE0E41F7), U64(0x79AD695501E7D1E8), + U64(0x14ACBAF4777D5776), U64(0xF145B6BECCDEA195), U64(0xDABF2AC8201752FC), U64(0x24C3C94DF9C8D3F6), + U64(0xBB6E2924F03912EA), U64(0x0CE26C0B95C980D9), U64(0xA49CD132BFBF7CC4), U64(0xE99D662AF4243939), + U64(0x27E6AD7891165C3F), U64(0x8535F040B9744FF1), U64(0x54B3F4FA5F40D873), U64(0x72B12C32127FED2B), + U64(0xEE954D3C7B411F47), U64(0x9A85AC909A24EAA1), U64(0x70AC4CD9F04F21F5), U64(0xF9B89D3E99A075C2), + U64(0x87B3E2B2B5C907B1), U64(0xA366E5B8C54F48B8), U64(0xAE4A9346CC3F7CF2), U64(0x1920C04D47267BBD), + U64(0x87BF02C6B49E2AE9), U64(0x092237AC237F3859), U64(0xFF07F64EF8ED14D0), U64(0x8DE8DCA9F03CC54E), + U64(0x9C1633264DB49C89), U64(0xB3F22C3D0B0B38ED), U64(0x390E5FB44D01144B), U64(0x5BFEA5B4712768E9), + U64(0x1E1032911FA78984), U64(0x9A74ACB964E78CB3), U64(0x4F80F7A035DAFB04), U64(0x6304D09A0B3738C4), + U64(0x2171E64683023A08), U64(0x5B9B63EB9CEFF80C), U64(0x506AACF489889342), U64(0x1881AFC9A3A701D6), + U64(0x6503080440750644), U64(0xDFD395339CDBF4A7), U64(0xEF927DBCF00C20F2), U64(0x7B32F7D1E03680EC), + U64(0xB9FD7620E7316243), U64(0x05A7E8A57DB91B77), U64(0xB5889C6E15630A75), U64(0x4A750A09CE9573F7), + U64(0xCF464CEC899A2F8A), U64(0xF538639CE705B824), U64(0x3C79A0FF5580EF7F), U64(0xEDE6C87F8477609D), + U64(0x799E81F05BC93F31), U64(0x86536B8CF3428A8C), U64(0x97D7374C60087B73), U64(0xA246637CFF328532), + U64(0x043FCAE60CC0EBA0), U64(0x920E449535DD359E), U64(0x70EB093B15B290CC), U64(0x73A1921916591CBD), + U64(0x56436C9FE1A1AA8D), U64(0xEFAC4B70633B8F81), U64(0xBB215798D45DF7AF), U64(0x45F20042F24F1768), + U64(0x930F80F4E8EB7462), U64(0xFF6712FFCFD75EA1), U64(0xAE623FD67468AA70), U64(0xDD2C5BC84BC8D8FC), + U64(0x7EED120D54CF2DD9), U64(0x22FE545401165F1C), U64(0xC91800E98FB99929), U64(0x808BD68E6AC10365), + U64(0xDEC468145B7605F6), U64(0x1BEDE3A3AEF53302), U64(0x43539603D6C55602), U64(0xAA969B5C691CCB7A), + U64(0xA87832D392EFEE56), U64(0x65942C7B3C7E11AE), U64(0xDED2D633CAD004F6), U64(0x21F08570F420E565), + U64(0xB415938D7DA94E3C), U64(0x91B859E59ECB6350), U64(0x10CFF333E0ED804A), U64(0x28AED140BE0BB7DD), + U64(0xC5CC1D89724FA456), U64(0x5648F680F11A2741), U64(0x2D255069F0B7DAB3), U64(0x9BC5A38EF729ABD4), + U64(0xEF2F054308F6A2BC), U64(0xAF2042F5CC5C2858), U64(0x480412BAB7F5BE2A), U64(0xAEF3AF4A563DFE43), + U64(0x19AFE59AE451497F), U64(0x52593803DFF1E840), U64(0xF4F076E65F2CE6F0), U64(0x11379625747D5AF3), + U64(0xBCE5D2248682C115), U64(0x9DA4243DE836994F), U64(0x066F70B33FE09017), U64(0x4DC4DE189B671A1C), + U64(0x51039AB7712457C3), U64(0xC07A3F80C31FB4B4), U64(0xB46EE9C5E64A6E7C), U64(0xB3819A42ABE61C87), + U64(0x21A007933A522A20), U64(0x2DF16F761598AA4F), U64(0x763C4A1371B368FD), U64(0xF793C46702E086A0), + U64(0xD7288E012AEB8D31), U64(0xDE336A2A4BC1C44B), U64(0x0BF692B38D079F23), U64(0x2C604A7A177326B3), + U64(0x4850E73E03EB6064), U64(0xCFC447F1E53C8E1B), U64(0xB05CA3F564268D99), U64(0x9AE182C8BC9474E8), + U64(0xA4FC4BD4FC5558CA), U64(0xE755178D58FC4E76), U64(0x69B97DB1A4C03DFE), U64(0xF9B5B7C4ACC67C96), + U64(0xFC6A82D64B8655FB), U64(0x9C684CB6C4D24417), U64(0x8EC97D2917456ED0), U64(0x6703DF9D2924E97E), + U64(0xC547F57E42A7444E), U64(0x78E37644E7CAD29E), U64(0xFE9A44E9362F05FA), U64(0x08BD35CC38336615), + U64(0x9315E5EB3A129ACE), U64(0x94061B871E04DF75), U64(0xDF1D9F9D784BA010), U64(0x3BBA57B68871B59D), + U64(0xD2B7ADEEDED1F73F), U64(0xF7A255D83BC373F8), U64(0xD7F4F2448C0CEB81), U64(0xD95BE88CD210FFA7), + U64(0x336F52F8FF4728E7), U64(0xA74049DAC312AC71), U64(0xA2F61BB6E437FDB5), U64(0x4F2A5CB07F6A35B3), + U64(0x87D380BDA5BF7859), U64(0x16B9F7E06C453A21), U64(0x7BA2484C8A0FD54E), U64(0xF3A678CAD9A2E38C), + U64(0x39B0BF7DDE437BA2), U64(0xFCAF55C1BF8A4424), U64(0x18FCF680573FA594), U64(0x4C0563B89F495AC3), + U64(0x40E087931A00930D), U64(0x8CFFA9412EB642C1), U64(0x68CA39053261169F), U64(0x7A1EE967D27579E2), + U64(0x9D1D60E5076F5B6F), U64(0x3810E399B6F65BA2), U64(0x32095B6D4AB5F9B1), U64(0x35CAB62109DD038A), + U64(0xA90B24499FCFAFB1), U64(0x77A225A07CC2C6BD), U64(0x513E5E634C70E331), U64(0x4361C0CA3F692F12), + U64(0xD941ACA44B20A45B), U64(0x528F7C8602C5807B), U64(0x52AB92BEB9613989), U64(0x9D1DFA2EFC557F73), + U64(0x722FF175F572C348), U64(0x1D1260A51107FE97), U64(0x7A249A57EC0C9BA2), U64(0x04208FE9E8F7F2D6), + U64(0x5A110C6058B920A0), U64(0x0CD9A497658A5698), U64(0x56FD23C8F9715A4C), U64(0x284C847B9D887AAE), + U64(0x04FEABFBBDB619CB), U64(0x742E1E651C60BA83), U64(0x9A9632E65904AD3C), U64(0x881B82A13B51B9E2), + U64(0x506E6744CD974924), U64(0xB0183DB56FFC6A79), U64(0x0ED9B915C66ED37E), U64(0x5E11E86D5873D484), + U64(0xF678647E3519AC6E), U64(0x1B85D488D0F20CC5), U64(0xDAB9FE6525D89021), U64(0x0D151D86ADB73615), + U64(0xA865A54EDCC0F019), U64(0x93C42566AEF98FFB), U64(0x99E7AFEABE000731), U64(0x48CBFF086DDF285A), + U64(0x7F9B6AF1EBF78BAF), U64(0x58627E1A149BBA21), U64(0x2CD16E2ABD791E33), U64(0xD363EFF5F0977996), + U64(0x0CE2A38C344A6EED), U64(0x1A804AADB9CFA741), U64(0x907F30421D78C5DE), U64(0x501F65EDB3034D07), + U64(0x37624AE5A48FA6E9), U64(0x957BAF61700CFF4E), U64(0x3A6C27934E31188A), U64(0xD49503536ABCA345), + U64(0x088E049589C432E0), U64(0xF943AEE7FEBF21B8), U64(0x6C3B8E3E336139D3), U64(0x364F6FFA464EE52E), + U64(0xD60F6DCEDC314222), U64(0x56963B0DCA418FC0), U64(0x16F50EDF91E513AF), U64(0xEF1955914B609F93), + U64(0x565601C0364E3228), U64(0xECB53939887E8175), U64(0xBAC7A9A18531294B), U64(0xB344C470397BBA52), + U64(0x65D34954DAF3CEBD), U64(0xB4B81B3FA97511E2), U64(0xB422061193D6F6A7), U64(0x071582401C38434D), + U64(0x7A13F18BBEDC4FF5), U64(0xBC4097B116C524D2), U64(0x59B97885E2F2EA28), U64(0x99170A5DC3115544), + U64(0x6F423357E7C6A9F9), U64(0x325928EE6E6F8794), U64(0xD0E4366228B03343), U64(0x565C31F7DE89EA27), + U64(0x30F5611484119414), U64(0xD873DB391292ED4F), U64(0x7BD94E1D8E17DEBC), U64(0xC7D9F16864A76E94), + U64(0x947AE053EE56E63C), U64(0xC8C93882F9475F5F), U64(0x3A9BF55BA91F81CA), U64(0xD9A11FBB3D9808E4), + U64(0x0FD22063EDC29FCA), U64(0xB3F256D8ACA0B0B9), U64(0xB03031A8B4516E84), U64(0x35DD37D5871448AF), + U64(0xE9F6082B05542E4E), U64(0xEBFAFA33D7254B59), U64(0x9255ABB50D532280), U64(0xB9AB4CE57F2D34F3), + U64(0x693501D628297551), U64(0xC62C58F97DD949BF), U64(0xCD454F8F19C5126A), U64(0xBBE83F4ECC2BDECB), + U64(0xDC842B7E2819E230), U64(0xBA89142E007503B8), U64(0xA3BC941D0A5061CB), U64(0xE9F6760E32CD8021), + U64(0x09C7E552BC76492F), U64(0x852F54934DA55CC9), U64(0x8107FCCF064FCF56), U64(0x098954D51FFF6580), + U64(0x23B70EDB1955C4BF), U64(0xC330DE426430F69D), U64(0x4715ED43E8A45C0A), U64(0xA8D7E4DAB780A08D), + U64(0x0572B974F03CE0BB), U64(0xB57D2E985E1419C7), U64(0xE8D9ECBE2CF3D73F), U64(0x2FE4B17170E59750), + U64(0x11317BA87905E790), U64(0x7FBF21EC8A1F45EC), U64(0x1725CABFCB045B00), U64(0x964E915CD5E2B207), + U64(0x3E2B8BCBF016D66D), U64(0xBE7444E39328A0AC), U64(0xF85B2B4FBCDE44B7), U64(0x49353FEA39BA63B1), + U64(0x1DD01AAFCD53486A), U64(0x1FCA8A92FD719F85), U64(0xFC7C95D827357AFA), U64(0x18A6A990C8B35EBD), + U64(0xCCCB7005C6B9C28D), U64(0x3BDBB92C43B17F26), U64(0xAA70B5B4F89695A2), U64(0xE94C39A54A98307F), + U64(0xB7A0B174CFF6F36E), U64(0xD4DBA84729AF48AD), U64(0x2E18BC1AD9704A68), U64(0x2DE0966DAF2F8B1C), + U64(0xB9C11D5B1E43A07E), U64(0x64972D68DEE33360), U64(0x94628D38D0C20584), U64(0xDBC0D2B6AB90A559), + U64(0xD2733C4335C6A72F), U64(0x7E75D99D94A70F4D), U64(0x6CED1983376FA72B), U64(0x97FCAACBF030BC24), + U64(0x7B77497B32503B12), U64(0x8547EDDFB81CCB94), U64(0x79999CDFF70902CB), U64(0xCFFE1939438E9B24), + U64(0x829626E3892D95D7), U64(0x92FAE24291F2B3F1), U64(0x63E22C147B9C3403), U64(0xC678B6D860284A1C), + U64(0x5873888850659AE7), U64(0x0981DCD296A8736D), U64(0x9F65789A6509A440), U64(0x9FF38FED72E9052F), + U64(0xE479EE5B9930578C), U64(0xE7F28ECD2D49EECD), U64(0x56C074A581EA17FE), U64(0x5544F7D774B14AEF), + U64(0x7B3F0195FC6F290F), U64(0x12153635B2C0CF57), U64(0x7F5126DBBA5E0CA7), U64(0x7A76956C3EAFB413), + U64(0x3D5774A11D31AB39), U64(0x8A1B083821F40CB4), U64(0x7B4A38E32537DF62), U64(0x950113646D1D6E03), + U64(0x4DA8979A0041E8A9), U64(0x3BC36E078F7515D7), U64(0x5D0A12F27AD310D1), U64(0x7F9D1A2E1EBE1327), + U64(0xDA3A361B1C5157B1), U64(0xDCDD7D20903D0C25), U64(0x36833336D068F707), U64(0xCE68341F79893389), + U64(0xAB9090168DD05F34), U64(0x43954B3252DC25E5), U64(0xB438C2B67F98E5E9), U64(0x10DCD78E3851A492), + U64(0xDBC27AB5447822BF), U64(0x9B3CDB65F82CA382), U64(0xB67B7896167B4C84), U64(0xBFCED1B0048EAC50), + U64(0xA9119B60369FFEBD), U64(0x1FFF7AC80904BF45), U64(0xAC12FB171817EEE7), U64(0xAF08DA9177DDA93D), + U64(0x1B0CAB936E65C744), U64(0xB559EB1D04E5E932), U64(0xC37B45B3F8D6F2BA), U64(0xC3A9DC228CAAC9E9), + U64(0xF3B8B6675A6507FF), U64(0x9FC477DE4ED681DA), U64(0x67378D8ECCEF96CB), U64(0x6DD856D94D259236), + U64(0xA319CE15B0B4DB31), U64(0x073973751F12DD5E), U64(0x8A8E849EB32781A5), U64(0xE1925C71285279F5), + U64(0x74C04BF1790C0EFE), U64(0x4DDA48153C94938A), U64(0x9D266D6A1CC0542C), U64(0x7440FB816508C4FE), + U64(0x13328503DF48229F), U64(0xD6BF7BAEE43CAC40), U64(0x4838D65F6EF6748F), U64(0x1E152328F3318DEA), + U64(0x8F8419A348F296BF), U64(0x72C8834A5957B511), U64(0xD7A023A73260B45C), U64(0x94EBC8ABCFB56DAE), + U64(0x9FC10D0F989993E0), U64(0xDE68A2355B93CAE6), U64(0xA44CFE79AE538BBE), U64(0x9D1D84FCCE371425), + U64(0x51D2B1AB2DDFB636), U64(0x2FD7E4B9E72CD38C), U64(0x65CA5B96B7552210), U64(0xDD69A0D8AB3B546D), + U64(0x604D51B25FBF70E2), U64(0x73AA8A564FB7AC9E), U64(0x1A8C1E992B941148), U64(0xAAC40A2703D9BEA0), + U64(0x764DBEAE7FA4F3A6), U64(0x1E99B96E70A9BE8B), U64(0x2C5E9DEB57EF4743), U64(0x3A938FEE32D29981), + U64(0x26E6DB8FFDF5ADFE), U64(0x469356C504EC9F9D), U64(0xC8763C5B08D1908C), U64(0x3F6C6AF859D80055), + U64(0x7F7CC39420A3A545), U64(0x9BFB227EBDF4C5CE), U64(0x89039D79D6FC5C5C), U64(0x8FE88B57305E2AB6), + U64(0xA09E8C8C35AB96DE), U64(0xFA7E393983325753), U64(0xD6B6D0ECC617C699), U64(0xDFEA21EA9E7557E3), + U64(0xB67C1FA481680AF8), U64(0xCA1E3785A9E724E5), U64(0x1CFC8BED0D681639), U64(0xD18D8549D140CAEA), + U64(0x4ED0FE7E9DC91335), U64(0xE4DBF0634473F5D2), U64(0x1761F93A44D5AEFE), U64(0x53898E4C3910DA55), + U64(0x734DE8181F6EC39A), U64(0x2680B122BAA28D97), U64(0x298AF231C85BAFAB), U64(0x7983EED3740847D5), + U64(0x66C1A2A1A60CD889), U64(0x9E17E49642A3E4C1), U64(0xEDB454E7BADC0805), U64(0x50B704CAB602C329), + U64(0x4CC317FB9CDDD023), U64(0x66B4835D9EAFEA22), U64(0x219B97E26FFC81BD), U64(0x261E4E4C0A333A9D), + U64(0x1FE2CCA76517DB90), U64(0xD7504DFA8816EDBB), U64(0xB9571FA04DC089C8), U64(0x1DDC0325259B27DE), + U64(0xCF3F4688801EB9AA), U64(0xF4F5D05C10CAB243), U64(0x38B6525C21A42B0E), U64(0x36F60E2BA4FA6800), + U64(0xEB3593803173E0CE), U64(0x9C4CD6257C5A3603), U64(0xAF0C317D32ADAA8A), U64(0x258E5A80C7204C4B), + U64(0x8B889D624D44885D), U64(0xF4D14597E660F855), U64(0xD4347F66EC8941C3), U64(0xE699ED85B0DFB40D), + U64(0x2472F6207C2D0484), U64(0xC2A1E7B5B459AEB5), U64(0xAB4F6451CC1D45EC), U64(0x63767572AE3D6174), + U64(0xA59E0BD101731A28), U64(0x116D0016CB948F09), U64(0x2CF9C8CA052F6E9F), U64(0x0B090A7560A968E3), + U64(0xABEEDDB2DDE06FF1), U64(0x58EFC10B06A2068D), U64(0xC6E57A78FBD986E0), U64(0x2EAB8CA63CE802D7), + U64(0x14A195640116F336), U64(0x7C0828DD624EC390), U64(0xD74BBE77E6116AC7), U64(0x804456AF10F5FB53), + U64(0xEBE9EA2ADF4321C7), U64(0x03219A39EE587A30), U64(0x49787FEF17AF9924), U64(0xA1E9300CD8520548), + U64(0x5B45E522E4B1B4EF), U64(0xB49C3B3995091A36), U64(0xD4490AD526F14431), U64(0x12A8F216AF9418C2), + U64(0x001F837CC7350524), U64(0x1877B51E57A764D5), U64(0xA2853B80F17F58EE), U64(0x993E1DE72D36D310), + U64(0xB3598080CE64A656), U64(0x252F59CF0D9F04BB), U64(0xD23C8E176D113600), U64(0x1BDA0492E7E4586E), + U64(0x21E0BD5026C619BF), U64(0x3B097ADAF088F94E), U64(0x8D14DEDB30BE846E), U64(0xF95CFFA23AF5F6F4), + U64(0x3871700761B3F743), U64(0xCA672B91E9E4FA16), U64(0x64C8E531BFF53B55), U64(0x241260ED4AD1E87D), + U64(0x106C09B972D2E822), U64(0x7FBA195410E5CA30), U64(0x7884D9BC6CB569D8), U64(0x0647DFEDCD894A29), + U64(0x63573FF03E224774), U64(0x4FC8E9560F91B123), U64(0x1DB956E450275779), U64(0xB8D91274B9E9D4FB), + U64(0xA2EBEE47E2FBFCE1), U64(0xD9F1F30CCD97FB09), U64(0xEFED53D75FD64E6B), U64(0x2E6D02C36017F67F), + U64(0xA9AA4D20DB084E9B), U64(0xB64BE8D8B25396C1), U64(0x70CB6AF7C2D5BCF0), U64(0x98F076A4F7A2322E), + U64(0xBF84470805E69B5F), U64(0x94C3251F06F90CF3), U64(0x3E003E616A6591E9), U64(0xB925A6CD0421AFF3), + U64(0x61BDD1307C66E300), U64(0xBF8D5108E27E0D48), U64(0x240AB57A8B888B20), U64(0xFC87614BAF287E07), + U64(0xEF02CDD06FFDB432), U64(0xA1082C0466DF6C0A), U64(0x8215E577001332C8), U64(0xD39BB9C3A48DB6CF), + U64(0x2738259634305C14), U64(0x61CF4F94C97DF93D), U64(0x1B6BACA2AE4E125B), U64(0x758F450C88572E0B), + U64(0x959F587D507A8359), U64(0xB063E962E045F54D), U64(0x60E8ED72C0DFF5D1), U64(0x7B64978555326F9F), + U64(0xFD080D236DA814BA), U64(0x8C90FD9B083F4558), U64(0x106F72FE81E2C590), U64(0x7976033A39F7D952), + U64(0xA4EC0132764CA04B), U64(0x733EA705FAE4FA77), U64(0xB4D8F77BC3E56167), U64(0x9E21F4F903B33FD9), + U64(0x9D765E419FB69F6D), U64(0xD30C088BA61EA5EF), U64(0x5D94337FBFAF7F5B), U64(0x1A4E4822EB4D7A59), + U64(0x6FFE73E81B637FB3), U64(0xDDF957BC36D8B9CA), U64(0x64D0E29EEA8838B3), U64(0x08DD9BDFD96B9F63), + U64(0x087E79E5A57D1D13), U64(0xE328E230E3E2B3FB), U64(0x1C2559E30F0946BE), U64(0x720BF5F26F4D2EAA), + U64(0xB0774D261CC609DB), U64(0x443F64EC5A371195), U64(0x4112CF68649A260E), U64(0xD813F2FAB7F5C5CA), + U64(0x660D3257380841EE), U64(0x59AC2C7873F910A3), U64(0xE846963877671A17), U64(0x93B633ABFA3469F8), + U64(0xC0C0F5A60EF4CDCF), U64(0xCAF21ECD4377B28C), U64(0x57277707199B8175), U64(0x506C11B9D90E8B1D), + U64(0xD83CC2687A19255F), U64(0x4A29C6465A314CD1), U64(0xED2DF21216235097), U64(0xB5635C95FF7296E2), + U64(0x22AF003AB672E811), U64(0x52E762596BF68235), U64(0x9AEBA33AC6ECC6B0), U64(0x944F6DE09134DFB6), + U64(0x6C47BEC883A7DE39), U64(0x6AD047C430A12104), U64(0xA5B1CFDBA0AB4067), U64(0x7C45D833AFF07862), + U64(0x5092EF950A16DA0B), U64(0x9338E69C052B8E7B), U64(0x455A4B4CFE30E3F5), U64(0x6B02E63195AD0CF8), + U64(0x6B17B224BAD6BF27), U64(0xD1E0CCD25BB9C169), U64(0xDE0C89A556B9AE70), U64(0x50065E535A213CF6), + U64(0x9C1169FA2777B874), U64(0x78EDEFD694AF1EED), U64(0x6DC93D9526A50E68), U64(0xEE97F453F06791ED), + U64(0x32AB0EDB696703D3), U64(0x3A6853C7E70757A7), U64(0x31865CED6120F37D), U64(0x67FEF95D92607890), + U64(0x1F2B1D1F15F6DC9C), U64(0xB69E38A8965C6B65), U64(0xAA9119FF184CCCF4), U64(0xF43C732873F24C13), + U64(0xFB4A3D794A9A80D2), U64(0x3550C2321FD6109C), U64(0x371F77E76BB8417E), U64(0x6BFA9AAE5EC05779), + U64(0xCD04F3FF001A4778), U64(0xE3273522064480CA), U64(0x9F91508BFFCFC14A), U64(0x049A7F41061A9E60), + U64(0xFCB6BE43A9F2FE9B), U64(0x08DE8A1C7797DA9B), U64(0x8F9887E6078735A1), U64(0xB5B4071DBFC73A66), + U64(0x230E343DFBA08D33), U64(0x43ED7F5A0FAE657D), U64(0x3A88A0FBBCB05C63), U64(0x21874B8B4D2DBC4F), + U64(0x1BDEA12E35F6A8C9), U64(0x53C065C6C8E63528), U64(0xE34A1D250E7A8D6B), U64(0xD6B04D3B7651DD7E), + U64(0x5E90277E7CB39E2D), U64(0x2C046F22062DC67D), U64(0xB10BB459132D0A26), U64(0x3FA9DDFB67E2F199), + U64(0x0E09B88E1914F7AF), U64(0x10E8B35AF3EEAB37), U64(0x9EEDECA8E272B933), U64(0xD4C718BC4AE8AE5F), + U64(0x81536D601170FC20), U64(0x91B534F885818A06), U64(0xEC8177F83F900978), U64(0x190E714FADA5156E), + U64(0xB592BF39B0364963), U64(0x89C350C893AE7DC1), U64(0xAC042E70F8B383F2), U64(0xB49B52E587A1EE60), + U64(0xFB152FE3FF26DA89), U64(0x3E666E6F69AE2C15), U64(0x3B544EBE544C19F9), U64(0xE805A1E290CF2456), + U64(0x24B33C9D7ED25117), U64(0xE74733427B72F0C1), U64(0x0A804D18B7097475), U64(0x57E3306D881EDB4F), + U64(0x4AE7D6A36EB5DBCB), U64(0x2D8D5432157064C8), U64(0xD1E649DE1E7F268B), U64(0x8A328A1CEDFE552C), + U64(0x07A3AEC79624C7DA), U64(0x84547DDC3E203C94), U64(0x990A98FD5071D263), U64(0x1A4FF12616EEFC89), + U64(0xF6F7FD1431714200), U64(0x30C05B1BA332F41C), U64(0x8D2636B81555A786), U64(0x46C9FEB55D120902), + U64(0xCCEC0A73B49C9921), U64(0x4E9D2827355FC492), U64(0x19EBB029435DCB0F), U64(0x4659D2B743848A2C), + U64(0x963EF2C96B33BE31), U64(0x74F85198B05A2E7D), U64(0x5A0F544DD2B1FB18), U64(0x03727073C2E134B1), + U64(0xC7F6AA2DE59AEA61), U64(0x352787BAA0D7C22F), U64(0x9853EAB63B5E0B35), U64(0xABBDCDD7ED5C0860), + U64(0xCF05DAF5AC8D77B0), U64(0x49CAD48CEBF4A71E), U64(0x7A4C10EC2158C4A6), U64(0xD9E92AA246BF719E), + U64(0x13AE978D09FE5557), U64(0x730499AF921549FF), U64(0x4E4B705B92903BA4), U64(0xFF577222C14F0A3A), + U64(0x55B6344CF97AAFAE), U64(0xB862225B055B6960), U64(0xCAC09AFBDDD2CDB4), U64(0xDAF8E9829FE96B5F), + U64(0xB5FDFC5D3132C498), U64(0x310CB380DB6F7503), U64(0xE87FBB46217A360E), U64(0x2102AE466EBB1148), + U64(0xF8549E1A3AA5E00D), U64(0x07A69AFDCC42261A), U64(0xC4C118BFE78FEAAE), U64(0xF9F4892ED96BD438), + U64(0x1AF3DBE25D8F45DA), U64(0xF5B4B0B0D2DEEEB4), U64(0x962ACEEFA82E1C84), U64(0x046E3ECAAF453CE9), + U64(0xF05D129681949A4C), U64(0x964781CE734B3C84), U64(0x9C2ED44081CE5FBD), U64(0x522E23F3925E319E), + U64(0x177E00F9FC32F791), U64(0x2BC60A63A6F3B3F2), U64(0x222BBFAE61725606), U64(0x486289DDCC3D6780), + U64(0x7DC7785B8EFDFC80), U64(0x8AF38731C02BA980), U64(0x1FAB64EA29A2DDF7), U64(0xE4D9429322CD065A), + U64(0x9DA058C67844F20C), U64(0x24C0E332B70019B0), U64(0x233003B5A6CFE6AD), U64(0xD586BD01C5C217F6), + U64(0x5E5637885F29BC2B), U64(0x7EBA726D8C94094B), U64(0x0A56A5F0BFE39272), U64(0xD79476A84EE20D06), + U64(0x9E4C1269BAA4BF37), U64(0x17EFEE45B0DEE640), U64(0x1D95B0A5FCF90BC6), U64(0x93CBE0B699C2585D), + U64(0x65FA4F227A2B6D79), U64(0xD5F9E858292504D5), U64(0xC2B5A03F71471A6F), U64(0x59300222B4561E00), + U64(0xCE2F8642CA0712DC), U64(0x7CA9723FBB2E8988), U64(0x2785338347F2BA08), U64(0xC61BB3A141E50E8C), + U64(0x150F361DAB9DEC26), U64(0x9F6A419D382595F4), U64(0x64A53DC924FE7AC9), U64(0x142DE49FFF7A7C3D), + U64(0x0C335248857FA9E7), U64(0x0A9C32D5EAE45305), U64(0xE6C42178C4BBB92E), U64(0x71F1CE2490D20B07), + U64(0xF1BCC3D275AFE51A), U64(0xE728E8C83C334074), U64(0x96FBF83A12884624), U64(0x81A1549FD6573DA5), + U64(0x5FA7867CAF35E149), U64(0x56986E2EF3ED091B), U64(0x917F1DD5F8886C61), U64(0xD20D8C88C8FFE65F), + U64(0x31D71DCE64B2C310), U64(0xF165B587DF898190), U64(0xA57E6339DD2CF3A0), U64(0x1EF6E6DBB1961EC9), + U64(0x70CC73D90BC26E24), U64(0xE21A6B35DF0C3AD7), U64(0x003A93D8B2806962), U64(0x1C99DED33CB890A1), + U64(0xCF3145DE0ADD4289), U64(0xD0E4427A5514FB72), U64(0x77C621CC9FB3A483), U64(0x67A34DAC4356550B), + U64(0xF8D626AAAF278509), +}; + +uint64 *RandomPiece =Random64; +uint64 *RandomCastle =Random64+768; +uint64 *RandomEnPassant =Random64+772; +uint64 *RandomTurn =Random64+780; + +char *piece_names="pPnNbBrRqQkK"; + +uint64 hash(char *fen){ + char board_s[72+1]; + char to_move_c; + char castle_flags_s[4+1]; + char ep_square_s[2+1]; + char board[8][8]; + char c; + int p,r,f,i,p_enc; + uint64 key=0; + sscanf(fen,"%72s %c %4s %2s", + board_s, + &to_move_c, + castle_flags_s, + ep_square_s); + r=7; + f=0; + p=0; + while(1){ + if(p>=strlen(board_s)) break; + c=board_s[p++]; + if(c=='/'){ + r--; + f=0; + continue; + } + if(('1'<=c)&&('8'>=c)){ + for(i=0;i<=c-'1';i++){ + board[f++][r]='-'; + } + continue; + } + board[f++][r]=c; + } + for(f=0;f<=7;f++){ + for(r=0;r<=7;r++){ + c=board[f][r]; + if(c!='-'){ + p_enc=strchr(piece_names,c)-piece_names; + key^=RandomPiece[64*p_enc+8*r+f]; + } + } + } + p=0; + while(1){ + if(p>=strlen(castle_flags_s)) break; + c=castle_flags_s[p++]; + switch(c){ + case '-' : + break; + case 'K' : + key^=RandomCastle[0]; + break; + case 'Q' : + key^=RandomCastle[1]; + break; + case 'k' : + key^=RandomCastle[2]; + break; + case 'q' : + key^=RandomCastle[3]; + break; + default: + break; + } + } + if(ep_square_s[0]!='-'){ + f=ep_square_s[0]-'a'; + if(to_move_c=='b'){ + if((f>0 && board[f-1][3]=='p')|| + (f<7 && board[f+1][3]=='p')){ + key^=RandomEnPassant[f]; + } + }else{ + if((f>0 && board[f-1][4]=='P')|| + (f<7 && board[f+1][4]=='P')){ + key^=RandomEnPassant[f]; + } + } + } + if(to_move_c=='w'){ + key^=RandomTurn[0]; + } + return key; +} + +int main(int argc, char *argv[]){ + if(argc==1){ + printf("Usage: pg_key \"\"\n"); + }else{ +#ifdef _MSC_VER + printf("%016I64x\n",hash(argv[1])); +#else + printf("%016llx\n",hash(argv[1])); +#endif + } + return 0; +} diff --git a/pg_show.c b/pg_show.c new file mode 100644 index 0000000..c377cbb --- /dev/null +++ b/pg_show.c @@ -0,0 +1,194 @@ +/* + * This utility looks up the moves and their scores in a Polyglot book + * + * Usage: + * pg_show " + * + * You can find the hex key of a FEN using pg_key. + * + * This code is released in the public domain by Michel Van den Bergh. + * + */ + + +#include +#include + +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; + +#ifdef _MSC_VER + typedef unsigned __int64 uint64; +#else + typedef unsigned long long int uint64; +#endif + +typedef struct { + uint64 key; + uint16 move; + uint16 weight; + uint32 learn; +} entry_t; + +entry_t entry_none = { + 0, 0, 0, 0 +}; + +char *promote_pieces=" nbrq"; + +#define MAX_MOVES 100 + +int int_from_file(FILE *f, int l, uint64 *r){ + int i,c; + for(i=0;ikey=r; + ret=int_from_file(f,2,&r); + if(ret) return 1; + entry->move=r; + ret=int_from_file(f,2,&r); + if(ret) return 1; + entry->weight=r; + ret=int_from_file(f,4,&r); + if(ret) return 1; + entry->learn=r; + return 0; +} + +int find_key(FILE *f, uint64 key, entry_t *entry){ + int first, last, middle; + entry_t first_entry=entry_none, last_entry,middle_entry; + first=-1; + if(fseek(f,-16,SEEK_END)){ + *entry=entry_none; + entry->key=key+1; //hack + return -1; + } + last=ftell(f)/16; + entry_from_file(f,&last_entry); + while(1){ + if(last-first==1){ + *entry=last_entry; + return last; + } + middle=(first+last)/2; + fseek(f,16*middle,SEEK_SET); + entry_from_file(f,&middle_entry); + if(key<=middle_entry.key){ + last=middle; + last_entry=middle_entry; + }else{ + first=middle; + first_entry=middle_entry; + } + } +} + +void move_to_string(char move_s[6], uint16 move){ + int f,fr,ff,t,tr,tf,p; + f=(move>>6)&077; + fr=(f>>3)&0x7; + ff=f&0x7; + t=move&077; + tr=(t>>3)&0x7; + tf=t&0x7; + p=(move>>12)&0x7; + move_s[0]=ff+'a'; + move_s[1]=fr+'1'; + move_s[2]=tf+'a'; + move_s[3]=tr+'1'; + if(p){ + move_s[4]=promote_pieces[p]; + move_s[5]='\0'; + }else{ + move_s[4]='\0'; + } + if(!strcmp(move_s,"e1h1")){ + strcpy(move_s,"e1g1"); + }else if(!strcmp(move_s,"e1a1")){ + strcpy(move_s,"e1c1"); + }else if(!strcmp(move_s,"e8h8")){ + strcpy(move_s,"e8g8"); + }else if(!strcmp(move_s,"e8a8")){ + strcpy(move_s,"e8c8"); + } +} + +int main(int argc, char *argv[]){ + FILE *f; + entry_t entry; + int offset; + char *file_name; + uint64 key; + entry_t entries[MAX_MOVES]; + int count=0; + int ret, i; + char move_s[6]; + int total_weight; + if(argc<=2){ + printf("Usage: pg_show \n"); + return 1; + } + file_name=argv[1]; +#ifdef _MSC_VER + sscanf(argv[2],"%16I64x",&key); +#else + sscanf(argv[2],"%16llx",&key); +#endif + f=fopen(file_name,"rb"); + if(!f){ + perror(file_name); + return 1; + } + offset=find_key(f,key,&entry); + if(entry.key!=key){ +#ifdef _MSC_VER + printf("%016I64x: No such key\n",key); +#else + printf("%016llx: No such key\n",key); +#endif + return 1; + } + entries[0]=entry; + count=1; + fseek(f,16*(offset+1),SEEK_SET); + while(1){ + ret=entry_from_file(f,&entry); + if(ret){ + break; + } + if(entry.key!=key){ + break; + } + if(count==MAX_MOVES){ + printf("Too many moves in this position (max=%d)\n",MAX_MOVES); + return 1; + } + entries[count++]=entry; + } + total_weight=0; + for(i=0;i /* required for all Windows applications */ - #include #include #include +#ifdef WIN32 +// [HGM] this was probably a Windows-specific constant. Needs to be defined here now I +// threw out the Windows-specific includes (winboard.h etc.). 100 seems enough. +#include +#define SLASH_CHAR "\\" +#else +#define MAX_PATH 100 +#define SLASH_CHAR "/" +#endif + #include "common.h" -#include "winboard.h" -#include "frontend.h" #include "backend.h" #define INIFILE_PREFIX "polyglot_" @@ -37,6 +41,7 @@ #define INIFILE_SUFFIX_2ND "2nd" #define INIFILE_EXT ".ini" + static const char * GetIniFilename( ChessProgramState * cps ) { return cps == &first ? INIFILE_PREFIX INIFILE_SUFFIX_1ST INIFILE_EXT : INIFILE_PREFIX INIFILE_SUFFIX_2ND INIFILE_EXT; @@ -52,16 +57,21 @@ void InitEngineUCI( const char * iniDir, ChessProgramState * cps ) /* Build name of initialization file */ if( strchr( iniDir, ' ' ) != NULL ) { char iniDirShort[ MAX_PATH ]; - +#ifdef WIN32 GetShortPathName( iniDir, iniDirShort, sizeof(iniDirShort) ); strcpy( polyglotIniFile, iniDirShort ); +#else + // [HGM] UCI: not sure if this works, but GetShortPathName seems Windows pecific + // and names with spaces in it do not work in xboard in many places, so ignore + strcpy( polyglotIniFile, iniDir ); +#endif } else { strcpy( polyglotIniFile, iniDir ); } - strcat( polyglotIniFile, "\\" ); + strcat( polyglotIniFile, SLASH_CHAR ); strcat( polyglotIniFile, iniFileName ); /* Create initialization file */ diff --git a/winboard/config.h b/winboard/config.h index 9a99266..bc657f5 100644 --- a/winboard/config.h +++ b/winboard/config.h @@ -1,13 +1,5 @@ /* config.h.in. Generated automatically from configure.in by autoheader. */ -/* [HGM] Defining ADJUDICATE switches on rep-draw and insuf-material draws */ -#define ADJUDICATE - -/* [HGM] Defining FAIRY allows different K- & Q-side piece symbols */ -#define FAIRY - -#define GOTHIC "Gothic Chess (see www.GothicChess.com) is licensed under U.S. Patent #6,481,716 by Ed Trice" -#define FALCON "Falcon Chess (see www.chessvariants.com) is licensed under U.S. Patent #5,690,334 by George W. Duke" /* Define if you have that is POSIX.1 compatible. */ /*#undef HAVE_SYS_WAIT_H*/ @@ -36,9 +28,7 @@ #define HAVE_GETTIMEOFDAY 0 /* Use our own random() defined in winboard.c. */ -#define HAVE_RANDOM 1 -#define random myrandom -#define srandom mysrandom +#define HAVE_RANDOM 0 #define HAVE_SYS_SOCKET_H 0 @@ -46,7 +36,7 @@ #define LAST_PTY_LETTER 'q' -#define PATCHLEVEL "14k" +#define PATCHLEVEL "15m" #define PRODUCT "WinBoard" diff --git a/winboard/cygwin.mak b/winboard/cygwin.mak index c83f0a7..cb4781e 100644 --- a/winboard/cygwin.mak +++ b/winboard/cygwin.mak @@ -1,91 +1,97 @@ -# -# Makefile for WinBoard, using the GNU Cygwin toolset -# - -# Uncomment both lines to turn on debugging symbols ####### -cdebug= -g -linkdebug= -g -####################################################### - -proj=winboard -allobj= winboard.o backend.o parser.o moves.o lists.o \ - gamelist.o pgntags.o wedittags.o wgamelist.o zippy.o \ - wsockerr.o wbres.o wclipbrd.o woptions.o - -dotc= winboard.c backend.c parser.c moves.c lists.c \ - gamelist.c pgntags.c wedittags.c wgamelist.c zippy.c \ - wsockerr.c winboard.rc wclipbrd.c woptions.c - -# Currently WinBoard will build either with or without -mno-cygwin -# however, a Cygwin bug in forming the command line to WinMain() is -# exposed if -mno-cygwin is not used. -cygwin= -mno-cygwin - -VPATH= .:.. -CFLAGS= $(cdebug) -INCLUDES= -I. -I.. -CVARS= $(INCLUDES) $(cygwin) -CC = gcc $(CVARS) -WCC = $(CC) -mwindows $(linkdebug) -HC="/c/program files/help workshop/hcrtf.exe" -xn - -all: $(proj).exe - -depend: $(dotc) - makedepend -Y -f cygwin.mak $(INCLUDES) $^ - -clean: - rm -f *.obj *~ $(proj).exe $(proj).err $(proj).rbj \ - $(proj).RES $(proj).res $(proj).ini *.sbr *.bsc *.o \ - *.plg *.opt *.ncb *.debug *.bak *.gid *.GID - -maintainer-clean: clean - rm -f parser.c *.hlp *.HLP - -# Update the help file if necessary -$(proj).hlp : $(proj).rtf - $(HC) $(proj).hpj - cat $(proj).err - -# Update the resource if necessary -wbres.o: $(proj).rc $(proj).h resource.h - windres --use-temp-file --include-dir .. $< -O coff -o $@ - -# Update the object files if necessary - -parser.c: parser.l - flex -oparser.c -L $< - -$(proj).exe: $(allobj) $(proj).hlp $(proj).rc - $(WCC) $(guiflags) $(allobj) \ - -lwsock32 -lwinmm \ - -o $(proj).exe - -# DO NOT DELETE - -winboard.o: config.h ../common.h winboard.h resource.h ../frontend.h -winboard.o: ../backend.h ../lists.h ../moves.h wclipbrd.h wgamelist.h -winboard.o: wedittags.h woptions.h wsockerr.h defaults.h -backend.o: config.h ../common.h ../frontend.h ../backend.h ../lists.h -backend.o: ../parser.h ../moves.h ../zippy.h ../backendz.h -parser.o: config.h ../common.h ../backend.h ../lists.h ../frontend.h -parser.o: ../parser.h ../moves.h -moves.o: config.h ../common.h ../backend.h ../lists.h ../frontend.h -moves.o: ../moves.h ../parser.h -lists.o: config.h ../common.h ../lists.h -gamelist.o: config.h ../common.h ../frontend.h ../backend.h ../lists.h -gamelist.o: ../parser.h -pgntags.o: config.h ../common.h ../frontend.h ../backend.h ../lists.h -pgntags.o: ../parser.h -wedittags.o: config.h ../common.h winboard.h resource.h ../frontend.h -wedittags.o: ../backend.h ../lists.h -wgamelist.o: config.h ../common.h winboard.h resource.h ../frontend.h -wgamelist.o: ../backend.h ../lists.h -zippy.o: config.h ../common.h ../zippy.h ../frontend.h ../backend.h -zippy.o: ../lists.h ../backendz.h -wsockerr.o: wsockerr.h -winboard.o: resource.h -wclipbrd.o: config.h ../common.h winboard.h resource.h ../frontend.h -wclipbrd.o: ../backend.h ../lists.h wclipbrd.h -woptions.o: config.h ../common.h winboard.h resource.h ../backend.h -woptions.o: ../lists.h ../frontend.h woptions.h defaults.h wedittags.h +# +# Makefile for WinBoard, using the GNU Cygwin toolset +# + +# Uncomment both lines to turn on debugging symbols ####### +cdebug= -g +linkdebug= -g +####################################################### + +proj=winboard +allobj= winboard.o backend.o parser.o moves.o lists.o \ + gamelist.o pgntags.o wedittags.o wgamelist.o zippy.o \ + wsockerr.o wbres.o wclipbrd.o woptions.o uci.o \ + wengineo.o wevalgraph.o whistory.o wlayout.o \ + wplugin.o wsnap.o book.o + +dotc= winboard.c backend.c parser.c moves.c lists.c \ + gamelist.c pgntags.c wedittags.c wgamelist.c zippy.c \ + wsockerr.c winboard.rc wclipbrd.c woptions.c uci.c \ + wengineo.c wevalgraph.c whistory.c wlayout.c \ + wplugin.c wsnap.c book.c + +# Currently WinBoard will build either with or without -mno-cygwin +# however, a Cygwin bug in forming the command line to WinMain() is +# exposed if -mno-cygwin is not used. +cygwin= -mno-cygwin + +VPATH= .:.. +CFLAGS= $(cdebug) +INCLUDES= -I. -I.. +CVARS= $(INCLUDES) $(cygwin) +CC = gcc $(CVARS) +WCC = $(CC) -mwindows $(linkdebug) +HC="/c/program files/help workshop/hcrtf.exe" -xn + +all: $(proj).exe + +depend: $(dotc) + makedepend -Y -f cygwin.mak $(INCLUDES) $^ + +clean: + rm -f *.obj *~ $(proj).exe $(proj).err $(proj).rbj \ + $(proj).RES $(proj).res $(proj).ini *.sbr *.bsc *.o \ + *.plg *.opt *.ncb *.debug *.bak *.gid *.GID + +maintainer-clean: clean + rm -f parser.c *.hlp *.HLP + +# Update the help file if necessary +#$(proj).hlp : $(proj).rtf +# $(HC) $(proj).hpj +# cat $(proj).err + +# Update the resource if necessary +wbres.o: $(proj).rc $(proj).h resource.h + windres --use-temp-file --include-dir .. $< -O coff -o $@ + +# Update the object files if necessary + +parser.c: parser.l + flex -oparser.c -L $< + +#$(proj).exe: $(allobj) $(proj).hlp $(proj).rc +$(proj).exe: $(allobj) $(proj).rc + $(WCC) $(guiflags) $(allobj) \ + -lwsock32 -lwinmm \ + -o $(proj).exe + +# DO NOT DELETE + +winboard.o: config.h ../common.h winboard.h resource.h ../frontend.h +winboard.o: ../backend.h ../lists.h ../moves.h wclipbrd.h wgamelist.h +winboard.o: wedittags.h woptions.h wsockerr.h defaults.h +backend.o: config.h ../common.h ../frontend.h ../backend.h ../lists.h +backend.o: ../parser.h ../moves.h ../zippy.h ../backendz.h +parser.o: config.h ../common.h ../backend.h ../lists.h ../frontend.h +parser.o: ../parser.h ../moves.h +moves.o: config.h ../common.h ../backend.h ../lists.h ../frontend.h +moves.o: ../moves.h ../parser.h +lists.o: config.h ../common.h ../lists.h +gamelist.o: config.h ../common.h ../frontend.h ../backend.h ../lists.h +gamelist.o: ../parser.h +pgntags.o: config.h ../common.h ../frontend.h ../backend.h ../lists.h +pgntags.o: ../parser.h +wedittags.o: config.h ../common.h winboard.h resource.h ../frontend.h +wedittags.o: ../backend.h ../lists.h +wgamelist.o: config.h ../common.h winboard.h resource.h ../frontend.h +wgamelist.o: ../backend.h ../lists.h +zippy.o: config.h ../common.h ../zippy.h ../frontend.h ../backend.h +zippy.o: ../lists.h ../backendz.h +wsockerr.o: wsockerr.h +winboard.o: resource.h +wclipbrd.o: config.h ../common.h winboard.h resource.h ../frontend.h +wclipbrd.o: ../backend.h ../lists.h wclipbrd.h +woptions.o: config.h ../common.h winboard.h resource.h ../backend.h +woptions.o: ../lists.h ../frontend.h woptions.h defaults.h wedittags.h +book.o: ../common.h ../backend.h \ No newline at end of file diff --git a/winboard/readme.txt b/winboard/readme.txt index b22e6b4..8ebc2ca 100644 --- a/winboard/readme.txt +++ b/winboard/readme.txt @@ -1,3 +1,34 @@ + WinBoard 4.3.15m RELEASE NOTES + +Compared to version 4.3.14k described below, this version features + +New command-line options +/rewindIndex=N (for the new auto-increment mode of the loadGameIndex or loadPositionIndex in match mode +/sameColorGames=N (for playing a match where the same player has white all the time) +/egtFormats="..." (for specifying where various end-game tables are installed on the computer) + +New menu items ++ Time-odds factors can be set in the time-control dialog ++ Nr of CPUs for SMP engines can be set in the Options -> UCI dialog ++ Own-Book options can be switched from the Options -> UCI dialog ++ The ScoreIsAbs options can be set from the Options -> Engine dialog ++ New-Variant menu adds Superchess + +General Enhancements: +* WinBoard engines can now also use the Polyglot opening book (implemented as general GUI book) +* New WB-protocol commands memory, cores and egtpath make interactive setting of these parameters + possible on WB engines +* New Polyglot is available that relays the interactive setting of these parameters to UCI engines +* Match mode suports an auto-increment mode, so that all games or positions from a file can be played +* Draw claims with Kings and an arbitrary number of like Bishops (e.g. KBBKB) are accepted + +The source tree in original XBoard 4.2.7 format can now be compiled under Cygwin with the aid +of the cygwin.mak file in the ~/winboard/ subdirectory of the source release. Makefiles for +other compilers are not updated since 4.2.7, as I do not have those compilers. + +Note that this release is a bug-fix for the 4.3.15k release, which had a bug in human-ICS play mode. + + WinBoard 4.3.14k RELEASE NOTES Compared to version 4.3.13 described below, this version features @@ -21,7 +52,7 @@ Bugfixes: * In ICS observing mode game history is now fully accessible * Moves are not fed to engine in zippy mode, when observing a game from a variant unknown to the engine * a problem with loading PGN of FRC games with move disambiguation and initial castling rights was fixed. -* A bug in the clock display that mad previous versions of WinBoard crash for tiny displays is fixed +* A bug in the clock display that made previous versions of WinBoard crash for tiny displays is fixed General enhancements: * variant name displayed in title bar in ICS mode, when not 'normal' diff --git a/winboard/resource.h b/winboard/resource.h index 86e7169..aa5dc8b 100644 --- a/winboard/resource.h +++ b/winboard/resource.h @@ -85,6 +85,8 @@ #define OPT_TCInc 407 #define OPT_TCitext3 408 #define OPT_TCTime2 409 +#define OPT_TCOdds1 410 +#define OPT_TCOdds2 411 #define DLG_PremoveOptions 450 #define DLG_GeneralOptions 453 #define DLG_IcsOptions 454 @@ -115,6 +117,7 @@ #define PB_Archbishop 507 #define IDC_Yes 520 #define IDC_No 521 +#define IDC_Centaur 522 #define EP_White 600 #define EP_WhitePawn 601 #define EP_WhiteKnight 602 @@ -441,8 +444,11 @@ #define IDC_StateIcon2 1464 #define IDC_PathToEGTB 1466 #define IDC_SizeOfEGTB 1467 -#define IDC_UseBook 1469 -#define IDC_BookFile 1470 +#define IDC_BookFile 1469 +#define IDC_UseBook 1470 +#define IDC_OwnBook1 1471 +#define IDC_OwnBook2 1472 +#define IDC_Cores 1473 #define DLG_NewVariant 1500 #define OPT_VariantGothic 1501 #define OPT_VariantCrazyhouse 1502 @@ -464,7 +470,7 @@ #define OPT_VariantFalcon 1518 #define OPT_VariantCRC 1519 #define OPT_VariantBerolina 1520 -#define OPT_Variant3Checks 1521 +#define OPT_VariantSuper 1521 #define OPT_VariantJanus 1522 #define OPT_VariantWildcastle 1523 #define OPT_VariantNocastle 1524 @@ -478,6 +484,8 @@ #define IDC_TrivialDraws 1603 #define IDC_RuleMoves 1604 #define IDC_DrawRepeats 1605 +#define IDC_ScoreAbs1 1606 +#define IDC_ScoreAbs2 1607 #define IDM_FlipClock 1700 #define OPT_AllWhite 1701 #define OPT_UpsideDown 1702 diff --git a/winboard/shogibitmaps/bamazon.bmp b/winboard/shogibitmaps/bamazon.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e9ed4723f5ba5a09f85973306095a1407796a31a GIT binary patch literal 1476 zcma)*O>V>>427xGS#<@<1>(t~Ys>}6cvYzf=zV&v?s~83vtjs2r=uc4fX~m^hV1X( zCui*q<12cs{mDJsz7FA~bT!p}y`~>6qv(NIWK9Ou>p;M{5J)8>?v4At~K0qs~U% u16He8>UGc|dfl-)=w$Tyh^2CCqFGuSVo7!}TtBnVYTZABu5Z>Em~%fMMei>F literal 0 HcmV?d00001 diff --git a/winboard/shogibitmaps/king.bmp b/winboard/shogibitmaps/king.bmp new file mode 100644 index 0000000000000000000000000000000000000000..c80a2b34e4c8580de55565375c5b68a14cd31b64 GIT binary patch literal 3238 zcmeH|zmC)}5XQ%j6Hk)OW)rU{5E8{vAS6IEETTH7Xy}lTw!M?6&{FaOAl`v$8^j~f z(Q(y129L2UrZ(5`8&LN{{`+oc@C>L@8H($JFwgB;Of^EY`0t3Y&LLtaRKY~ z8qUvOz_Zl~9zS>lXJ_|-CkZgdob>5>a^U2^$$@`xpv4=)PC6^yN`5><;}y{g8dENk zR7xgfnz$GGy7c(Pz>7>Nm9dmQG39;A0iF|Gm8kiuLWRAK&(Eb15=7^D-tk4Am#9+n zMbdipSY9Y3YT)y{Rz@k{XPK5sRHNxJpI2rDvGDX^NjOKN?(wvO{u|^x=A|l)d|$tQ zED$I7Hep=V7WeqP)D`*L1wb1x$oqV*7x3-uctj^3@Rdqf_>XWdxoS!mh@z%#vq2UG zb^^>LZPme$5kHe$3_(kg=*pwu+9M;q#zhg^02X$+>)rua;Cy{Q?WZ;;2lHdMEM7am`z*iO9x4EqHvp05<@ zZI10Bz8f7hcB;bi1q~D`<`8fCC7}UC7|kEl154BK>C*MP5yTQ{`C8cVHeu(8Cq2&f zPal)~tnI%KZ_;3x=yLoM;Ac$Pd5q5{^_x+}o<0wUiK%CX&JT}f>9jm0EiemH$lP|a d8oP#CuRI0j{4ZjA-;?Ma= z^`LG4?eBm6%b$My@7J&8=a=&H&+_xH^7GS=pUdw*e*FIDlyH266+r zf!siDAUBX3$PMHMas#=6+(2$1H;^014de!L1G$0RKyDy6kQ>Mi9fVGbaMl81NrvkHqyRx1Nrvu+;+~A8(8}G zN^?0Y?c6}!!0Lym-`;Qk_;>#Eog1jH?lAK0edjaSqB`H+mbK^5vVnYi`3!b#Am84u z&F9>FdrRK{)_b_-#QsdP{Eb0KzW?tU1>lW)Gnui>mOH)HZ20h?Ud|0~@ALjOi(aE2 zF<*sWqQ9C=UKE6)dmi3rygjV$l54(@OC6AGHhg#x67ubx-U}Oxx#pBuD^!`CpBV&s zzCGtm*wu(@P8n&4TC@Mtf?&?KXC4S!8h1BNF-LC+VvYIsa0TpVmWwHeJF7YRn6sV` z1ZTdzdK7GCu3M)_W9|ralY<^&gD~G-xeIm@bIT^3Li74gzTeF$#3ys^t{~X*?O`F8 zTx`#&HP7wj_jh)h9G}e5TY^A^#&s^{7I%w$IaDKcMp|2P%H`Z@JNbbTPPg)@4&7yF zyq3llaZKN}gfbT-o$l#QoIa*lCx2v?)7HeeCkU!jfpZfu{T|7B3NTLH{v|lAG)9Ry z`BR3P{Y{b^f`I84I3*L)Z_ukpfZ^1=B;4tyNlL`YpEcJUVZy8qg5;9G@nlS2Emrpj zfbRzMIt?{Ui8%Rlr|Ur`&(a_m0s==$Fny^~-5k>$H>}a=sd-Ao$zQ>MaVFBbAf|@} z#tJcgolJDbT*r;+s#Q*BARVrgUwg(3r!zj8U@L-{8`Bl8!t@mabx#a!xnWVVu+_Z8 zHCTx_`Lb=;cKXXtCfoF&oLKCzs8}JUPgkcKVq(jU$O^8G<0U!9@#lSw-gtep>Igg;yhh7mbt zE&9U^V|Nx}oOG|!c1{eZNj7bpv?D=`2xE^Ff?-6Cu0?aWBiNm_m?&LMTOu+6cIU*A zG)#nR0*8ZWK7t*t1w&YiE<|UzVc<)J7%E*2Tp}_7_NBSuWDJFCGRK1G90ndK1Vc=S zu0mV5BfytxF;}{pxkO|F>`QY;k}(&qi5&={?FewV77PIux&%G78>YQls7Kd`#x9Zi zRU21Fhx7GlL`?FlLG%pMjue8SxK~vmUpGW#g!XDJMoSmihbt3cUmZP?kI~vS;roNS z;Rx+WElBz$n3?DXcZ4%gi|Nw63Llt0QX)~cZNm2l(Qt%wuofi!5_Be7!5!oblmkGz z8ooqi0_?!_!4d$#HTgS(Xf?<=QVx<%elrcNq&q?wu9X0=Ka$@RrGr>Sc)jC=AknCu z5%iJnIApAYWPojoLXLD}0OM7X0k$cjCx|}dkl_v>>4DcdXaYCPHdqJ@>1qijA`@T_ zl7!2F0oPP<8bp&Y+jt>JPRY##G?DH&VYq|Dfc?QLOldNRRfN|&UI-Ei*=eJLbjR^V zI!F@OrZnV8cLZa+R+7Lrh4?{q7{?2D0Ev%nenkiAhN-3$N)p(gEyPq;gIL9sRmYlu zq!M--D3@-GXJVCvfo-Zoj&vtd#ac-i*rpaIi1HZElq!%E*TL4Gba{ez9NF>-=PKh8#y5lfY zI!GkgrXn3g)fB3cCg9P)W&~Bz9f6rxE0JJ-i6Si%dziTGSS#>oU>!k;bYl!Fsw5R` zt*AthBi$8vv7V9&wkZlhl*AY&R)Gh!ri+s5PNW)dRjIUbNmMBxhnd(x%Q+&ZCg|oBBm$=Q5yr8SOp%?nl4JJJCSOtb>eou3#`sT{4LL z*z}22;3=-8)wa$*A`_9Ov}$p-1UmUscqTS!q3UDFh_0H56mA7739M}-S2sL;QDFts zh89&KI;}<)5r*4VFc_w;8boq<`rJZLRa$Kzv$}J6rgW=p+R(a6M5oor6rQCt81z&!J2RwOWFFHgQ^q0R`n0MGqd7p z!xX5~YUEDr{#g|dhN&*!UjJgpGjS2=n%9vDu*YFmbO2;^O?CP9R-B;Kv))1*=5=&h zjkHGWjaNJvrn--OdwciqOvgo}YhFhtz;>qW{RGa#HPyZ4?G*_ozo|5XPuoD}?e_ku zk<+ojPJUFS`-Bbj+)kc;yN#u3ek7#(29e!7p^!0Gw6zc&eh)t$m4Kix-d z;Pia*^xJK$PQ$-00!7j_w=EN3zfQXbh9YwVyMkaVuI7JNL@TNhbIJ9qHr^#%(`rTL z1~vvks3p8B0y)w(mn;)tze~8Lg&b4<-XI9Igm*lcW6Iwf1fiDj zt_b8v*W9yAfc-Avnig_Q`Fn#P)DqqmfgI_YdzJ~X-z8krLXIhaZxDo9!n-1nBVBXP zG6D9xglk&JG3D29%R|ImTYwlSlz~`{WJyx7+*7%;{LB z&yVDEAGHDhcINf>2C+S#AIa%HY6Jf5_C7Ony563YpucA1u^aFYXI_7M5XAUWOV zY`{6(_BYl7!1f#o$V~T98*mQSI{o%I7U)PoX1b5sfOEL*Z>$A?1xg9U#@BS8xdH!b ztEAW*q*PVCbzonjaNKvK-b~wv>Mqfq&2=nmt}mqKj|^Q@TiLV$QHQJ3YGe`NNZZN=1Jdxd zxFbVX*Mjy`%aOmDD$pN7qzh5s^Y#L3yt72!sMt6YzE<~6!p>QhO&buEZ?AKutJ82P zeI_JScQx46{uN9cT2zVXv>LfOdUbvUgQ0aHVKvxbf6$)FsriF*r*X_NMPY z&=8l>XF@`C1GAQvR4{F5QTg_k-lDTPE_LZlog?l^gAnOn5>*QC0q&e4g-E+cROg6Y zX;MzHdlc1@UCid(N~MiUqDr~he^*e;IU+rxb}@I(g|r?;wWM>zJ!zFn8<#|t@_T?g zr)W7xq(@Zeh>dAb*CVQyY{bUsilmK8ib^>;Z*;YmBhsU2BX<922<*`%OZo>b&6G&6 zzf;lDZO>|+m%;{SEq1UEsHEHTr)hBdJ>^nVu}xhih&1Wm!|6|vJg`kg$dRr;=$@~V z2ev6kALt&=!6`9mvT6`uO1b2LZ5|6b(w)LH*hKQcHsyTw+tcdgP6k&!UM^u^o5wPP8QyS>P(R^uuVnCk*+i4o=*}6wyEVC-d@p&RY>=q zyR@cA64>UwkR#pJhF*C87!|D zFiaIPi2Ol}d&cwq%KIt za-QshT#9PhD3R_Kr4j(PDFHdseFZ;6N&aGQkq{dSa_BN$l)#N)j8p+Yx>xx}Fk-cm zR@){&f~bmNY^ee{bhTVm!M#}src2l4mkF?+Ltem4cpcm;VPs<<*V0-M6v7=rx>}3T z(ly~_0_>}!NAfWmu1RhNQ8$)CV{z?L z=m2-M5R8+q2`m#}Z$vF5CaoX5nSc6z!0(G~eMJ-PPRFhd^{g5(Y3o;Q)SlA~Jqr;N z^)!ek)3H}K1pldCGXYIZcaact))BmldOu->H&IW6wfry^@vmzO{!_iJ1oSc86)Ma@ zN6><`LT#h%E2Pb={E3vXqjVauJRuGPQ9O+qLC z1|&J%#Jd!f-HJVn|F%BhzogwsMqAUJqS5Sp1Wi0Ae>G1XZGr`Ywc%k*;lHy9_yZeg zm7sIW9TeMYTjC~|lfRBc4mGJ_LD{z0gZ%fGgTJ`3J(yLxc`FhY-fGwq;^ePjz&LYD zu^>7ZH_X4W5GrD;XjP%P?*^9OG>%{JGQhAd@E?ME?N%6H1^Wyp2{N`k%U&cH(q1 zd7S)NbIlPZ%t#PZF2O%187f8=;?!b_@Afap>0`n;`BR4K{wBtF5QF;RAC(Ce<7;Vk zz@Q%YbWu(d6T`_Lnbm4*GE50#;wk(y6QE+sW}GG%*Xg!a=aicaPJUp7)6JYdF^JJE z_=m@#V&ZibcC>wZ-&_t~qgHf3z~ktqWp0Zu%A%DvG;qW3A4bVLW2a z8gHvRn1hxEHN#sTo92X;rF(Ol17pxN2MzW_xjEv7ATabnUlf6s8@A_<08h*{N5op8 z%Ith+5Iiq>X&Mz;?p&ik3t*RAv-716NH!a82?9(X^hFV9*|JZ6C7Ajt$^m`k*h0KuezZ;TyocUi8v5DzrR&^NELh>4Ux~0xiYO`#yF9`dBY| zX(lQZJ$Ca6hD({(d{+>P^2Cqb050{eXJ*nu(PKBCV7Qcd&36T%C{O&@4d7DmdS)gq z6g_tH35H9V*L+tHit@yd-2g82u4iV_LeXP4pJ2F@dChkPp(s!M*bU%P?|Nn?EfhU= z^9hDanb&+*5Q>VMSAO6I^qJoE%v!Y2^}x+15^mHwN&5i|^H5Phc9adt)tN zQ=Ja(y~USI*K0Q;ty8`+ZVGgQU-A;}k?HKY_34do%x7*X_2c&(=p(22i*0@NkNE1Z zEy<_xk9;1}MV+qEOnCK+3c#C7I1Nre)@L+4-J6*ZxY~!6m}}_?e#Wy2tLRygne$=q zXOt)JkYGPe@8Y(9t94YclZ8sGlvP6=BH zReKuG*+A=9r}5j~;VDTg;Wej_Ai1JwktI>+7k;OnCSPT9-YI55B|G{;h{Y@%$8Ef>J3bJhpQp8|7UL?@CZM9A*pW52Ap@eg(ru8=LYIK{7(6)IyaCT$PMHM zas#=6+(2$1H;^014de!L1G$0RKyDy6kQ>Mi /* required for all Windows applications */ +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "winboard.h" +#include "frontend.h" +#include "backend.h" + +#include "wsnap.h" + +VOID EngineOutputPopUp(); +VOID EngineOutputPopDown(); +BOOL EngineOutputIsUp(); + +#define SHOW_PONDERING + +/* Imports from backend.c */ +char * SavePart(char *str); + +/* Imports from winboard.c */ +extern HWND engineOutputDialog; +extern BOOLEAN engineOutputDialogUp; + +extern HINSTANCE hInst; +extern HWND hwndMain; + +extern WindowPlacement wpEngineOutput; + +/* Module variables */ +#define H_MARGIN 2 +#define V_MARGIN 2 +#define LABEL_V_DISTANCE 1 /* Distance between label and memo */ +#define SPLITTER_SIZE 4 /* Distance between first memo and second label */ + +#define ICON_SIZE 14 + +#define STATE_UNKNOWN -1 +#define STATE_THINKING 0 +#define STATE_IDLE 1 +#define STATE_PONDERING 2 +#define STATE_ANALYZING 3 + +static int windowMode = 1; + +static BOOL needInit = TRUE; + +static HICON hiColorBlack = NULL; +static HICON hiColorWhite = NULL; +static HICON hiColorUnknown = NULL; +static HICON hiClear = NULL; +static HICON hiPondering = NULL; +static HICON hiThinking = NULL; +static HICON hiAnalyzing = NULL; + +static int lastDepth[2] = { -1, -1 }; +static int lastForwardMostMove[2] = { -1, -1 }; +static int engineState[2] = { -1, -1 }; + +typedef struct { + HWND hColorIcon; + HWND hLabel; + HWND hStateIcon; + HWND hStateData; + HWND hLabelNPS; + HWND hMemo; + char * name; + int which; + int depth; + unsigned long nodes; + int score; + int time; + char * pv; + char * hint; + int an_move_index; + int an_move_count; +} EngineOutputData; + +static HICON LoadIconEx( int id ) +{ + return LoadImage( hInst, MAKEINTRESOURCE(id), IMAGE_ICON, ICON_SIZE, ICON_SIZE, 0 ); +} + +static VOID InitializeEngineOutput() +{ + if( needInit ) { + hiColorBlack = LoadIconEx( IDI_BLACK_14 ); + hiColorWhite = LoadIconEx( IDI_WHITE_14 ); + hiColorUnknown = LoadIconEx( IDI_UNKNOWN_14 ); + hiClear = LoadIconEx( IDI_TRANS_14 ); + hiPondering = LoadIconEx( IDI_PONDER_14 ); + hiThinking = LoadIconEx( IDI_CLOCK_14 ); + hiAnalyzing = LoadIconEx( IDI_ANALYZE2_14 ); + needInit = FALSE; + } +} + +static VOID SetControlPos( HWND hDlg, int id, int x, int y, int width, int height ) +{ + HWND hControl = GetDlgItem( hDlg, id ); + + SetWindowPos( hControl, HWND_TOP, x, y, width, height, SWP_NOZORDER ); +} + +#define HIDDEN_X 20000 +#define HIDDEN_Y 20000 + +static VOID HideControl( HWND hDlg, int id ) +{ + HWND hControl = GetDlgItem( hDlg, id ); + RECT rc; + + GetWindowRect( hControl, &rc ); + + /* + Avoid hiding an already hidden control, because that causes many + unnecessary WM_ERASEBKGND messages! + */ + if( rc.left != HIDDEN_X || rc.top != HIDDEN_Y ) { + SetControlPos( hDlg, id, 20000, 20000, 100, 100 ); + } +} + +static int GetControlWidth( HWND hDlg, int id ) +{ + RECT rc; + + GetWindowRect( GetDlgItem( hDlg, id ), &rc ); + + return rc.right - rc.left; +} + +static int GetControlHeight( HWND hDlg, int id ) +{ + RECT rc; + + GetWindowRect( GetDlgItem( hDlg, id ), &rc ); + + return rc.bottom - rc.top; +} + +static int GetHeaderHeight() +{ + int result = GetControlHeight( engineOutputDialog, IDC_EngineLabel1 ); + + if( result < ICON_SIZE ) result = ICON_SIZE; + + return result; +} + +#define ENGINE_COLOR_WHITE 'w' +#define ENGINE_COLOR_BLACK 'b' +#define ENGINE_COLOR_UNKNOWN ' ' + +char GetEngineColor( int which ) +{ + char result = ENGINE_COLOR_UNKNOWN; + + if( which == 0 || which == 1 ) { + ChessProgramState * cps; + + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + result = ENGINE_COLOR_BLACK; + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + result = ENGINE_COLOR_WHITE; + break; + case AnalyzeMode: + case AnalyzeFile: + result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; + break; + case TwoMachinesPlay: + cps = (which == 0) ? &first : &second; + result = cps->twoMachinesColor[0]; + result = result == 'w' ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; + break; + } + } + + return result; +} + +char GetActiveEngineColor() +{ + char result = ENGINE_COLOR_UNKNOWN; + + if( gameMode == TwoMachinesPlay ) { + result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; + } + + return result; +} + +static int IsEnginePondering( int which ) +{ + int result = FALSE; + + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + if( WhiteOnMove(forwardMostMove) ) result = TRUE; + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + if( ! WhiteOnMove(forwardMostMove) ) result = TRUE; + break; + case TwoMachinesPlay: + if( GetActiveEngineColor() != ENGINE_COLOR_UNKNOWN ) { + if( GetEngineColor( which ) != GetActiveEngineColor() ) result = TRUE; + } + break; + } + + return result; +} + +static VOID PositionControlSet( HWND hDlg, int x, int y, int clientWidth, int memoHeight, int idColor, int idEngineLabel, int idNPS, int idMemo, int idStateIcon, int idStateData ) +{ + int label_x = x + ICON_SIZE + H_MARGIN; + int label_h = GetControlHeight( hDlg, IDC_EngineLabel1 ); + int label_y = y + ICON_SIZE - label_h; + int nps_w = GetControlWidth( hDlg, IDC_Engine1_NPS ); + int nps_x = clientWidth - H_MARGIN - nps_w; + int state_data_w = GetControlWidth( hDlg, IDC_StateData1 ); + int state_data_x = nps_x - H_MARGIN - state_data_w; + int state_icon_x = state_data_x - ICON_SIZE - 2; + int max_w = clientWidth - 2*H_MARGIN; + int memo_y = y + ICON_SIZE + LABEL_V_DISTANCE; + + SetControlPos( hDlg, idColor, x, y, ICON_SIZE, ICON_SIZE ); + SetControlPos( hDlg, idEngineLabel, label_x, label_y, state_icon_x - label_x, label_h ); + SetControlPos( hDlg, idStateIcon, state_icon_x, y, ICON_SIZE, ICON_SIZE ); + SetControlPos( hDlg, idStateData, state_data_x, label_y, state_data_w, label_h ); + SetControlPos( hDlg, idNPS, nps_x, label_y, nps_w, label_h ); + SetControlPos( hDlg, idMemo, x, memo_y, max_w, memoHeight ); +} + +static VOID ResizeWindowControls( HWND hDlg, int mode ) +{ + RECT rc; + int headerHeight = GetHeaderHeight(); + int labelHeight = GetControlHeight( hDlg, IDC_EngineLabel1 ); + int labelOffset = H_MARGIN + ICON_SIZE + H_MARGIN; + int labelDeltaY = ICON_SIZE - labelHeight; + int clientWidth; + int clientHeight; + int maxControlWidth; + int npsWidth; + + /* Initialize variables */ + GetClientRect( hDlg, &rc ); + + clientWidth = rc.right - rc.left; + clientHeight = rc.bottom - rc.top; + + maxControlWidth = clientWidth - 2*H_MARGIN; + + npsWidth = GetControlWidth( hDlg, IDC_Engine1_NPS ); + + /* Resize controls */ + if( mode == 0 ) { + /* One engine */ + PositionControlSet( hDlg, H_MARGIN, V_MARGIN, + clientWidth, + clientHeight - V_MARGIN - LABEL_V_DISTANCE - headerHeight- V_MARGIN, + IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); + + /* Hide controls for the second engine */ + HideControl( hDlg, IDC_Color2 ); + HideControl( hDlg, IDC_EngineLabel2 ); + HideControl( hDlg, IDC_StateIcon2 ); + HideControl( hDlg, IDC_StateData2 ); + HideControl( hDlg, IDC_Engine2_NPS ); + HideControl( hDlg, IDC_EngineMemo2 ); + SendDlgItemMessage( hDlg, IDC_EngineMemo2, WM_SETTEXT, 0, (LPARAM) "" ); + /* TODO: we should also hide/disable them!!! what about tab stops?!?! */ + } + else { + /* Two engines */ + int memo_h = (clientHeight - headerHeight*2 - V_MARGIN*2 - LABEL_V_DISTANCE*2 - SPLITTER_SIZE) / 2; + int header1_y = V_MARGIN; + int header2_y = V_MARGIN + headerHeight + LABEL_V_DISTANCE + memo_h + SPLITTER_SIZE; + + PositionControlSet( hDlg, H_MARGIN, header1_y, clientWidth, memo_h, + IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); + + PositionControlSet( hDlg, H_MARGIN, header2_y, clientWidth, memo_h, + IDC_Color2, IDC_EngineLabel2, IDC_Engine2_NPS, IDC_EngineMemo2, IDC_StateIcon2, IDC_StateData2 ); + } + + InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo1), NULL, FALSE ); + InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo2), NULL, FALSE ); +} + +static VOID SetDisplayMode( int mode ) +{ + if( windowMode != mode ) { + windowMode = mode; + + ResizeWindowControls( engineOutputDialog, mode ); + } +} + +static VOID VerifyDisplayMode() +{ + int mode; + + /* Get proper mode for current game */ + switch( gameMode ) { + case AnalyzeMode: + case AnalyzeFile: + case MachinePlaysWhite: + case MachinePlaysBlack: + case IcsPlayingWhite: + case IcsPlayingBlack: + mode = 0; + break; + case TwoMachinesPlay: + mode = 1; + break; + default: + /* Do not change */ + return; + } + + SetDisplayMode( mode ); +} + +static VOID InsertIntoMemo( HWND hMemo, char * text ) +{ + SendMessage( hMemo, EM_SETSEL, 0, 0 ); + + SendMessage( hMemo, EM_REPLACESEL, (WPARAM) FALSE, (LPARAM) text ); +} + +static VOID SetIcon( HWND hControl, HICON hIcon ) +{ + if( hIcon != NULL ) { + SendMessage( hControl, STM_SETICON, (WPARAM) hIcon, 0 ); + } +} + +static VOID SetEngineColorIcon( HWND hControl, int which ) +{ + char color = GetEngineColor(which); + HICON hicon = NULL; + + if( color == ENGINE_COLOR_BLACK ) + hicon = hiColorBlack; + else if( color == ENGINE_COLOR_WHITE ) + hicon = hiColorWhite; + else + hicon = hiColorUnknown; + + SetIcon( hControl, hicon ); +} + +static SetEngineState( int which, int state, char * state_data ) +{ + int x_which = 1 - which; + HWND hStateIcon = GetDlgItem( engineOutputDialog, which == 0 ? IDC_StateIcon1 : IDC_StateIcon2 ); + HWND hStateData = GetDlgItem( engineOutputDialog, which == 0 ? IDC_StateData1 : IDC_StateData2 ); + + if( engineState[ which ] != state ) { + engineState[ which ] = state; + + switch( state ) { + case STATE_THINKING: + SetIcon( hStateIcon, hiThinking ); + if( engineState[ x_which ] == STATE_THINKING ) { + SetEngineState( x_which, STATE_IDLE, "" ); + } + break; + case STATE_PONDERING: + SetIcon( hStateIcon, hiPondering ); + break; + case STATE_ANALYZING: + SetIcon( hStateIcon, hiAnalyzing ); + break; + default: + SetIcon( hStateIcon, hiClear ); + break; + } + } + + if( state_data != 0 ) { + SetWindowText( hStateData, state_data ); + } +} + +#define MAX_NAME_LENGTH 32 + +static VOID UpdateControls( EngineOutputData * ed ) +{ + BOOL isPondering = FALSE; + + char s_label[MAX_NAME_LENGTH + 32]; + + char * name = ed->name; + + /* Label */ + if( name == 0 || *name == '\0' ) { + name = "?"; + } + + strncpy( s_label, name, MAX_NAME_LENGTH ); + s_label[ MAX_NAME_LENGTH-1 ] = '\0'; + +#ifdef SHOW_PONDERING + if( IsEnginePondering( ed->which ) ) { + char buf[8]; + + buf[0] = '\0'; + + if( ed->hint != 0 && *ed->hint != '\0' ) { + strncpy( buf, ed->hint, sizeof(buf) ); + buf[sizeof(buf)-1] = '\0'; + } + else if( ed->pv != 0 && *ed->pv != '\0' ) { + char * sep = strchr( ed->pv, ' ' ); + int buflen = sizeof(buf); + + if( sep != NULL ) { + buflen = sep - ed->pv + 1; + if( buflen > sizeof(buf) ) buflen = sizeof(buf); + } + + strncpy( buf, ed->pv, buflen ); + buf[ buflen-1 ] = '\0'; + } + + SetEngineState( ed->which, STATE_PONDERING, buf ); + } + else if( gameMode == TwoMachinesPlay ) { + SetEngineState( ed->which, STATE_THINKING, "" ); + } + else if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ) { + char buf[64]; + int time_secs = ed->time / 100; + int time_mins = time_secs / 60; + + buf[0] = '\0'; + + if( ed->an_move_index != 0 && ed->an_move_count != 0 && *ed->hint != '\0' ) { + char mov[16]; + + strncpy( mov, ed->hint, sizeof(mov) ); + mov[ sizeof(mov)-1 ] = '\0'; + + sprintf( buf, "%d/%d: %s [%02d:%02d:%02d]", ed->an_move_index, ed->an_move_count, mov, time_mins / 60, time_mins % 60, time_secs % 60 ); + } + + SetEngineState( ed->which, STATE_ANALYZING, buf ); + } + else { + SetEngineState( ed->which, STATE_IDLE, "" ); + } +#endif + + SetWindowText( ed->hLabel, s_label ); + + s_label[0] = '\0'; + + if( ed->time > 0 && ed->nodes > 0 ) { + unsigned long nps_100 = ed->nodes / ed->time; + + if( nps_100 < 100000 ) { + sprintf( s_label, "NPS: %lu", nps_100 * 100 ); + } + else { + sprintf( s_label, "NPS: %.1fk", nps_100 / 10.0 ); + } + } + + SetWindowText( ed->hLabelNPS, s_label ); + + /* Memo */ + if( ed->pv != 0 && *ed->pv != '\0' ) { + char s_nodes[24]; + char s_score[16]; + char s_time[24]; + char buf[256]; + int buflen; + int time_secs = ed->time / 100; + int time_cent = ed->time % 100; + + /* Nodes */ + if( ed->nodes < 1000000 ) { + sprintf( s_nodes, "%lu", ed->nodes ); + } + else { + sprintf( s_nodes, "%.1fM", ed->nodes / 1000000.0 ); + } + + /* Score */ + if( ed->score > 0 ) { + sprintf( s_score, "+%.2f", ed->score / 100.0 ); + } + else { + sprintf( s_score, "%.2f", ed->score / 100.0 ); + } + + /* Time */ + sprintf( s_time, "%d:%02d.%02d", time_secs / 60, time_secs % 60, time_cent ); + + /* Put all together... */ + sprintf( buf, "%3d\t%s\t%s\t%s\t", ed->depth, s_score, s_nodes, s_time ); + + /* Add PV */ + buflen = strlen(buf); + + strncpy( buf + buflen, ed->pv, sizeof(buf) - buflen ); + + buf[ sizeof(buf) - 3 ] = '\0'; + + strcat( buf + buflen, "\r\n" ); + + /* Update memo */ + InsertIntoMemo( ed->hMemo, buf ); + } + + /* Colors */ + SetEngineColorIcon( ed->hColorIcon, ed->which ); +} + +LRESULT CALLBACK EngineOutputProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) +{ + static SnapData sd; + + switch (message) { + case WM_INITDIALOG: + if( engineOutputDialog == NULL ) { + engineOutputDialog = hDlg; + + RestoreWindowPlacement( hDlg, &wpEngineOutput ); /* Restore window placement */ + + ResizeWindowControls( hDlg, windowMode ); + + SetEngineState( 0, STATE_IDLE, "" ); + SetEngineState( 1, STATE_IDLE, "" ); + } + + return FALSE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + EndDialog(hDlg, TRUE); + return TRUE; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + return TRUE; + + default: + break; + } + + break; + + case WM_GETMINMAXINFO: + { + MINMAXINFO * mmi = (MINMAXINFO *) lParam; + + mmi->ptMinTrackSize.x = 100; + mmi->ptMinTrackSize.y = 160; + } + break; + + case WM_CLOSE: + EngineOutputPopDown(); + break; + + case WM_SIZE: + ResizeWindowControls( hDlg, windowMode ); + break; + + case WM_ENTERSIZEMOVE: + return OnEnterSizeMove( &sd, hDlg, wParam, lParam ); + + case WM_SIZING: + return OnSizing( &sd, hDlg, wParam, lParam ); + + case WM_MOVING: + return OnMoving( &sd, hDlg, wParam, lParam ); + + case WM_EXITSIZEMOVE: + return OnExitSizeMove( &sd, hDlg, wParam, lParam ); + } + + return FALSE; +} + +VOID EngineOutputPopUp() +{ + FARPROC lpProc; + + if( needInit ) { + InitializeEngineOutput(); + } + + CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_CHECKED); + + if( engineOutputDialog ) { + SendMessage( engineOutputDialog, WM_INITDIALOG, 0, 0 ); + + if( ! engineOutputDialogUp ) { + ShowWindow(engineOutputDialog, SW_SHOW); + } + } + else { + lpProc = MakeProcInstance( (FARPROC) EngineOutputProc, hInst ); + + /* Note to self: dialog must have the WS_VISIBLE style set, otherwise it's not shown! */ + CreateDialog( hInst, MAKEINTRESOURCE(DLG_EngineOutput), hwndMain, (DLGPROC)lpProc ); + + FreeProcInstance(lpProc); + } + + engineOutputDialogUp = TRUE; + ShowThinkingEvent(); // [HGM] thinking: might need to prompt engine for thinking output +} + +VOID EngineOutputPopDown() +{ + CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_UNCHECKED); + + if( engineOutputDialog ) { + ShowWindow(engineOutputDialog, SW_HIDE); + } + + engineOutputDialogUp = FALSE; + ShowThinkingEvent(); // [HGM] thinking: might need to shut off thinking output +} + +BOOL EngineOutputIsUp() +{ + return engineOutputDialogUp; +} + +VOID EngineOutputUpdate( FrontEndProgramStats * stats ) +{ + EngineOutputData ed; + BOOL clearMemo = FALSE; + int which; + int depth; + + if( stats == 0 ) { + SetEngineState( 0, STATE_IDLE, "" ); + SetEngineState( 1, STATE_IDLE, "" ); + return; + } + + which = stats->which; + depth = stats->depth; + + if( which < 0 || which > 1 || depth < 0 || stats->time < 0 || stats->pv == 0 ) { + return; + } + + if( engineOutputDialog == NULL ) { + return; + } + + VerifyDisplayMode(); + + ed.which = which; + ed.depth = depth; + ed.nodes = stats->nodes; + ed.score = stats->score; + ed.time = stats->time; + ed.pv = stats->pv; + ed.hint = stats->hint; + ed.an_move_index = stats->an_move_index; + ed.an_move_count = stats->an_move_count; + + /* Get target control */ + if( which == 0 ) { + ed.hColorIcon = GetDlgItem( engineOutputDialog, IDC_Color1 ); + ed.hLabel = GetDlgItem( engineOutputDialog, IDC_EngineLabel1 ); + ed.hStateIcon = GetDlgItem( engineOutputDialog, IDC_StateIcon1 ); + ed.hStateData = GetDlgItem( engineOutputDialog, IDC_StateData1 ); + ed.hLabelNPS = GetDlgItem( engineOutputDialog, IDC_Engine1_NPS ); + ed.hMemo = GetDlgItem( engineOutputDialog, IDC_EngineMemo1 ); + ed.name = first.tidy; + } + else { + ed.hColorIcon = GetDlgItem( engineOutputDialog, IDC_Color2 ); + ed.hLabel = GetDlgItem( engineOutputDialog, IDC_EngineLabel2 ); + ed.hStateIcon = GetDlgItem( engineOutputDialog, IDC_StateIcon2 ); + ed.hStateData = GetDlgItem( engineOutputDialog, IDC_StateData2 ); + ed.hLabelNPS = GetDlgItem( engineOutputDialog, IDC_Engine2_NPS ); + ed.hMemo = GetDlgItem( engineOutputDialog, IDC_EngineMemo2 ); + ed.name = second.tidy; + } + + /* Clear memo if needed */ + if( lastDepth[which] > depth || (lastDepth[which] == depth && depth <= 1) ) { + clearMemo = TRUE; + } + + if( lastForwardMostMove[which] != forwardMostMove ) { + clearMemo = TRUE; + } + + if( clearMemo ) { + SendMessage( ed.hMemo, WM_SETTEXT, 0, (LPARAM) "" ); + } + + /* Update */ + lastDepth[which] = depth; + lastForwardMostMove[which] = forwardMostMove; + + if( ed.pv != 0 && ed.pv[0] == ' ' ) { + if( strncmp( ed.pv, " no PV", 6 ) == 0 ) { /* Hack on hack! :-O */ + ed.pv = ""; + } + } + + UpdateControls( &ed ); +} diff --git a/winboard/winboard.c b/winboard/winboard.c index 139a984..a70f16b 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -86,7 +86,7 @@ #include "wsnap.h" -void InitEngineUCI( const char * iniDir, ChessProgramState * cps ); +//void InitEngineUCI( const char * iniDir, ChessProgramState * cps ); int myrandom(void); void mysrandom(unsigned int seed); @@ -598,8 +598,8 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) InitBackEnd1(); - InitEngineUCI( installDir, &first ); - InitEngineUCI( installDir, &second ); +// InitEngineUCI( installDir, &first ); // [HGM] incorporated in InitBackEnd1() +// InitEngineUCI( installDir, &second ); /* Create a main window for this application instance. */ hwnd = CreateWindow(szAppName, szTitle, @@ -1173,6 +1173,8 @@ ArgDescriptor argDescriptors[] = { { "flipBlack", ArgBoolean, (LPVOID) &appData.upsideDown, TRUE }, { "allWhite", ArgBoolean, (LPVOID) &appData.allWhite, TRUE }, { "alphaRank", ArgBoolean, (LPVOID) &appData.alphaRank, FALSE }, + { "firstAlphaRank", ArgBoolean, (LPVOID) &first.alphaRank, FALSE }, + { "secondAlphaRank", ArgBoolean, (LPVOID) &second.alphaRank, FALSE }, { "testClaims", ArgBoolean, (LPVOID) &appData.testClaims, TRUE }, { "checkMates", ArgBoolean, (LPVOID) &appData.checkMates, TRUE }, { "materialDraws", ArgBoolean, (LPVOID) &appData.materialDraws, TRUE }, @@ -1182,6 +1184,10 @@ ArgDescriptor argDescriptors[] = { { "autoKibitz", ArgTrue, (LPVOID) &appData.autoKibitz, FALSE }, { "engineDebugOutput", ArgInt, (LPVOID) &appData.engineComments, FALSE }, { "userName", ArgString, (LPVOID) &appData.userName, FALSE }, + { "rewindIndex", ArgInt, (LPVOID) &appData.rewindIndex, FALSE }, + { "sameColorGames", ArgInt, (LPVOID) &appData.sameColorGames, FALSE }, + { "smpCores", ArgInt, (LPVOID) &appData.smpCores, TRUE }, + { "egtFormats", ArgString, (LPVOID) &appData.egtFormats, TRUE }, #ifdef ZIPPY { "zippyTalk", ArgBoolean, (LPVOID) &appData.zippyTalk, FALSE }, @@ -1922,7 +1928,8 @@ InitAppData(LPSTR lpCmdLine) appData.firstNPS = -1; // [HGM] nps: use wall-clock time appData.secondNPS = -1; appData.engineComments = 1; - + appData.smpCores = 1; // [HGM] SMP: max nr of cores + appData.egtFormats = ""; #ifdef ZIPPY appData.zippyTalk = ZIPPY_TALK; @@ -2365,6 +2372,12 @@ enum { PM_WH = (int) WhiteNightrider, PM_WA = (int) WhiteAngel, PM_WC = (int) WhiteMarshall, + PM_WAB = (int) WhiteCardinal, + PM_WD = (int) WhiteDragon, + PM_WL = (int) WhiteLance, + PM_WS = (int) WhiteCobra, + PM_WV = (int) WhiteFalcon, + PM_WSG = (int) WhiteSilver, PM_WG = (int) WhiteGrasshopper, PM_WK = (int) WhiteKing, PM_BP = (int) BlackPawn, @@ -2382,6 +2395,12 @@ enum { PM_BA = (int) BlackAngel, PM_BC = (int) BlackMarshall, PM_BG = (int) BlackGrasshopper, + PM_BAB = (int) BlackCardinal, + PM_BD = (int) BlackDragon, + PM_BL = (int) BlackLance, + PM_BS = (int) BlackCobra, + PM_BV = (int) BlackFalcon, + PM_BSG = (int) BlackSilver, PM_BK = (int) BlackKing }; @@ -2480,13 +2499,12 @@ static void CreatePieceMaskFromFont( HDC hdc_window, HDC hdc, int index ) POINT pt; int backColor = whitePieceColor; int foreColor = blackPieceColor; - int shapeIndex = index < 6 ? index+6 : index; - if( index < 6 && appData.fontBackColorWhite != appData.fontForeColorWhite ) { + if( index < (int)BlackPawn && appData.fontBackColorWhite != appData.fontForeColorWhite ) { backColor = appData.fontBackColorWhite; foreColor = appData.fontForeColorWhite; } - else if( index >= 6 && appData.fontBackColorBlack != appData.fontForeColorBlack ) { + else if( index >= (int)BlackPawn && appData.fontBackColorBlack != appData.fontForeColorBlack ) { backColor = appData.fontBackColorBlack; foreColor = appData.fontForeColorBlack; } @@ -2516,7 +2534,11 @@ static void CreatePieceMaskFromFont( HDC hdc_window, HDC hdc, int index ) SelectObject( hdc, GetStockObject(WHITE_BRUSH) ); /* Step 3: the area outside the piece is filled with white */ - FloodFill( hdc, 0, 0, chroma ); +// FloodFill( hdc, 0, 0, chroma ); + ExtFloodFill( hdc, 0, 0, 0, FLOODFILLSURFACE ); + ExtFloodFill( hdc, 0, squareSize-1, 0, FLOODFILLSURFACE ); // [HGM] fill from all 4 corners, for if piece too big + ExtFloodFill( hdc, squareSize-1, 0, 0, FLOODFILLSURFACE ); + ExtFloodFill( hdc, squareSize-1, squareSize-1, 0, FLOODFILLSURFACE ); SelectObject( hdc, GetStockObject(BLACK_BRUSH) ); /* Step 4: this is the tricky part, the area inside the piece is filled with black, @@ -2524,7 +2546,23 @@ static void CreatePieceMaskFromFont( HDC hdc_window, HDC hdc, int index ) There should be a better way to do this... if we could create a region or path from the fill operation we would be fine for example. */ - FloodFill( hdc, squareSize / 2, squareSize / 2, RGB(0xFF,0xFF,0xFF) ); +// FloodFill( hdc, squareSize / 2, squareSize / 2, RGB(0xFF,0xFF,0xFF) ); + ExtFloodFill( hdc, squareSize / 2, squareSize / 2, RGB(0xFF,0xFF,0xFF), FLOODFILLBORDER ); + + { /* [HGM] shave off edges of mask, in an attempt to correct for the fact that FloodFill does not work correctly under Win XP */ + HDC dc2 = CreateCompatibleDC( hdc_window ); + HBITMAP bm2 = CreateCompatibleBitmap( hdc_window, squareSize, squareSize ); + + SelectObject( dc2, bm2 ); + BitBlt( dc2, 0, 0, squareSize, squareSize, hdc, 0, 0, SRCCOPY ); // make copy + BitBlt( hdc, 0, 1, squareSize-2, squareSize-2, dc2, 1, 1, SRCPAINT ); + BitBlt( hdc, 2, 1, squareSize-2, squareSize-2, dc2, 1, 1, SRCPAINT ); + BitBlt( hdc, 1, 0, squareSize-2, squareSize-2, dc2, 1, 1, SRCPAINT ); + BitBlt( hdc, 1, 2, squareSize-2, squareSize-2, dc2, 1, 1, SRCPAINT ); + + DeleteDC( dc2 ); + DeleteObject( bm2 ); + } SetTextColor( hdc, 0 ); /* @@ -2610,6 +2648,7 @@ static int TranslatePieceToFontPiece( int piece ) return PM_WQ; case WhiteKing: return PM_WK; + case BlackAngel: return PM_BA; case BlackMarshall: @@ -2630,6 +2669,19 @@ static int TranslatePieceToFontPiece( int piece ) return PM_BG; case BlackMan: return PM_BM; + case BlackSilver: + return PM_BSG; + case BlackLance: + return PM_BL; + case BlackFalcon: + return PM_BV; + case BlackCobra: + return PM_BS; + case BlackCardinal: + return PM_BAB; + case BlackDragon: + return PM_BD; + case WhiteAngel: return PM_WA; case WhiteMarshall: @@ -2650,6 +2702,18 @@ static int TranslatePieceToFontPiece( int piece ) return PM_WG; case WhiteMan: return PM_WM; + case WhiteSilver: + return PM_WSG; + case WhiteLance: + return PM_WL; + case WhiteFalcon: + return PM_WV; + case WhiteCobra: + return PM_WS; + case WhiteCardinal: + return PM_WAB; + case WhiteDragon: + return PM_WD; } return 0; @@ -2682,7 +2746,7 @@ void CreatePiecesFromFont() DeleteObject( hPieceFont ); } else { - for( i=0; i<12; i++ ) { + for( i=0; i<=(int)BlackKing; i++ ) { hPieceMask[i] = NULL; hPieceFace[i] = NULL; } @@ -2747,7 +2811,7 @@ void CreatePiecesFromFont() /* Create bitmaps */ hfont_old = SelectObject( hdc, hPieceFont ); - +#if 0 CreatePieceMaskFromFont( hdc_window, hdc, PM_WP ); CreatePieceMaskFromFont( hdc_window, hdc, PM_WN ); CreatePieceMaskFromFont( hdc_window, hdc, PM_WB ); @@ -2760,7 +2824,7 @@ void CreatePiecesFromFont() CreatePieceMaskFromFont( hdc_window, hdc, PM_BR ); CreatePieceMaskFromFont( hdc_window, hdc, PM_BQ ); CreatePieceMaskFromFont( hdc_window, hdc, PM_BK ); -#ifdef FAIRY + CreatePieceMaskFromFont( hdc_window, hdc, PM_WA ); CreatePieceMaskFromFont( hdc_window, hdc, PM_WC ); CreatePieceMaskFromFont( hdc_window, hdc, PM_WF ); @@ -2771,6 +2835,12 @@ void CreatePiecesFromFont() CreatePieceMaskFromFont( hdc_window, hdc, PM_WO ); CreatePieceMaskFromFont( hdc_window, hdc, PM_WG ); CreatePieceMaskFromFont( hdc_window, hdc, PM_WM ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WSG ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WV ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WAB ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WD ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WL ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WS ); CreatePieceMaskFromFont( hdc_window, hdc, PM_BA ); CreatePieceMaskFromFont( hdc_window, hdc, PM_BC ); CreatePieceMaskFromFont( hdc_window, hdc, PM_BF ); @@ -2781,8 +2851,17 @@ void CreatePiecesFromFont() CreatePieceMaskFromFont( hdc_window, hdc, PM_BO ); CreatePieceMaskFromFont( hdc_window, hdc, PM_BG ); CreatePieceMaskFromFont( hdc_window, hdc, PM_BM ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BSG ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BV ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BAB ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BD ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BL ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BS ); +#else + for(i=(int)WhitePawn; i<(int)EmptySquare; i++) /* [HGM] made a loop for this */ + if(PieceToChar((ChessSquare)i) != '.') /* skip unused pieces */ + CreatePieceMaskFromFont( hdc_window, hdc, i ); #endif - SelectObject( hdc, hfont_old ); fontBitmapSquareSize = squareSize; @@ -2900,9 +2979,10 @@ ResizeBoard(int newSizeX, int newSizeY, int flags) if (IsIconic(hwndMain)) return; if (recurse > 0) return; recurse++; - while (newSize > 0 && - (newSizeX < sizeInfo[newSize].cliWidth || - newSizeY < sizeInfo[newSize].cliHeight)) { + while (newSize > 0) { + InitDrawingSizes(newSize, 0); + if(newSizeX >= sizeInfo[newSize].cliWidth || + newSizeY >= sizeInfo[newSize].cliHeight) break; newSize--; } boardSize = newSize; @@ -3135,6 +3215,7 @@ InitDrawingSizes(BoardSize boardSize, int flags) } } + fontBitmapSquareSize = 0; /* [HGM] render: make sure pieces will be recreated, as we might need others now */ // Orthodox Chess pieces pieceBitmap[0][WhitePawn] = DoLoadBitmap(hInst, "p", squareSize, "s"); pieceBitmap[0][WhiteKnight] = DoLoadBitmap(hInst, "n", squareSize, "s"); @@ -3945,7 +4026,10 @@ DrawBoardOnDC(HDC hdc, Board board, HDC tmphdc) /* [AS] Initialize background textures if needed */ if( liteBackTexture != NULL || darkBackTexture != NULL ) { - if( backTextureSquareSize != squareSize ) { + static int backTextureBoardSize; /* [HGM] boardsize: also new texture if board format changed */ + if( backTextureSquareSize != squareSize + || backTextureBoardSize != BOARD_WIDTH+BOARD_SIZE*BOARD_HEIGHT) { + backTextureBoardSize = BOARD_WIDTH+BOARD_SIZE*BOARD_HEIGHT; backTextureSquareSize = squareSize; RebuildTextureSquareInfo(); } @@ -3987,9 +4071,9 @@ DrawBoardOnDC(HDC hdc, Board board, HDC tmphdc) } } if(column == BOARD_LEFT-1 ) /* left align */ - DisplayHoldingsCount(hdc, x, y, 0, (int) board[row][column]); + DisplayHoldingsCount(hdc, x, y, flipView, (int) board[row][column]); else if( column == BOARD_RGHT) /* right align */ - DisplayHoldingsCount(hdc, x, y, 1, (int) board[row][column]); + DisplayHoldingsCount(hdc, x, y, !flipView, (int) board[row][column]); else if (appData.monoMode) { if (piece == EmptySquare) { @@ -4357,7 +4441,6 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) boardRect.right - boardRect.left, boardRect.bottom - boardRect.top, tmphdc, boardRect.left, boardRect.top, SRCCOPY); - if(saveDiagFlag) { BITMAP b; int i, j, m, w, wb, fac=0; char pData[1000000]; BITMAPINFOHEADER bih; int color[16], nrColors=0; @@ -4586,7 +4669,7 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) BOOLEAN needsRedraw = FALSE; BOOLEAN saveAnimate; BOOLEAN forceFullRepaint = IsFullRepaintPreferrable(); /* [AS] */ - static BOOLEAN sameAgain = FALSE; + static BOOLEAN sameAgain = FALSE, promotionChoice = FALSE; ChessMove moveType; if (recursive) { @@ -4614,6 +4697,25 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) switch (message) { case WM_LBUTTONDOWN: + if(promotionChoice) { // we are waiting for a click to indicate promotion piece + promotionChoice = FALSE; // only one chance: if click not OK it is interpreted as cancel + if(appData.debugMode) fprintf(debugFP, "promotion click, x=%d, y=%d\n", x, y); + if(gameInfo.holdingsWidth && + (WhiteOnMove(currentMove) + ? x == BOARD_WIDTH-1 && y < gameInfo.holdingsSize && y > 0 + : x == 0 && y >= BOARD_HEIGHT - gameInfo.holdingsSize && y < BOARD_HEIGHT-1) ) { + // click in right holdings, for determining promotion piece + ChessSquare p = boards[currentMove][y][x]; + if(appData.debugMode) fprintf(debugFP, "square contains %d\n", (int)p); + if(p != EmptySquare) { + FinishMove(WhitePromotionQueen, fromX, fromY, toX, toY, ToLower(PieceToChar(p))); + fromX = fromY = -1; + break; + } + } + DrawPosition(FALSE, boards[currentMove]); + break; + } ErrorPopDown(); sameAgain = FALSE; if (y == -2) { @@ -4670,6 +4772,12 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* [HGM] UserMoveEvent requires two calls now, to make sure move is legal before showing promotion popup */ moveType = UserMoveTest(fromX, fromY, toX, toY, NULLCHAR); + if(moveType == AmbiguousMove) { /* [HGM] Edit-Position move executed */ + fromX = fromY = -1; + ClearHighlights(); + DrawPosition(FALSE, boards[currentMove]); + break; + } else if(moveType != ImpossibleMove) { /* [HGM] We use PromotionToKnight in Shogi to indicate frorced promotion */ if (moveType == WhitePromotionKnight || moveType == BlackPromotionKnight || @@ -4686,6 +4794,16 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) DrawPosition(forceFullRepaint || FALSE, NULL); /* [HGM] Popup calls FinishMove now. If promotion to Q is legal, all are legal! */ + if(gameInfo.variant == VariantSuper) + { ChessSquare p = boards[currentMove][fromY][fromX], q = boards[currentMove][toY][toX]; + // kludge to temporarily execute move on display, wthout promotng yet + promotionChoice = TRUE; + boards[currentMove][fromY][fromX] = EmptySquare; // move Pawn to 8th rank + boards[currentMove][toY][toX] = p; + DrawPosition(FALSE, boards[currentMove]); + boards[currentMove][fromY][fromX] = p; // take back, but display stays + boards[currentMove][toY][toX] = q; + } else PromotionPopup(hwnd); } else { /* not a promotion */ if (appData.animate || appData.highlightLastMove) { @@ -4694,6 +4812,7 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ClearHighlights(); } FinishMove(moveType, fromX, fromY, toX, toY, NULLCHAR); + fromX = fromY = -1; if (appData.animate && !appData.highlightLastMove) { ClearHighlights(); DrawPosition(forceFullRepaint || FALSE, NULL); @@ -4758,6 +4877,12 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) saveAnimate = appData.animate; /* sorry, Hawk :) */ appData.animate = appData.animate && !appData.animateDragging; moveType = UserMoveTest(fromX, fromY, toX, toY, NULLCHAR); + if(moveType == AmbiguousMove) { /* [HGM] Edit-Position move executed */ + fromX = fromY = -1; + ClearHighlights(); + DrawPosition(FALSE, boards[currentMove]); + break; + } else if(moveType != ImpossibleMove) { /* [HGM] use move type to determine if move is promotion. Knight is Shogi kludge for mandatory promotion, Queen means choice */ @@ -4768,6 +4893,17 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) else if (moveType == WhitePromotionQueen || moveType == BlackPromotionQueen ) { DrawPosition(forceFullRepaint || FALSE, NULL); + if(gameInfo.variant == VariantSuper) + { ChessSquare p = boards[currentMove][fromY][fromX], q = boards[currentMove][toY][toX]; + // kludge to temporarily execute move on display, wthout promotng yet + promotionChoice = TRUE; + boards[currentMove][fromY][fromX] = EmptySquare; // move Pawn to 8th rank + boards[currentMove][toY][toX] = p; + DrawPosition(FALSE, boards[currentMove]); + boards[currentMove][fromY][fromX] = p; // take back, but display stays + boards[currentMove][toY][toX] = q; + break; + } else PromotionPopup(hwnd); /* [HGM] Popup now calls FinishMove */ } else FinishMove(moveType, fromX, fromY, toX, toY, NULLCHAR); } @@ -4960,7 +5096,7 @@ Promotion(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER)); ShowWindow(GetDlgItem(hDlg, PB_King), (!appData.testLegality || gameInfo.variant == VariantSuicide || - gameInfo.variant == VariantGiveaway) ? + gameInfo.variant == VariantGiveaway || gameInfo.variant == VariantSuper ) ? SW_SHOW : SW_HIDE); /* [HGM] Only allow C & A promotions if these pieces are defined */ ShowWindow(GetDlgItem(hDlg, PB_Archbishop), @@ -4988,6 +5124,9 @@ Promotion(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) ShowWindow(GetDlgItem(hDlg, IDC_No), gameInfo.variant == VariantShogi ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDC_Centaur), + gameInfo.variant == VariantSuper ? + SW_SHOW : SW_HIDE); return TRUE; case WM_COMMAND: /* message: received a command */ @@ -4998,7 +5137,7 @@ Promotion(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) DrawPosition(FALSE, NULL); return TRUE; case PB_King: - promoChar = PieceToChar(BlackKing); + promoChar = gameInfo.variant == VariantSuper ? PieceToChar(BlackSilver) : PieceToChar(BlackKing); break; case PB_Queen: promoChar = gameInfo.variant == VariantShogi ? '+' : PieceToChar(BlackQueen); @@ -5052,7 +5191,8 @@ PromotionPopup(HWND hwnd) VOID ToggleShowThinking() { - ShowThinkingEvent(!appData.showThinking); + appData.showThinking = !appData.showThinking; + ShowThinkingEvent(); } VOID @@ -5366,7 +5506,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } else { EngineOutputPopUp(); - } + } break; /* [AS] User adjudication */ @@ -5962,6 +6102,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* [AS] Snapping */ case WM_ENTERSIZEMOVE: + if(appData.debugMode) { fprintf(debugFP, "size-move\n"); } if (hwnd == hwndMain) { doingSizing = TRUE; lastSizing = 0; @@ -5970,15 +6111,18 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_SIZING: + if(appData.debugMode) { fprintf(debugFP, "sizing\n"); } if (hwnd == hwndMain) { lastSizing = wParam; } break; case WM_MOVING: + if(appData.debugMode) { fprintf(debugFP, "moving\n"); } return OnMoving( &sd, hwnd, wParam, lParam ); case WM_EXITSIZEMOVE: + if(appData.debugMode) { fprintf(debugFP, "exit size-move, size = %d\n", squareSize); } if (hwnd == hwndMain) { RECT client; doingSizing = FALSE; @@ -5986,6 +6130,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) GetClientRect(hwnd, &client); ResizeBoard(client.right, client.bottom, lastSizing); lastSizing = 0; + if(appData.debugMode) { fprintf(debugFP, "square size = %d\n", squareSize); } } return OnExitSizeMove( &sd, hwnd, wParam, lParam ); break; diff --git a/winboard/winboard.h b/winboard/winboard.h index 265791a..2aaee4a 100644 --- a/winboard/winboard.h +++ b/winboard/winboard.h @@ -1,174 +1,181 @@ -/* - * WinBoard.h -- Definitions for Windows NT front end to XBoard - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-97 Free Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - */ -#include "resource.h" -#include - -/* Types */ -typedef struct { - char faceName[LF_FACESIZE]; - float pointSize; - BYTE bold, italic, underline, strikeout; -} MyFontParams; - -typedef struct { - char *def; - MyFontParams mfp; - LOGFONT lf; - HFONT hf; -} MyFont; - -typedef struct { - COLORREF color; - int effects; - char *name; -} MyColorizeAttribs; - -typedef struct { - char* name; - void* data; -} MySound; - -typedef struct { - COLORREF color; - int effects; - MySound sound; -} MyTextAttribs; - -/* Functions */ - -BOOL InitApplication(HINSTANCE); -BOOL InitInstance(HINSTANCE, int, LPSTR); -LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); -LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); -LRESULT CALLBACK BoardSizeDlg(HWND, UINT, WPARAM, LPARAM); -LRESULT CALLBACK ButtonProc(HWND, UINT, WPARAM, LPARAM); -VOID InitAppData(LPSTR); -VOID InitDrawingColors(VOID); -VOID InitDrawingSizes(BoardSize boardSize, int flags); -VOID InitMenuChecks(VOID); -VOID ICSInitScript(VOID); -BOOL CenterWindow(HWND hwndChild, HWND hwndParent); -VOID ResizeEditPlusButtons(HWND hDlg, HWND hText, int sizeX, int sizeY, int newSizeX, int newSizeY); -VOID PromotionPopup(HWND hwnd); -FILE *OpenFileDialog(HWND hWnd, char *write, char *defName, char *defExt, - char *nameFilt, char *dlgTitle, UINT *number, - char fileTitle[MSG_SIZ], char fileName[MSG_SIZ]); -VOID InputEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -DWORD InputThread(LPVOID arg); -DWORD NonOvlInputThread(LPVOID arg); -DWORD SocketInputThread(LPVOID arg); -BOOL ChangeColor(HWND hwnd, COLORREF *which); -VOID ChangeBoardSize(BoardSize newSize); -BOOL APIENTRY MyCreateFont(HWND hwnd, MyFont *font); -VOID ErrorPopDown(VOID); -VOID EnsureOnScreen(int *x, int *y); -typedef char GetFunc(void *getClosure); -VOID ParseArgs(GetFunc get, void *cl); -HBITMAP -DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix); -COLORREF ParseColorName(char *name); -void ParseAttribs(COLORREF *color, int *effects, char* argValue); -VOID CreateFontInMF(MyFont *mf); -VOID ChangedConsoleFont(); -VOID ParseFontName(char *name, MyFontParams *mfp); -void InitComboStrings(HANDLE hwndCombo, char **cd); -BOOLEAN MyLoadSound(MySound *ms); -BOOLEAN MyPlaySound(MySound *ms); -VOID ExitArgError(char *msg, char *badArg); - -/* Constants */ - -#define CLOCK_FONT 0 -#define MESSAGE_FONT 1 -#define COORD_FONT 2 -#define CONSOLE_FONT 3 -#define COMMENT_FONT 4 -#define EDITTAGS_FONT 5 -#define MOVEHISTORY_FONT 6 -#define NUM_FONTS 7 - -/* Positions of some menu items. Origin is zero and separator lines count. */ -/* It's gross that these are needed. */ -#define ACTION_POS 2 /* Posn of "Action" on menu bar */ -#define OPTIONS_POS 4 /* Posn of "Options" on menu bar */ -#define ICS_POS 4 /* Posn of "ICS " on Options menu */ -#define SOUNDS_POS 6 /* Posn of "Sounds" on Options menu */ -/* end grossness */ - -extern MyFont *font[NUM_SIZES][NUM_FONTS]; - -#define WM_USER_Input (WM_USER + 4242) -#define WM_USER_Mouseleave (WM_USER + 4243) -#define WM_USER_GetConsoleBackground (WM_USER + 4244) - -#define CLOCK_TIMER_ID 51 -#define LOAD_GAME_TIMER_ID 52 -#define ANALYSIS_TIMER_ID 53 -#define MOUSE_TIMER_ID 54 -#define DELAYED_TIMER_ID 55 - -#define SOLID_PIECE 0 -#define OUTLINE_PIECE 1 -#define WHITE_PIECE 2 - -#define COPY_TMP "wbcopy.tmp" -#define PASTE_TMP "wbpaste.tmp" - -/* [AS] Layout management */ -typedef struct { - Boolean visible; - int x; - int y; - int width; - int height; -} WindowPlacement; - -VOID InitWindowPlacement( WindowPlacement * wp ); - -VOID RestoreWindowPlacement( HWND hWnd, WindowPlacement * wp ); - -VOID ReattachAfterMove( LPRECT lprcOldPos, int new_x, int new_y, HWND hWndChild, WindowPlacement * pwpChild ); +/* + * WinBoard.h -- Definitions for Windows NT front end to XBoard + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-97 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ +#include "resource.h" +#include + +/* Types */ +typedef struct { + char faceName[LF_FACESIZE]; + float pointSize; + BYTE bold, italic, underline, strikeout; +} MyFontParams; + +typedef struct { + char *def; + MyFontParams mfp; + LOGFONT lf; + HFONT hf; +} MyFont; + +typedef enum { + SizeTiny, SizeTeeny, SizeDinky, SizePetite, SizeSlim, SizeSmall, + SizeMediocre, SizeMiddling, SizeAverage, SizeModerate, SizeMedium, + SizeBulky, SizeLarge, SizeBig, SizeHuge, SizeGiant, SizeColossal, + SizeTitanic, NUM_SIZES +} BoardSize; + +typedef struct { + COLORREF color; + int effects; + char *name; +} MyColorizeAttribs; + +typedef struct { + char* name; + void* data; +} MySound; + +typedef struct { + COLORREF color; + int effects; + MySound sound; +} MyTextAttribs; + +/* Functions */ + +BOOL InitApplication(HINSTANCE); +BOOL InitInstance(HINSTANCE, int, LPSTR); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK BoardSizeDlg(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK ButtonProc(HWND, UINT, WPARAM, LPARAM); +VOID InitAppData(LPSTR); +VOID InitDrawingColors(VOID); +VOID InitDrawingSizes(BoardSize boardSize, int flags); +VOID InitMenuChecks(VOID); +VOID ICSInitScript(VOID); +BOOL CenterWindow(HWND hwndChild, HWND hwndParent); +VOID ResizeEditPlusButtons(HWND hDlg, HWND hText, int sizeX, int sizeY, int newSizeX, int newSizeY); +VOID PromotionPopup(HWND hwnd); +FILE *OpenFileDialog(HWND hWnd, char *write, char *defName, char *defExt, + char *nameFilt, char *dlgTitle, UINT *number, + char fileTitle[MSG_SIZ], char fileName[MSG_SIZ]); +VOID InputEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +DWORD InputThread(LPVOID arg); +DWORD NonOvlInputThread(LPVOID arg); +DWORD SocketInputThread(LPVOID arg); +BOOL ChangeColor(HWND hwnd, COLORREF *which); +VOID ChangeBoardSize(BoardSize newSize); +BOOL APIENTRY MyCreateFont(HWND hwnd, MyFont *font); +VOID ErrorPopDown(VOID); +VOID EnsureOnScreen(int *x, int *y); +typedef char GetFunc(void *getClosure); +VOID ParseArgs(GetFunc get, void *cl); +HBITMAP +DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix); +COLORREF ParseColorName(char *name); +void ParseAttribs(COLORREF *color, int *effects, char* argValue); +VOID CreateFontInMF(MyFont *mf); +VOID ChangedConsoleFont(); +VOID ParseFontName(char *name, MyFontParams *mfp); +void InitComboStrings(HANDLE hwndCombo, char **cd); +BOOLEAN MyLoadSound(MySound *ms); +BOOLEAN MyPlaySound(MySound *ms); +VOID ExitArgError(char *msg, char *badArg); + +/* Constants */ + +#define CLOCK_FONT 0 +#define MESSAGE_FONT 1 +#define COORD_FONT 2 +#define CONSOLE_FONT 3 +#define COMMENT_FONT 4 +#define EDITTAGS_FONT 5 +#define MOVEHISTORY_FONT 6 +#define NUM_FONTS 7 + +/* Positions of some menu items. Origin is zero and separator lines count. */ +/* It's gross that these are needed. */ +#define ACTION_POS 2 /* Posn of "Action" on menu bar */ +#define OPTIONS_POS 4 /* Posn of "Options" on menu bar */ +#define ICS_POS 4 /* Posn of "ICS " on Options menu */ +#define SOUNDS_POS 6 /* Posn of "Sounds" on Options menu */ +/* end grossness */ + +extern MyFont *font[NUM_SIZES][NUM_FONTS]; + +#define WM_USER_Input (WM_USER + 4242) +#define WM_USER_Mouseleave (WM_USER + 4243) +#define WM_USER_GetConsoleBackground (WM_USER + 4244) + +#define CLOCK_TIMER_ID 51 +#define LOAD_GAME_TIMER_ID 52 +#define ANALYSIS_TIMER_ID 53 +#define MOUSE_TIMER_ID 54 +#define DELAYED_TIMER_ID 55 + +#define SOLID_PIECE 0 +#define OUTLINE_PIECE 1 +#define WHITE_PIECE 2 + +#define COPY_TMP "wbcopy.tmp" +#define PASTE_TMP "wbpaste.tmp" + +/* [AS] Layout management */ +typedef struct { + Boolean visible; + int x; + int y; + int width; + int height; +} WindowPlacement; + +VOID InitWindowPlacement( WindowPlacement * wp ); + +VOID RestoreWindowPlacement( HWND hWnd, WindowPlacement * wp ); + +VOID ReattachAfterMove( LPRECT lprcOldPos, int new_x, int new_y, HWND hWndChild, WindowPlacement * pwpChild ); diff --git a/winboard/winboard.ini b/winboard/winboard.ini index 5e2eb0a..5b69f1c 100644 --- a/winboard/winboard.ini +++ b/winboard/winboard.ini @@ -1,266 +1,330 @@ -; -; WinBoard 4.2.7 Save Settings file -; -; You can edit the values of options that are already set in this file, -; but if you add other options, the next Save Settings will not save them. -; Use a shortcut, an @indirection file, or a .bat file instead. -; -/whitePieceColor=#ffffcc -/blackPieceColor=#202020 -/lightSquareColor=#c8c365 -/darkSquareColor=#77a26d -/highlightSquareColor=#ffff00 -/premoveHighlightColor=#ff0000 -/movesPerSession=40 -/timeDelay=1 -/timeControl="5" -/timeIncrement=-1 -/saveGameFile="" -/autoSaveGames=false -/monoMode=false -/showCoords=false -/showThinking=false -/ponderNextMove=true -/periodicUpdates=true -/popupExitMessage=true -/popupMoveErrors=false -/size=tiny /clockFont="Arial:9 b" -/size=teeny /clockFont="Arial:9 b" -/size=dinky /clockFont="Arial:10 b" -/size=petite /clockFont="Arial:10 b" -/size=slim /clockFont="Arial:12 b" -/size=small /clockFont="Arial:14 b" -/size=mediocre /clockFont="Arial:14 b" -/size=middling /clockFont="Arial:14 b" -/size=average /clockFont="Arial:15 b" -/size=moderate /clockFont="Arial:16 b" -/size=medium /clockFont="Arial:16 b" -/size=bulky /clockFont="Arial:17 b" -/size=large /clockFont="Arial:19 b" -/size=big /clockFont="Arial:20 b" -/size=huge /clockFont="Arial:21 b" -/size=giant /clockFont="Arial:22 b" -/size=colossal /clockFont="Arial:23 b" -/size=titanic /clockFont="Arial:24 b" -/size=tiny /messageFont="Small Fonts:6" -/size=teeny /messageFont="Small Fonts:6" -/size=dinky /messageFont="Small Fonts:7" -/size=petite /messageFont="Small Fonts:7" -/size=slim /messageFont="Arial:8 b" -/size=small /messageFont="Arial:9 b" -/size=mediocre /messageFont="Arial:9 b" -/size=middling /messageFont="Arial:9 b" -/size=average /messageFont="Arial:10 b" -/size=moderate /messageFont="Arial:10 b" -/size=medium /messageFont="Arial:10 b" -/size=bulky /messageFont="Arial:10 b" -/size=large /messageFont="Arial:10 b" -/size=big /messageFont="Arial:11 b" -/size=huge /messageFont="Arial:11 b" -/size=giant /messageFont="Arial:11 b" -/size=colossal /messageFont="Arial:12 b" -/size=titanic /messageFont="Arial:12 b" -/size=tiny /coordFont="Small Fonts:4" -/size=teeny /coordFont="Small Fonts:4" -/size=dinky /coordFont="Small Fonts:5" -/size=petite /coordFont="Small Fonts:5" -/size=slim /coordFont="Small Fonts:6" -/size=small /coordFont="Small Fonts:7" -/size=mediocre /coordFont="Small Fonts:7" -/size=middling /coordFont="Small Fonts:7" -/size=average /coordFont="Arial:7 b" -/size=moderate /coordFont="Arial:7 b" -/size=medium /coordFont="Arial:7 b" -/size=bulky /coordFont="Arial:7 b" -/size=large /coordFont="Arial:7 b" -/size=big /coordFont="Arial:8 b" -/size=huge /coordFont="Arial:8 b" -/size=giant /coordFont="Arial:8 b" -/size=colossal /coordFont="Arial:9 b" -/size=titanic /coordFont="Arial:9 b" -/size=tiny /tagsFont="Courier New:8" -/size=teeny /tagsFont="Courier New:8" -/size=dinky /tagsFont="Courier New:8" -/size=petite /tagsFont="Courier New:8" -/size=slim /tagsFont="Courier New:8" -/size=small /tagsFont="Courier New:8" -/size=mediocre /tagsFont="Courier New:8" -/size=middling /tagsFont="Courier New:8" -/size=average /tagsFont="Courier New:8" -/size=moderate /tagsFont="Courier New:8" -/size=medium /tagsFont="Courier New:8" -/size=bulky /tagsFont="Courier New:8" -/size=large /tagsFont="Courier New:8" -/size=big /tagsFont="Courier New:8" -/size=huge /tagsFont="Courier New:8" -/size=giant /tagsFont="Courier New:8" -/size=colossal /tagsFont="Courier New:8" -/size=titanic /tagsFont="Courier New:8" -/size=tiny /commentFont="Arial:9" -/size=teeny /commentFont="Arial:9" -/size=dinky /commentFont="Arial:9" -/size=petite /commentFont="Arial:9" -/size=slim /commentFont="Arial:9" -/size=small /commentFont="Arial:9" -/size=mediocre /commentFont="Arial:9" -/size=middling /commentFont="Arial:9" -/size=average /commentFont="Arial:9" -/size=moderate /commentFont="Arial:9" -/size=medium /commentFont="Arial:9" -/size=bulky /commentFont="Arial:9" -/size=large /commentFont="Arial:9" -/size=big /commentFont="Arial:9" -/size=huge /commentFont="Arial:9" -/size=giant /commentFont="Arial:9" -/size=colossal /commentFont="Arial:9" -/size=titanic /commentFont="Arial:9" -/size=tiny /icsFont="Courier New:8" -/size=teeny /icsFont="Courier New:8" -/size=dinky /icsFont="Courier New:8" -/size=petite /icsFont="Courier New:8" -/size=slim /icsFont="Courier New:8" -/size=small /icsFont="Courier New:8" -/size=mediocre /icsFont="Courier New:8" -/size=middling /icsFont="Courier New:8" -/size=average /icsFont="Courier New:8" -/size=moderate /icsFont="Courier New:8" -/size=medium /icsFont="Courier New:8" -/size=bulky /icsFont="Courier New:8" -/size=large /icsFont="Courier New:8" -/size=big /icsFont="Courier New:8" -/size=huge /icsFont="Courier New:8" -/size=giant /icsFont="Courier New:8" -/size=colossal /icsFont="Courier New:8" -/size=titanic /icsFont="Courier New:8" -/boardSize=giant -/alwaysOnTop=false -/autoCallFlag=false -/autoComment=false -/autoObserve=false -/autoFlipView=true -/autoRaiseBoard=true -/alwaysPromoteToQueen=false -/oldSaveStyle=false -/quietPlay=false -/getMoveList=true -/testLegality=true -/premove=true -/premoveWhite=false -/premoveWhiteText="" -/premoveBlack=false -/premoveBlackText="" -/icsAlarm=true -/icsAlarmTime=5000 -/animateMoving=true -/animateSpeed=10 -/animateDragging=true -/blindfold=false -/highlightLastMove=true -/highlightDragging=false -/colorizeMessages=true -/colorShout="#209000" -/colorSShout="b #289808" -/colorChannel1="#2020e0" -/colorChannel="b #4040ff" -/colorKibitz="b #ff00ff" -/colorTell="b #ff0000" -/colorChallenge="bi #ff0000" -/colorRequest="bi #ff0000" -/colorSeek="#980808" -/colorNormal="#000000" -/colorBackground=#ffffff -/soundShout="" -/soundSShout="" -/soundChannel1="" -/soundChannel="" -/soundKibitz="" -/soundTell="" -/soundChallenge="" -/soundRequest="" -/soundSeek="" -/soundMove="" -/soundBell="$" -/soundIcsWin="" -/soundIcsLoss="" -/soundIcsDraw="" -/soundIcsUnfinished="" -/soundIcsAlarm="" -/comPortSettings=9600,7,Space,1,None -/x=0 -/y=2 -/icsX=-2147483648 -/icsY=-2147483648 -/icsW=-2147483648 -/icsH=-2147483648 -/analysisX=-2147483648 -/analysisY=-2147483648 -/analysisW=-2147483648 -/analysisH=-2147483648 -/commentX=-2147483648 -/commentY=-2147483648 -/commentW=-2147483648 -/commentH=-2147483648 -/tagsX=-2147483648 -/tagsY=-2147483648 -/tagsW=-2147483648 -/tagsH=-2147483648 -/gameListX=-2147483648 -/gameListY=-2147483648 -/gameListW=-2147483648 -/gameListH=-2147483648 -/saveSettingsOnExit=true -/icsMenu={- -&Who,who,0,1 -Playe&rs,players,0,1 -&Games,games,0,1 -&Sought,sought,0,1 -|&Tell (name),tell,1,0 -M&essage (name),message,1,0 -- -&Finger (name),finger,1,1 -&Vars (name),vars,1,1 -&Observe (name),observe,1,1 -&Match (name),match,1,1 -Pl&ay (name),play,1,1 -} -/icsNames={chessclub.com /icsport=5000 /icshelper=timestamp -freechess.org /icsport=5000 /icshelper=timeseal -global.chessparlor.com /icsport=6000 /icshelper=timeseal -chessanytime.com /icsport=5000 -chess.net /icsport=5000 -zics.org /icsport=5000 -jogo.cex.org.br /icsport=5000 -ajedrez.cec.uchile.cl /icsport=5000 -fly.cc.fer.hr /icsport=7890 -freechess.nl /icsport=5000 /icshelper=timeseal -jeu.echecs.com /icsport=5000 -chess.unix-ag.uni-kl.de /icsport=5000 /icshelper=timeseal -chess.mds.mdh.se /icsport=5000 -} -/firstChessProgramNames={GNUChess -"GNUChes5 xboard" -} -/secondChessProgramNames={GNUChess -"GNUChes5 xboard" -} -/showButtonBar=true -/firstScoreAbs=false -/secondScoreAbs=false -/pgnExtendedInfo=false -/hideThinkingFromHuman=false -/liteBackTextureFile="" -/darkBackTextureFile="" -/liteBackTextureMode=1 -/darkBackTextureMode=1 -/renderPiecesWithFont="" -/fontPieceToCharTable="" -/fontPieceBackColorWhite=#000000 -/fontPieceForeColorWhite=#000000 -/fontPieceBackColorBlack=#000000 -/fontPieceForeColorBlack=#000000 -/fontPieceSize=80 -/overrideLineGap=1 -/adjudicateLossThreshold=0 -/delayBeforeQuit=0 -/delayAfterQuit=0 -/pgnEventHeader="Computer Chess Game" +; +; WinBoard 4.3.15k Save Settings file +; +; You can edit the values of options that are already set in this file, +; but if you add other options, the next Save Settings will not save them. +; Use a shortcut, an @indirection file, or a .bat file instead. +; +/whitePieceColor=#ffffcc +/blackPieceColor=#202020 +/lightSquareColor=#c8c365 +/darkSquareColor=#77a26d +/highlightSquareColor=#ffff00 +/premoveHighlightColor=#ff0000 +/movesPerSession=40 +/timeDelay=1 +/timeControl="5" +/timeIncrement=-1 +/saveGameFile="" +/autoSaveGames=false +/monoMode=false +/showCoords=false +/showThinking=false +/ponderNextMove=true +/periodicUpdates=true +/popupExitMessage=true +/popupMoveErrors=false +/size=tiny /clockFont="Arial:9 b" +/size=teeny /clockFont="Arial:9 b" +/size=dinky /clockFont="Arial:10 b" +/size=petite /clockFont="Arial:10 b" +/size=slim /clockFont="Arial:12 b" +/size=small /clockFont="Arial:14 b" +/size=mediocre /clockFont="Arial:14 b" +/size=middling /clockFont="Arial:14 b" +/size=average /clockFont="Arial:15 b" +/size=moderate /clockFont="Arial:16 b" +/size=medium /clockFont="Arial:16 b" +/size=bulky /clockFont="Arial:17 b" +/size=large /clockFont="Arial:19 b" +/size=big /clockFont="Arial:20 b" +/size=huge /clockFont="Arial:21 b" +/size=giant /clockFont="Arial:22 b" +/size=colossal /clockFont="Arial:23 b" +/size=titanic /clockFont="Arial:24 b" +/size=tiny /messageFont="Small Fonts:6" +/size=teeny /messageFont="Small Fonts:6" +/size=dinky /messageFont="Small Fonts:7" +/size=petite /messageFont="Small Fonts:7" +/size=slim /messageFont="Arial:8 b" +/size=small /messageFont="Arial:9 b" +/size=mediocre /messageFont="Arial:9 b" +/size=middling /messageFont="Arial:9 b" +/size=average /messageFont="Arial:10 b" +/size=moderate /messageFont="Arial:10 b" +/size=medium /messageFont="Arial:10 b" +/size=bulky /messageFont="Arial:10 b" +/size=large /messageFont="Arial:10 b" +/size=big /messageFont="Arial:11 b" +/size=huge /messageFont="Arial:11 b" +/size=giant /messageFont="Arial:11 b" +/size=colossal /messageFont="Arial:12 b" +/size=titanic /messageFont="Arial:12 b" +/size=tiny /coordFont="Small Fonts:4" +/size=teeny /coordFont="Small Fonts:4" +/size=dinky /coordFont="Small Fonts:5" +/size=petite /coordFont="Small Fonts:5" +/size=slim /coordFont="Small Fonts:6" +/size=small /coordFont="Small Fonts:7" +/size=mediocre /coordFont="Small Fonts:7" +/size=middling /coordFont="Small Fonts:7" +/size=average /coordFont="Arial:7 b" +/size=moderate /coordFont="Arial:7 b" +/size=medium /coordFont="Arial:7 b" +/size=bulky /coordFont="Arial:7 b" +/size=large /coordFont="Arial:7 b" +/size=big /coordFont="Arial:8 b" +/size=huge /coordFont="Arial:8 b" +/size=giant /coordFont="Arial:8 b" +/size=colossal /coordFont="Arial:9 b" +/size=titanic /coordFont="Arial:9 b" +/size=tiny /tagsFont="Courier New:8" +/size=teeny /tagsFont="Courier New:8" +/size=dinky /tagsFont="Courier New:8" +/size=petite /tagsFont="Courier New:8" +/size=slim /tagsFont="Courier New:8" +/size=small /tagsFont="Courier New:8" +/size=mediocre /tagsFont="Courier New:8" +/size=middling /tagsFont="Courier New:8" +/size=average /tagsFont="Courier New:8" +/size=moderate /tagsFont="Courier New:8" +/size=medium /tagsFont="Courier New:8" +/size=bulky /tagsFont="Courier New:8" +/size=large /tagsFont="Courier New:8" +/size=big /tagsFont="Courier New:8" +/size=huge /tagsFont="Courier New:8" +/size=giant /tagsFont="Courier New:8" +/size=colossal /tagsFont="Courier New:8" +/size=titanic /tagsFont="Courier New:8" +/size=tiny /commentFont="Arial:9" +/size=teeny /commentFont="Arial:9" +/size=dinky /commentFont="Arial:9" +/size=petite /commentFont="Arial:9" +/size=slim /commentFont="Arial:9" +/size=small /commentFont="Arial:9" +/size=mediocre /commentFont="Arial:9" +/size=middling /commentFont="Arial:9" +/size=average /commentFont="Arial:9" +/size=moderate /commentFont="Arial:9" +/size=medium /commentFont="Arial:9" +/size=bulky /commentFont="Arial:9" +/size=large /commentFont="Arial:9" +/size=big /commentFont="Arial:9" +/size=huge /commentFont="Arial:9" +/size=giant /commentFont="Arial:9" +/size=colossal /commentFont="Arial:9" +/size=titanic /commentFont="Arial:9" +/size=tiny /icsFont="Courier New:8" +/size=teeny /icsFont="Courier New:8" +/size=dinky /icsFont="Courier New:8" +/size=petite /icsFont="Courier New:8" +/size=slim /icsFont="Courier New:8" +/size=small /icsFont="Courier New:8" +/size=mediocre /icsFont="Courier New:8" +/size=middling /icsFont="Courier New:8" +/size=average /icsFont="Courier New:8" +/size=moderate /icsFont="Courier New:8" +/size=medium /icsFont="Courier New:8" +/size=bulky /icsFont="Courier New:8" +/size=large /icsFont="Courier New:8" +/size=big /icsFont="Courier New:8" +/size=huge /icsFont="Courier New:8" +/size=giant /icsFont="Courier New:8" +/size=colossal /icsFont="Courier New:8" +/size=titanic /icsFont="Courier New:8" +/size=tiny /moveHistoryFont="MS Sans Serif:8" +/size=teeny /moveHistoryFont="MS Sans Serif:8" +/size=dinky /moveHistoryFont="MS Sans Serif:8" +/size=petite /moveHistoryFont="MS Sans Serif:8" +/size=slim /moveHistoryFont="MS Sans Serif:8" +/size=small /moveHistoryFont="MS Sans Serif:8" +/size=mediocre /moveHistoryFont="MS Sans Serif:8" +/size=middling /moveHistoryFont="MS Sans Serif:8" +/size=average /moveHistoryFont="MS Sans Serif:8" +/size=moderate /moveHistoryFont="MS Sans Serif:8" +/size=medium /moveHistoryFont="MS Sans Serif:8" +/size=bulky /moveHistoryFont="MS Sans Serif:8" +/size=large /moveHistoryFont="MS Sans Serif:8" +/size=big /moveHistoryFont="MS Sans Serif:8" +/size=huge /moveHistoryFont="MS Sans Serif:8" +/size=giant /moveHistoryFont="MS Sans Serif:8" +/size=colossal /moveHistoryFont="MS Sans Serif:8" +/size=titanic /moveHistoryFont="MS Sans Serif:8" +/boardSize=bulky +/alwaysOnTop=false +/autoCallFlag=false +/autoComment=false +/autoObserve=false +/autoFlipView=true +/autoRaiseBoard=true +/alwaysPromoteToQueen=false +/oldSaveStyle=false +/quietPlay=false +/getMoveList=true +/testLegality=true +/premove=true +/premoveWhite=false +/premoveWhiteText="" +/premoveBlack=false +/premoveBlackText="" +/icsAlarm=true +/icsAlarmTime=5000 +/animateMoving=true +/animateSpeed=10 +/animateDragging=true +/blindfold=false +/highlightLastMove=true +/highlightDragging=false +/colorizeMessages=true +/colorShout="#209000" +/colorSShout="b #289808" +/colorChannel1="#2020e0" +/colorChannel="b #4040ff" +/colorKibitz="b #ff00ff" +/colorTell="b #ff0000" +/colorChallenge="bi #ff0000" +/colorRequest="bi #ff0000" +/colorSeek="#980808" +/colorNormal="#000000" +/colorBackground=#ffffff +/soundShout="" +/soundSShout="" +/soundChannel1="" +/soundChannel="" +/soundKibitz="" +/soundTell="" +/soundChallenge="" +/soundRequest="" +/soundSeek="" +/soundMove="" +/soundBell="$" +/soundIcsWin="" +/soundIcsLoss="" +/soundIcsDraw="" +/soundIcsUnfinished="" +/soundIcsAlarm="" +/comPortSettings=9600,7,Space,1,None +/x=10 +/y=30 +/icsX=-2147483648 +/icsY=-2147483648 +/icsW=-2147483648 +/icsH=-2147483648 +/analysisX=-2147483648 +/analysisY=-2147483648 +/analysisW=-2147483648 +/analysisH=-2147483648 +/commentX=-2147483648 +/commentY=-2147483648 +/commentW=-2147483648 +/commentH=-2147483648 +/tagsX=-2147483648 +/tagsY=-2147483648 +/tagsW=-2147483648 +/tagsH=-2147483648 +/gameListX=-2147483648 +/gameListY=-2147483648 +/gameListW=-2147483648 +/gameListH=-2147483648 +/saveSettingsOnExit=true +/icsMenu={- +&Who,who,0,1 +Playe&rs,players,0,1 +&Games,games,0,1 +&Sought,sought,0,1 +|&Tell (name),tell,1,0 +M&essage (name),message,1,0 +- +&Finger (name),finger,1,1 +&Vars (name),vars,1,1 +&Observe (name),observe,1,1 +&Match (name),match,1,1 +Pl&ay (name),play,1,1 +} +/icsNames={chessclub.com /icsport=5000 /icshelper=timestamp +freechess.org /icsport=5000 /icshelper=timeseal +global.chessparlor.com /icsport=6000 /icshelper=timeseal +chessanytime.com /icsport=5000 +chess.net /icsport=5000 +zics.org /icsport=5000 +jogo.cex.org.br /icsport=5000 +ajedrez.cec.uchile.cl /icsport=5000 +fly.cc.fer.hr /icsport=7890 +freechess.nl /icsport=5000 /icshelper=timeseal +jeu.echecs.com /icsport=5000 +chess.unix-ag.uni-kl.de /icsport=5000 /icshelper=timeseal +chess.mds.mdh.se /icsport=5000 +} +/firstChessProgramNames={GNUChess +"GNUChes5 xboard" +} +/secondChessProgramNames={GNUChess +"GNUChes5 xboard" +} +/showButtonBar=true +/pgnExtendedInfo=false +/hideThinkingFromHuman=false +/liteBackTextureFile="" +/darkBackTextureFile="" +/liteBackTextureMode=1 +/darkBackTextureMode=1 +/renderPiecesWithFont="" +/fontPieceToCharTable="" +/fontPieceBackColorWhite=#000000 +/fontPieceForeColorWhite=#000000 +/fontPieceBackColorBlack=#000000 +/fontPieceForeColorBlack=#000000 +/fontPieceSize=80 +/overrideLineGap=1 +/adjudicateLossThreshold=0 +/delayBeforeQuit=0 +/delayAfterQuit=0 +/pgnEventHeader="Computer Chess Game" +/defaultFrcPosition=-1 +/gameListTags="eprd" +/saveOutOfBookInfo=true +/showEvalInMoveHistory=true +/evalHistColorWhite=#ffffb0 +/evalHistColorBlack=#ad5d3d +/highlightMoveWithArrow=false +/highlightArrowColor=#ffff80 +/stickyWindows=true +/adjudicateDrawMoves=0 +/autoDisplayComment=true +/autoDisplayTags=true +/polyglotDir="" +/usePolyglotBook=false +/polyglotBook="" +/defaultHashSize=64 +/defaultCacheSizeEGTB=4 +/defaultPathEGTB="c:\egtb" +/moveHistoryUp=false +/moveHistoryX=136 +/moveHistoryY=224 +/moveHistoryW=346 +/moveHistoryH=237 +/evalGraphUp=false +/evalGraphX=136 +/evalGraphY=224 +/evalGraphW=332 +/evalGraphH=148 +/engineOutputUp=false +/engineOutputX=136 +/engineOutputY=224 +/engineOutputW=407 +/engineOutputH=297 +/boardWidth=-1 +/boardHeight=-1 +/holdingsSize=-1 +/matchPause=10000 +/flipBlack=false +/allWhite=false +/testClaims=false +/checkMates=false +/materialDraws=false +/trivialDraws=false +/ruleMoves=51 +/repeatsToDraw=6 +/smpCores=1 +/egtFormats="" +/timeOddsMode=0 diff --git a/winboard/winboard.rc b/winboard/winboard.rc index 9584a49..eb7ee05 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -51,7 +51,7 @@ BEGIN LTEXT "(""WinBoard_F"")",IDC_STATIC,88,4,71,8 END -DLG_TimeControl DIALOG DISCARDABLE 6, 18, 174, 98 +DLG_TimeControl DIALOG DISCARDABLE 6, 18, 174, 134 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Time Control" FONT 8, "MS Sans Serif" @@ -68,8 +68,13 @@ BEGIN LTEXT "minutes +",405,44,58,34,8,NOT WS_GROUP EDITTEXT OPT_TCInc,78,56,26,12,ES_AUTOHSCROLL LTEXT "seconds per move",408,108,58,62,8,NOT WS_GROUP - PUSHBUTTON "OK",IDOK,64,80,50,14,WS_GROUP - PUSHBUTTON "Cancel",IDCANCEL,120,80,50,14 + LTEXT "Time-Odds Factors:",IDC_STATIC,6,78,150,8,NOT WS_GROUP + EDITTEXT OPT_TCOdds1,47,92,26,12,ES_AUTOHSCROLL | WS_GROUP + LTEXT "Engine #1:",IDC_STATIC,6,94,41,8,NOT WS_GROUP + EDITTEXT OPT_TCOdds2,124,92,26,12,ES_AUTOHSCROLL + LTEXT "Engine #2:",IDC_STATIC,83,94,41,8,NOT WS_GROUP + PUSHBUTTON "OK",IDOK,64,116,50,14,WS_GROUP + PUSHBUTTON "Cancel",IDCANCEL,120,116,50,14 END DLG_LoadOptions DIALOG DISCARDABLE 10, 18, 136, 55 @@ -191,10 +196,11 @@ BEGIN PUSHBUTTON "&Rook",PB_Rook,49,23,40,14,NOT WS_TABSTOP PUSHBUTTON "&Bishop",PB_Bishop,94,23,40,14,NOT WS_TABSTOP PUSHBUTTON "K&night",PB_Knight,139,23,40,14,NOT WS_TABSTOP - PUSHBUTTON "&King",PB_King,94,4,40,14,NOT WS_TABSTOP + PUSHBUTTON "&King",PB_King,4,4,40,14,NOT WS_TABSTOP PUSHBUTTON "&Cancel",IDCANCEL,139,4,40,14,WS_GROUP LTEXT " YES",IDC_Yes,6,25,36,10 LTEXT " NO",IDC_No,141,25,36,10 + LTEXT "C&entaur",IDC_Centaur,12,6,25,10 END ABOUTBOX2 DIALOG DISCARDABLE 22, 17, 281, 223 @@ -659,7 +665,7 @@ BEGIN 54,50,10 CONTROL "&Falcon",OPT_VariantFalcon,"Button",BS_AUTORADIOBUTTON,134, 64,50,10 - CONTROL "&3checks",OPT_Variant3Checks,"Button",BS_AUTORADIOBUTTON,134, + CONTROL "su&per",OPT_VariantSuper,"Button",BS_AUTORADIOBUTTON,134, 74,50,10 CONTROL "&nocastle",OPT_VariantNocastle,"Button",BS_AUTORADIOBUTTON,134, 84,50,10 @@ -788,7 +794,7 @@ BEGIN ICON IDI_TRANS_14,IDC_StateIcon2,164,84,20,20 END -DLG_EnginePlayOptions DIALOG DISCARDABLE 0, 0, 208, 177 +DLG_EnginePlayOptions DIALOG DISCARDABLE 0, 0, 208, 202 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Engine Options" FONT 8, "MS Sans Serif" @@ -828,8 +834,14 @@ BEGIN LTEXT "-move rule",IDC_STATIC,142,117,35,8 EDITTEXT IDC_DrawRepeats,120,130,20,14,ES_AUTOHSCROLL LTEXT "-fold repeats",IDC_STATIC,142,134,50,8 - DEFPUSHBUTTON "OK",IDOK,98,160,50,14 - PUSHBUTTON "Cancel",IDCANCEL,154,160,50,14 + CONTROL "Engine #1 Score is Absolute", + IDC_ScoreAbs1,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,10,156,120,10 + CONTROL "Engine #2 Score is Absolute", + IDC_ScoreAbs2,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,10,168,120,10 + DEFPUSHBUTTON "OK",IDOK,98,185,50,14 + PUSHBUTTON "Cancel",IDCANCEL,154,185,50,14 END DLG_OptionsUCI DIALOG DISCARDABLE 0, 0, 228, 124 @@ -851,6 +863,12 @@ BEGIN WS_TABSTOP,2,80,49,10 EDITTEXT IDC_BookFile,62,76,140,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BrowseForBook,206,76,17,14 + LTEXT "Max nr of CPUs:",IDC_STATIC,106,26,52,8 + EDITTEXT IDC_Cores,162,22,40,14,ES_AUTOHSCROLL + CONTROL "First has Own Book",IDC_OwnBook1,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,2,94,100,10 + CONTROL "Second has Own Book",IDC_OwnBook2,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,2,107,100,10 DEFPUSHBUTTON "OK",IDOK,118,106,50,14 PUSHBUTTON "Cancel",IDCANCEL,174,106,50,14 END @@ -1938,6 +1956,8 @@ SL58W BITMAP MOVEABLE PURE "shogibitmaps\\sl58w.bmp" SK58W BITMAP MOVEABLE PURE "shogibitmaps\\sk58w.bmp" SW58W BITMAP MOVEABLE PURE "shogibitmaps\\sw58w.bmp" +KING45C BITMAP MOVEABLE PURE "shogibitmaps\\king.bmp" +AMAZON50C BITMAP MOVEABLE PURE "shogibitmaps\\bamazon.bmp" #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// diff --git a/winboard/woptions.c b/winboard/woptions.c index b2bbf0a..0941cce 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -214,11 +214,17 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) appData.popupMoveErrors = IS_CHECKED(OPT_PopupMoveErrors); appData.showButtonBar = IS_CHECKED(OPT_ShowButtonBar); appData.showCoords = IS_CHECKED(OPT_ShowCoordinates); - ShowThinkingEvent( IS_CHECKED(OPT_ShowThinking)); - appData.testLegality = IS_CHECKED(OPT_TestLegality); - appData.hideThinkingFromHuman= IS_CHECKED(OPT_HideThinkFromHuman); + // [HGM] thinking: next three moved up appData.saveExtendedInfoInPGN= IS_CHECKED(OPT_SaveExtPGN); + appData.hideThinkingFromHuman= IS_CHECKED(OPT_HideThinkFromHuman); appData.showEvalInMoveHistory= IS_CHECKED(OPT_ExtraInfoInMoveHistory); +#if 0 + ShowThinkingEvent( IS_CHECKED(OPT_ShowThinking)); +#else + appData.showThinking = IS_CHECKED(OPT_ShowThinking); + ShowThinkingEvent(); // [HGM] thinking: tests four options +#endif + appData.testLegality = IS_CHECKED(OPT_TestLegality); appData.highlightMoveWithArrow=IS_CHECKED(OPT_HighlightMoveArrow); #undef IS_CHECKED @@ -778,7 +784,7 @@ VariantWhichRadio(HWND hDlg) (IsDlgButtonChecked(hDlg, OPT_VariantCylinder) ? VariantCylinder : (IsDlgButtonChecked(hDlg, OPT_VariantFalcon) ? VariantFalcon : (IsDlgButtonChecked(hDlg, OPT_VariantCRC) ? VariantCapaRandom : - (IsDlgButtonChecked(hDlg, OPT_Variant3Checks) ? Variant3Check : + (IsDlgButtonChecked(hDlg, OPT_VariantSuper) ? VariantSuper : (IsDlgButtonChecked(hDlg, OPT_VariantBerolina) ? VariantBerolina : (IsDlgButtonChecked(hDlg, OPT_VariantJanus) ? VariantJanus : (IsDlgButtonChecked(hDlg, OPT_VariantWildcastle) ? VariantWildCastle : @@ -859,7 +865,8 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) CheckDlgButton(hDlg, OPT_VariantCylinder, TRUE); break; case Variant3Check: - CheckDlgButton(hDlg, OPT_Variant3Checks, TRUE); + case VariantSuper: + CheckDlgButton(hDlg, OPT_VariantSuper, TRUE); break; case VariantBerolina: CheckDlgButton(hDlg, OPT_VariantBerolina, TRUE); @@ -899,6 +906,18 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) EndDialog(hDlg, TRUE); v = VariantWhichRadio(hDlg); + if(!appData.noChessProgram) { char *name = VariantName(v), buf[MSG_SIZ]; + if (first.protocolVersion > 1 && StrStr(first.variants, name) == NULL) { + /* [HGM] in protocol 2 we check if variant is suported by engine */ + sprintf(buf, "Variant %s not supported by %s", name, first.tidy); + DisplayError(buf, 0); + return TRUE; /* treat as "Cancel" if first engine does not support it */ + } else + if (second.initDone && second.protocolVersion > 1 && StrStr(second.variants, name) == NULL) { + sprintf(buf, "Warning: second engine (%s) does not support this!", second.tidy); + DisplayError(buf, 0); /* use of second engine is optional; only warn user */ + } + } gameInfo.variant = v; appData.variant = VariantName(v); @@ -2584,8 +2603,8 @@ LRESULT CALLBACK TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { char buf[MSG_SIZ]; - int mps, increment; - BOOL ok; + int mps, increment, odds1, odds2; + BOOL ok, ok2; switch (message) { case WM_INITDIALOG: /* message: initialize dialog box */ @@ -2609,6 +2628,8 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) SetDlgItemText(hDlg, OPT_TCTime2, appData.timeControl); SetDlgItemInt(hDlg, OPT_TCInc, appData.timeIncrement, FALSE); } + SetDlgItemInt(hDlg, OPT_TCOdds1, 1, FALSE); + SetDlgItemInt(hDlg, OPT_TCOdds2, 1, FALSE); SetTimeControlEnables(hDlg); } return TRUE; @@ -2646,9 +2667,18 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) return FALSE; } } + odds1 = GetDlgItemInt(hDlg, OPT_TCOdds1, &ok, FALSE); + odds2 = GetDlgItemInt(hDlg, OPT_TCOdds2, &ok2, FALSE); + if (!ok || !ok2 || odds1 <= 0 || odds2 <= 0) { + MessageBox(hDlg, "Invalid time-odds factor", + "Option Error", MB_OK|MB_ICONEXCLAMATION); + return FALSE; + } appData.timeControl = strdup(buf); appData.movesPerSession = mps; appData.timeIncrement = increment; + appData.firstTimeOdds = first.timeOdds = odds1; + appData.secondTimeOdds = second.timeOdds = odds2; Reset(TRUE, TRUE); EndDialog(hDlg, TRUE); return TRUE; @@ -2707,6 +2737,9 @@ LRESULT CALLBACK EnginePlayOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, CHECK_BOX(IDC_MaterialDraws, appData.materialDraws); CHECK_BOX(IDC_TrivialDraws, appData.trivialDraws); + CHECK_BOX(IDC_ScoreAbs1, appData.firstScoreIsAbsolute); + CHECK_BOX(IDC_ScoreAbs2, appData.secondScoreIsAbsolute); + SetDlgItemInt( hDlg, IDC_EpDrawMoveCount, appData.adjudicateDrawMoves, TRUE ); SendDlgItemMessage( hDlg, IDC_EpDrawMoveCount, EM_SETSEL, 0, -1 ); @@ -2727,8 +2760,13 @@ LRESULT CALLBACK EnginePlayOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, /* Read changed options from the dialog box */ PeriodicUpdatesEvent( IS_CHECKED(IDC_EpPeriodicUpdates)); PonderNextMoveEvent( IS_CHECKED(IDC_EpPonder)); + appData.hideThinkingFromHuman= IS_CHECKED(IDC_EpHideThinkingHuman); // [HGM] thinking: moved up +#if 0 ShowThinkingEvent( IS_CHECKED(IDC_EpShowThinking)); - appData.hideThinkingFromHuman= IS_CHECKED(IDC_EpHideThinkingHuman); +#else + appData.showThinking = IS_CHECKED(IDC_EpShowThinking); + ShowThinkingEvent(); // [HGM] thinking: tests all options that need thinking output +#endif appData.testClaims = IS_CHECKED(IDC_TestClaims); appData.checkMates = IS_CHECKED(IDC_DetectMates); appData.materialDraws = IS_CHECKED(IDC_MaterialDraws); @@ -2739,6 +2777,9 @@ LRESULT CALLBACK EnginePlayOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, appData.ruleMoves = GetDlgItemInt(hDlg, IDC_RuleMoves, NULL, FALSE ); appData.drawRepeats = (int) GetDlgItemInt(hDlg, IDC_DrawRepeats, NULL, FALSE ); + appData.firstScoreIsAbsolute = IS_CHECKED(IDC_ScoreAbs1); + appData.secondScoreIsAbsolute = IS_CHECKED(IDC_ScoreAbs2); + EndDialog(hDlg, TRUE); return TRUE; @@ -2816,6 +2857,7 @@ static BOOL BrowseForFolder( const char * title, char * path ) LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { char buf[MAX_PATH]; + int oldCores; switch (message) { case WM_INITDIALOG: /* message: initialize dialog box */ @@ -2830,6 +2872,11 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM SetDlgItemInt( hDlg, IDC_SizeOfEGTB, appData.defaultCacheSizeEGTB, TRUE ); CheckDlgButton( hDlg, IDC_UseBook, (BOOL) appData.usePolyglotBook ); SetDlgItemText( hDlg, IDC_BookFile, appData.polyglotBook ); + // [HGM] smp: input field for nr of cores: + SetDlgItemInt( hDlg, IDC_Cores, appData.smpCores, TRUE ); + // [HGM] book: tick boxes for own book use + CheckDlgButton( hDlg, IDC_OwnBook1, (BOOL) appData.firstHasOwnBookUCI ); + CheckDlgButton( hDlg, IDC_OwnBook2, (BOOL) appData.secondHasOwnBookUCI ); SendDlgItemMessage( hDlg, IDC_PolyglotDir, EM_SETSEL, 0, -1 ); @@ -2847,7 +2894,15 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM GetDlgItemText( hDlg, IDC_BookFile, buf, sizeof(buf) ); appData.polyglotBook = strdup(buf); appData.usePolyglotBook = (Boolean) IsDlgButtonChecked( hDlg, IDC_UseBook ); - + // [HGM] smp: get nr of cores: + oldCores = appData.smpCores; + appData.smpCores = GetDlgItemInt(hDlg, IDC_Cores, NULL, FALSE ); + if(appData.smpCores != oldCores) NewSettingEvent(FALSE, "cores", appData.smpCores); + // [HGM] book: read tick boxes for own book use + appData.firstHasOwnBookUCI = (Boolean) IsDlgButtonChecked( hDlg, IDC_OwnBook1 ); + appData.secondHasOwnBookUCI = (Boolean) IsDlgButtonChecked( hDlg, IDC_OwnBook2 ); + + if(gameMode == BeginningOfGame) Reset(TRUE, TRUE); EndDialog(hDlg, TRUE); return TRUE; diff --git a/xboard.c b/xboard.c index ca74313..54718f3 100644 --- a/xboard.c +++ b/xboard.c @@ -192,7 +192,13 @@ extern char *getenv(); #include "childio.h" #include "xgamelist.h" #include "xhistory.h" -#include "xedittags.h" +#include "xedittags.h" + +// must be moved to xengineoutput.h +void EngineOutputProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); +void EngineOutputPopDown(); + #ifdef __EMX__ #ifndef HAVE_USLEEP @@ -385,6 +391,8 @@ void ShowCoordsProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void ShowThinkingProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); +void HideThinkingProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); void TestLegalityProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); void InfoProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); @@ -409,7 +417,17 @@ static void DragPieceMove P((int x, int y)); static void DragPieceEnd P((int x, int y)); static void DrawDragPiece P((void)); char *ModeToWidgetName P((GameMode mode)); - +void EngineOutputUpdate( FrontEndProgramStats * stats ); +void ShuffleMenuProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); +void EngineMenuProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); +void UciMenuProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); +void TimeControlProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); +void NewVariantProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); +void ShufflePopDown P(()); +void EnginePopDown P(()); +void UciPopDown P(()); +void TimeControlPopDown P(()); +void NewVariantPopDown P(()); /* * XBoard depends on Xt R4 or higher */ @@ -422,7 +440,7 @@ Pixel lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor, jailSquareColor, highlightSquareColor, premoveHighlightColor; GC lightSquareGC, darkSquareGC, jailSquareGC, lineGC, wdPieceGC, wlPieceGC, bdPieceGC, blPieceGC, wbPieceGC, bwPieceGC, coordGC, highlineGC, - wjPieceGC, bjPieceGC, prelineGC; + wjPieceGC, bjPieceGC, prelineGC, countGC; Pixmap iconPixmap, wIconPixmap, bIconPixmap, xMarkPixmap; Widget shellWidget, layoutWidget, formWidget, boardWidget, messageWidget, whiteTimerWidget, blackTimerWidget, titleWidget, widgetList[16], @@ -431,19 +449,21 @@ Widget shellWidget, layoutWidget, formWidget, boardWidget, messageWidget, ICSInputShell, fileNameShell, askQuestionShell; XSegment gridSegments[(BOARD_SIZE + 1) * 2]; XSegment jailGridSegments[(BOARD_SIZE + 3) * 2]; -Font clockFontID, coordFontID; -XFontStruct *clockFontStruct, *coordFontStruct; +Font clockFontID, coordFontID, countFontID; +XFontStruct *clockFontStruct, *coordFontStruct, *countFontStruct; XtAppContext appContext; char *layoutName; char *oldICSInteractionTitle; FileProc fileProc; -char *fileOpenMode; +char *fileOpenMode; +char installDir[] = "."; // [HGM] UCI: needed for UCI; probably needs run-time initializtion Position commentX = -1, commentY = -1; Dimension commentW, commentH; -int squareSize, smallLayout = 0, tinyLayout = 0, +int squareSize, smallLayout = 0, tinyLayout = 0, + marginW, marginH, // [HGM] for run-time resizing fromX = -1, fromY = -1, toX, toY, commentUp = False, analysisUp = False, ICSInputBoxUp = False, askQuestionUp = False, filenameUp = False, promotionUp = False, pmFromX = -1, pmFromY = -1, @@ -501,7 +521,9 @@ static Pixmap xpmMask[BlackKing + 1]; SizeDefaults sizeDefaults[] = SIZE_DEFAULTS; MenuItem fileMenu[] = { - {"Reset Game", ResetProc}, + {"New Game", ResetProc}, + {"New Shuffle Game ...", ShuffleMenuProc}, + {"New Variant ...", NewVariantProc}, // [HGM] variant: not functional yet {"----", NothingProc}, {"Load Game", LoadGameProc}, {"Load Next Game", LoadNextGameProc}, @@ -539,8 +561,11 @@ MenuItem modeMenu[] = { {"Edit Position", EditPositionProc}, {"Training", TrainingProc}, {"----", NothingProc}, + {"Show Engine Output", EngineOutputProc}, + {"Show Evaluation Graph", NothingProc}, // [HGM] evalgr: not functional yet {"Show Game List", ShowGameListProc}, - {"Show Move List", HistoryShowProc}, + {"Show Move History", HistoryShowProc}, // [HGM] hist: activate 4.2.7 code + {"----", NothingProc}, {"Edit Tags", EditTagsProc}, {"Edit Comment", EditCommentProc}, {"ICS Input Box", IcsInputBoxProc}, @@ -577,7 +602,13 @@ MenuItem stepMenu[] = { {NULL, NULL} }; -MenuItem optionsMenu[] = { +MenuItem optionsMenu[] = { + {"Flip View", FlipViewProc}, + {"----", NothingProc}, + {"Adjudications ...", EngineMenuProc}, + {"Engine Settings ...", UciMenuProc}, + {"Time Control ...", TimeControlProc}, + {"----", NothingProc}, {"Always Queen", AlwaysQueenProc}, {"Animate Dragging", AnimateDraggingProc}, {"Animate Moving", AnimateMovingProc}, @@ -589,7 +620,6 @@ MenuItem optionsMenu[] = { {"Auto Save", AutosaveProc}, {"Blindfold", BlindfoldProc}, {"Flash Moves", FlashMovesProc}, - {"Flip View", FlipViewProc}, {"Get Move List", GetMoveListProc}, #if HIGHDRAG {"Highlight Dragging", HighlightDraggingProc}, @@ -605,7 +635,7 @@ MenuItem optionsMenu[] = { {"Premove", PremoveProc}, {"Quiet Play", QuietPlayProc}, {"Show Coords", ShowCoordsProc}, - {"Show Thinking", ShowThinkingProc}, + {"Hide Thinking", HideThinkingProc}, {"Test Legality", TestLegalityProc}, {NULL, NULL} }; @@ -777,9 +807,9 @@ XtResource clientResources[] = { { "secondHost", "secondHost", XtRString, sizeof(String), XtOffset(AppDataPtr, secondHost), XtRString, SECOND_HOST }, { "firstDirectory", "firstDirectory", XtRString, sizeof(String), - XtOffset(AppDataPtr, firstDirectory), XtRString, FIRST_DIRECTORY }, + XtOffset(AppDataPtr, firstDirectory), XtRString, "." }, { "secondDirectory", "secondDirectory", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondDirectory), XtRString, SECOND_DIRECTORY }, + XtOffset(AppDataPtr, secondDirectory), XtRString, "." }, { "bitmapDirectory", "bitmapDirectory", XtRString, sizeof(String), XtOffset(AppDataPtr, bitmapDirectory), XtRString, "" }, @@ -892,7 +922,7 @@ XtResource clientResources[] = { (XtPointer) 0 }, { "showThinking", "showThinking", XtRBoolean, sizeof(Boolean), XtOffset(AppDataPtr, showThinking), XtRImmediate, - (XtPointer) False }, + (XtPointer) True }, { "ponderNextMove", "ponderNextMove", XtRBoolean, sizeof(Boolean), XtOffset(AppDataPtr, ponderNextMove), XtRImmediate, (XtPointer) True }, @@ -1149,16 +1179,16 @@ XtResource clientResources[] = { XtRImmediate, (XtPointer) False }, { "hideThinkingFromHuman", "hideThinkingFromHuman", XtRBoolean, sizeof(Boolean), XtOffset(AppDataPtr, hideThinkingFromHuman), - XtRImmediate, (XtPointer) False }, + XtRImmediate, (XtPointer) True }, { "adjudicateLossThreshold", "adjudicateLossThreshold", XtRInt, sizeof(int), XtOffset(AppDataPtr, adjudicateLossThreshold), XtRImmediate, (XtPointer) 0}, { "pgnEventHeader", "pgnEventHeader", XtRString, sizeof(String), XtOffset(AppDataPtr, pgnEventHeader), XtRImmediate, (XtPointer) "Computer Chess Game" }, - { "defaultFrcPosition", "defaultFrcPosition", XtRInt, - sizeof(int), XtOffset(AppDataPtr, defaultFrcPosition), - XtRImmediate, (XtPointer) -1 }, + { "defaultFrcPosition", "defaultFrcPositon", XtRInt, + sizeof(int), XtOffset(AppDataPtr, defaultFrcPosition), + XtRImmediate, (XtPointer) -1}, // [HGM] 4.3.xx options { "boardWidth", "boardWidth", XtRInt, @@ -1187,13 +1217,13 @@ XtResource clientResources[] = { XtRImmediate, (XtPointer) False}, { "testClaims", "testClaims", XtRBoolean, sizeof(Boolean), XtOffset(AppDataPtr, testClaims), - XtRImmediate, (XtPointer) False}, + XtRImmediate, (XtPointer) True}, { "checkMates", "checkMates", XtRBoolean, sizeof(Boolean), XtOffset(AppDataPtr, checkMates), - XtRImmediate, (XtPointer) False}, + XtRImmediate, (XtPointer) True}, { "materialDraws", "materialDraws", XtRBoolean, sizeof(Boolean), XtOffset(AppDataPtr, materialDraws), - XtRImmediate, (XtPointer) False}, + XtRImmediate, (XtPointer) True}, { "trivialDraws", "trivialDraws", XtRBoolean, sizeof(Boolean), XtOffset(AppDataPtr, trivialDraws), XtRImmediate, (XtPointer) False}, @@ -1241,7 +1271,54 @@ XtResource clientResources[] = { XtRImmediate, (XtPointer) 0}, { "suppressLoadMoves", "suppressLoadMoves", XtRBoolean, sizeof(Boolean), XtOffset(AppDataPtr, suppressLoadMoves), + XtRImmediate, (XtPointer) False}, + { "userName", "userName", XtRString, + sizeof(String), XtOffset(AppDataPtr, userName), + XtRImmediate, (XtPointer) 0}, + { "egtFormats", "egtFormats", XtRString, + sizeof(String), XtOffset(AppDataPtr, egtFormats), + XtRImmediate, (XtPointer) 0}, + { "rewindIndex", "rewindIndex", XtRInt, + sizeof(int), XtOffset(AppDataPtr, rewindIndex), + XtRImmediate, (XtPointer) 0}, + { "sameColorGames", "sameColorGames", XtRInt, + sizeof(int), XtOffset(AppDataPtr, sameColorGames), + XtRImmediate, (XtPointer) 0}, + { "smpCores", "smpCores", XtRInt, + sizeof(int), XtOffset(AppDataPtr, smpCores), + XtRImmediate, (XtPointer) 1}, + + // [HGM] Winboard_x UCI options + { "firstIsUCI", "firstIsUCI", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, firstIsUCI), + XtRImmediate, (XtPointer) False}, + { "secondIsUCI", "secondIsUCI", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, secondIsUCI), XtRImmediate, (XtPointer) False}, + { "firstHasOwnBookUCI", "firstHasOwnBookUCI", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, firstHasOwnBookUCI), + XtRImmediate, (XtPointer) True}, + { "secondHasOwnBookUCI", "secondHasOwnBookUCI", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, secondHasOwnBookUCI), + XtRImmediate, (XtPointer) True}, + { "usePolyglotBook", "usePolyglotBook", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, usePolyglotBook), + XtRImmediate, (XtPointer) False}, + { "defaultHashSize", "defaultHashSize", XtRInt, + sizeof(int), XtOffset(AppDataPtr, defaultHashSize), + XtRImmediate, (XtPointer) 64}, + { "defaultCacheSizeEGTB", "defaultCacheSizeEGTB", XtRInt, + sizeof(int), XtOffset(AppDataPtr, defaultCacheSizeEGTB), + XtRImmediate, (XtPointer) 4}, + { "polyglotDir", "polyglotDir", XtRString, + sizeof(String), XtOffset(AppDataPtr, polyglotDir), + XtRImmediate, (XtPointer) "." }, + { "polyglotBook", "polyglotBook", XtRString, + sizeof(String), XtOffset(AppDataPtr, polyglotBook), + XtRImmediate, (XtPointer) "" }, + { "defaultPathEGTB", "defaultPathEGTB", XtRString, + sizeof(String), XtOffset(AppDataPtr, defaultPathEGTB), + XtRImmediate, (XtPointer) "/usr/local/share/egtb"}, }; XrmOptionDescRec shellOptions[] = { @@ -1539,6 +1616,20 @@ XrmOptionDescRec shellOptions[] = { { "-hideThinkingFromHuman", "hideThinkingFromHuman", XrmoptionSepArg, NULL }, { "-adjudicateLossThreshold", "adjudicateLossThreshold", XrmoptionSepArg, NULL }, { "-pgnEventHeader", "pgnEventHeader", XrmoptionSepArg, NULL }, + { "-firstIsUCI", "firstIsUCI", XrmoptionSepArg, NULL }, + { "-secondIsUCI", "secondIsUCI", XrmoptionSepArg, NULL }, + { "-fUCI", "firstIsUCI", XrmoptionNoArg, "True" }, + { "-sUCI", "secondIsUCI", XrmoptionNoArg, "True" }, + { "-firstHasOwnBookUCI", "firstHasOwnBookUCI", XrmoptionSepArg, NULL }, + { "-secondHasOwnBookUCI", "secondHasOwnBookUCI", XrmoptionSepArg, NULL }, + { "-fNoOwnBookUCI", "firstHasOwnBookUCI", XrmoptionNoArg, "False" }, + { "-sNoOwnBookUCI", "secondHasOwnBookUCI", XrmoptionNoArg, "False" }, + { "-polyglotDir", "polyglotDir", XrmoptionSepArg, NULL }, + { "-usePolyglotBook", "usePolyglotBook", XrmoptionSepArg, NULL }, + { "-polyglotBook", "polyglotBook", XrmoptionSepArg, NULL }, + { "-defaultHashSize", "defaultHashSize", XrmoptionSepArg, NULL }, + { "-defaultCacheSizeEGTB", "defaultCacheSizeEGTB", XrmoptionSepArg, NULL }, + { "-defaultPathEGTB", "defaultPathEGTB", XrmoptionSepArg, NULL }, { "-defaultFrcPosition", "defaultFrcPosition", XrmoptionSepArg, NULL }, // [HGM] I am sure AS added many more options, but we have to fish them out, from the list in winboard.c @@ -1572,6 +1663,11 @@ XrmOptionDescRec shellOptions[] = { { "-serverMoves", "serverMoves", XrmoptionSepArg, NULL }, { "-serverPause", "serverPause", XrmoptionSepArg, NULL }, { "-suppressLoadMoves", "suppressLoadMoves", XrmoptionSepArg, NULL }, + { "-egtFormats", "egtFormats", XrmoptionSepArg, NULL }, + { "-userName", "userName", XrmoptionSepArg, NULL }, + { "-smpCores", "smpCores", XrmoptionSepArg, NULL }, + { "-sameColorGames", "sameColorGames", XrmoptionSepArg, NULL }, + { "-rewindIndex", "rewindIndex", XrmoptionSepArg, NULL }, }; @@ -1614,6 +1710,7 @@ XtActionsRec boardActions[] = { { "EditGameProc", EditGameProc }, { "EditPositionProc", EditPositionProc }, { "TrainingProc", EditPositionProc }, + { "EngineOutputProc", EngineOutputProc}, // [HGM] Winboard_x engine-output window { "ShowGameListProc", ShowGameListProc }, { "ShowMoveListProc", HistoryShowProc}, { "EditTagsProc", EditCommentProc }, @@ -1667,6 +1764,7 @@ XtActionsRec boardActions[] = { { "QuietPlayProc", QuietPlayProc }, { "ShowCoordsProc", ShowCoordsProc }, { "ShowThinkingProc", ShowThinkingProc }, + { "HideThinkingProc", HideThinkingProc }, { "TestLegalityProc", TestLegalityProc }, { "InfoProc", InfoProc }, { "ManProc", ManProc }, @@ -1687,6 +1785,12 @@ XtActionsRec boardActions[] = { { "GameListPopDown", (XtActionProc) GameListPopDown }, { "PromotionPopDown", (XtActionProc) PromotionPopDown }, { "HistoryPopDown", (XtActionProc) HistoryPopDown }, + { "EngineOutputPopDown", (XtActionProc) EngineOutputPopDown }, + { "ShufflePopDown", (XtActionProc) ShufflePopDown }, + { "EnginePopDown", (XtActionProc) EnginePopDown }, + { "UciPopDown", (XtActionProc) UciPopDown }, + { "TimeControlPopDown", (XtActionProc) TimeControlPopDown }, + { "NewVariantPopDown", (XtActionProc) NewVariantPopDown }, }; char globalTranslations[] = @@ -1977,10 +2081,76 @@ BoardToTop() #ifdef IDSIZES // eventually, all layout determining code should go into a subroutine, but until then IDSIZE remains undefined -#else +#else +#define BoardSize int void InitDrawingSizes(BoardSize boardSize, int flags) -{ // [HGM] Dummy routine to be able to link with backend files from 4.3.xx, which call it - ; +{ // [HGM] resize is functional now, but for board format changes only (nr of ranks, files) + Dimension timerWidth, boardWidth, boardHeight, w, h, sep, bor, wr, hr; + Arg args[16]; + XtGeometryResult gres; + int i; + + if(!formWidget) return; + + /* + * Enable shell resizing. + */ + shellArgs[0].value = (XtArgVal) &w; + shellArgs[1].value = (XtArgVal) &h; + XtGetValues(shellWidget, shellArgs, 2); + + shellArgs[4].value = 2*w; shellArgs[2].value = 10; + shellArgs[5].value = 2*h; shellArgs[3].value = 10; + XtSetValues(shellWidget, &shellArgs[2], 4); + + XtSetArg(args[0], XtNdefaultDistance, &sep); XtGetValues(formWidget, args, 1); + + boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap); + boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); + CreateGrid(); + + XtSetArg(args[0], XtNwidth, boardWidth); + XtSetArg(args[1], XtNheight, boardHeight); + XtSetValues(boardWidget, args, 2); + + timerWidth = (boardWidth - sep) / 2; + XtSetArg(args[0], XtNwidth, timerWidth); + XtSetValues(whiteTimerWidget, args, 1); + XtSetValues(blackTimerWidget, args, 1); + + XawFormDoLayout(formWidget, False); + + if (appData.titleInWindow) { + i = 0; + XtSetArg(args[i], XtNborderWidth, &bor); i++; + XtSetArg(args[i], XtNheight, &h); i++; + XtGetValues(titleWidget, args, i); + if (smallLayout) { + w = boardWidth - 2*bor; + } else { + XtSetArg(args[0], XtNwidth, &w); + XtGetValues(menuBarWidget, args, 1); + w = boardWidth - w - sep - 2*bor - 2; // WIDTH_FUDGE + } + + gres = XtMakeResizeRequest(titleWidget, w, h, &wr, &hr); + if (gres != XtGeometryYes && appData.debugMode) { + fprintf(stderr, + "%s: titleWidget geometry error %d %d %d %d %d\n", + programName, gres, w, h, wr, hr); + } + } + + XawFormDoLayout(formWidget, True); + + /* + * Inhibit shell resizing. + */ + shellArgs[0].value = w = (XtArgVal) boardWidth + marginW; + shellArgs[1].value = h = (XtArgVal) boardHeight + marginH; + shellArgs[4].value = shellArgs[2].value = w; + shellArgs[5].value = shellArgs[3].value = h; + XtSetValues(shellWidget, &shellArgs[0], 6); } #endif @@ -1997,7 +2167,51 @@ main(argc, argv) XtGeometryResult gres; char *p; XrmDatabase xdb; - int forceMono = False; + int forceMono = False; +#define INDIRECTION +#ifdef INDIRECTION + // [HGM] before anything else, expand any indirection files amongst options + char *argvCopy[1000]; // 1000 seems enough + char newArgs[10000]; // holds actual characters + int k = 0; + + srandom(time(0)); // [HGM] book: make random truly random + + j = 0; + for(i=0; i= 1000-2) { printf("too many arguments\n"); exit(-1); } +//fprintf(stderr, "arg %s\n", argv[i]); + if(argv[i][0] != '@') argvCopy[j++] = argv[i]; else { + char c; + FILE *f = fopen(argv[i]+1, "rb"); + if(f == NULL) { fprintf(stderr, "ignore %s\n", argv[i]); continue; } // do not expand non-existing + argvCopy[j++] = newArgs + k; // get ready for first argument from file + while((c = fgetc(f)) != EOF) { // each line of file inserts 1 argument in the list + if(c == '\n') { + if(j >= 1000-2) { printf("too many arguments\n"); exit(-1); } + newArgs[k++] = 0; // terminate current arg + if(k >= 10000-1) { printf("too long arguments\n"); exit(-1); } + argvCopy[j++] = newArgs + k; // get ready for next + } else { + if(k >= 10000-1) { printf("too long arguments\n"); exit(-1); } + newArgs[k++] = c; + } + } + newArgs[k] = 0; + j--; + fclose(f); + } + } + argvCopy[j] = NULL; + argv = argvCopy; + argc = j; +#if 0 + if(appData.debugMode,1) { // OK, appData is not initialized here yet... + for(i=0; i BOARD_SIZE ) DisplayFatalError("Recompile with BOARD_SIZE > 12, to support this size", 0, 2); - /* [HGM] The following line must be moved to the "New Shuffle Game" menu as soon as there is one! */ - if(appData.defaultFrcPosition != -1) shuffleOpenings = TRUE; - #if !HIGHDRAG /* This feature does not work; animation needs a rewrite */ appData.highlightDragging = FALSE; @@ -2180,6 +2391,9 @@ main(argc, argv) coordFontID = XLoadFont(xDisplay, appData.coordFont); coordFontStruct = XQueryFont(xDisplay, coordFontID); appData.font = FindFont(appData.font, fontPxlSize); + countFontID = XLoadFont(xDisplay, appData.coordFont); // [HGM] holdings + countFontStruct = XQueryFont(xDisplay, countFontID); +// appData.font = FindFont(appData.font, fontPxlSize); xdb = XtDatabase(xDisplay); XrmPutStringResource(&xdb, "*font", appData.font); @@ -2314,36 +2528,54 @@ main(argc, argv) formArgs, XtNumber(formArgs)); XtSetArg(args[0], XtNdefaultDistance, &sep); XtGetValues(formWidget, args, 1); - + j = 0; widgetList[j++] = menuBarWidget = CreateMenuBar(menuBar); + XtSetArg(args[0], XtNtop, XtChainTop); + XtSetArg(args[1], XtNbottom, XtChainTop); + XtSetValues(menuBarWidget, args, 2); widgetList[j++] = whiteTimerWidget = XtCreateWidget("whiteTime", labelWidgetClass, formWidget, timerArgs, XtNumber(timerArgs)); XtSetArg(args[0], XtNfont, clockFontStruct); - XtSetValues(whiteTimerWidget, args, 1); + XtSetArg(args[1], XtNtop, XtChainTop); + XtSetArg(args[2], XtNbottom, XtChainTop); + XtSetValues(whiteTimerWidget, args, 3); widgetList[j++] = blackTimerWidget = XtCreateWidget("blackTime", labelWidgetClass, formWidget, timerArgs, XtNumber(timerArgs)); XtSetArg(args[0], XtNfont, clockFontStruct); - XtSetValues(blackTimerWidget, args, 1); + XtSetArg(args[1], XtNtop, XtChainTop); + XtSetArg(args[2], XtNbottom, XtChainTop); + XtSetValues(blackTimerWidget, args, 3); if (appData.titleInWindow) { widgetList[j++] = titleWidget = XtCreateWidget("title", labelWidgetClass, formWidget, titleArgs, XtNumber(titleArgs)); + XtSetArg(args[0], XtNtop, XtChainTop); + XtSetArg(args[1], XtNbottom, XtChainTop); + XtSetValues(titleWidget, args, 2); } if (appData.showButtonBar) { widgetList[j++] = buttonBarWidget = CreateButtonBar(buttonBar); + XtSetArg(args[0], XtNleft, XtChainRight); // [HGM] glue to right window edge + XtSetArg(args[1], XtNright, XtChainRight); // for good run-time sizing + XtSetArg(args[2], XtNtop, XtChainTop); + XtSetArg(args[3], XtNbottom, XtChainTop); + XtSetValues(buttonBarWidget, args, 4); } widgetList[j++] = messageWidget = XtCreateWidget("message", labelWidgetClass, formWidget, - messageArgs, XtNumber(messageArgs)); - + messageArgs, XtNumber(messageArgs)); + XtSetArg(args[0], XtNtop, XtChainTop); + XtSetArg(args[1], XtNbottom, XtChainTop); + XtSetValues(messageWidget, args, 2); + widgetList[j++] = boardWidget = XtCreateWidget("board", widgetClass, formWidget, boardArgs, XtNumber(boardArgs)); @@ -2438,7 +2670,11 @@ main(argc, argv) } i = 0; XtSetArg(args[0], XtNfromVert, messageWidget); - XtSetValues(boardWidget, args, 1); + XtSetArg(args[1], XtNtop, XtChainTop); + XtSetArg(args[2], XtNbottom, XtChainBottom); + XtSetArg(args[3], XtNleft, XtChainLeft); + XtSetArg(args[4], XtNright, XtChainRight); + XtSetValues(boardWidget, args, 5); XtRealizeWidget(shellWidget); @@ -2448,6 +2684,7 @@ main(argc, argv) * The value "2" is probably larger than needed. */ XawFormDoLayout(formWidget, False); + #define WIDTH_FUDGE 2 i = 0; XtSetArg(args[i], XtNborderWidth, &bor); i++; @@ -2478,6 +2715,9 @@ main(argc, argv) programName, gres, w, h, wr, hr); } /* !! end hack */ + XtSetArg(args[0], XtNleft, XtChainLeft); // [HGM] glue ends for good run-time sizing + XtSetArg(args[1], XtNright, XtChainRight); + XtSetValues(messageWidget, args, 2); if (appData.titleInWindow) { i = 0; @@ -2623,8 +2863,8 @@ main(argc, argv) XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Coords"), args, 1); } - if (appData.showThinking) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Thinking"), + if (appData.hideThinkingFromHuman) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Hide Thinking"), args, 1); } if (appData.testLegality) { @@ -2659,8 +2899,10 @@ main(argc, argv) XtGetValues(shellWidget, shellArgs, 2); shellArgs[4].value = shellArgs[2].value = w; shellArgs[5].value = shellArgs[3].value = h; - XtSetValues(shellWidget, &shellArgs[2], 4); - + XtSetValues(shellWidget, &shellArgs[2], 4); + marginW = w - boardWidth; // [HGM] needed to set new shellWidget size when we resize board + marginH = h - boardHeight; + CatchDeleteWindow(shellWidget, "QuitProc"); CreateGCs(); @@ -2830,7 +3072,7 @@ Enables icsEnables[] = { { "menuHelp.Book", False }, { "menuStep.Move Now", False }, { "menuOptions.Periodic Updates", False }, - { "menuOptions.Show Thinking", False }, + { "menuOptions.Hide Thinking", False }, { "menuOptions.Ponder Next Move", False }, #endif { NULL, False } @@ -2859,7 +3101,7 @@ Enables ncpEnables[] = { { "menuOptions.ICS Alarm", False }, { "menuOptions.Move Sound", False }, { "menuOptions.Quiet Play", False }, - { "menuOptions.Show Thinking", False }, + { "menuOptions.Hide Thinking", False }, { "menuOptions.Periodic Updates", False }, { "menuOptions.Ponder Next Move", False }, { "menuHelp.Hint", False }, @@ -3121,6 +3363,12 @@ void CreateGCs() coordGC = XtGetGC(shellWidget, value_mask, &gc_values); XSetFont(xDisplay, coordGC, coordFontID); + // [HGM] make font for holdings counts (white on black0 + gc_values.foreground = XWhitePixel(xDisplay, xScreen); + gc_values.background = XBlackPixel(xDisplay, xScreen); + countGC = XtGetGC(shellWidget, value_mask, &gc_values); + XSetFont(xDisplay, countGC, countFontID); + if (appData.monoMode) { gc_values.foreground = XWhitePixel(xDisplay, xScreen); gc_values.background = XWhitePixel(xDisplay, xScreen); @@ -4207,20 +4455,20 @@ static int SquareColor(row, column) if (gameInfo.variant == VariantXiangqi) { if (column >= 3 && column <= 5 && row >= 0 && row <= 2) { - square_color = 0; - } else if (column >= 3 && column <= 5 && row >= 7 && row <= 9) { square_color = 1; + } else if (column >= 3 && column <= 5 && row >= 7 && row <= 9) { + square_color = 0; } else if (row <= 4) { - square_color = 1; - } else { square_color = 0; + } else { + square_color = 1; } } else { square_color = ((column + row) % 2) == 1; } /* [hgm] holdings: next line makes all holdings squares light */ - if(column < BOARD_LEFT || column >= BOARD_RGHT) square_color = 0; + if(column < BOARD_LEFT || column >= BOARD_RGHT) square_color = 1; return square_color; } @@ -4236,6 +4484,17 @@ void DrawSquare(row, column, piece, do_flash) DrawFunc drawfunc; int flash_delay; + if(gameInfo.variant == VariantShogi) { // [HGM] shogi: in shogi Q is used for Lance + if(piece == WhiteQueen) piece = WhiteLance; else + if(piece == BlackQueen) piece = BlackLance; + } +#ifdef GOTHIC + else if(gameInfo.variant == VariantGothic) { // [HGM] shogi: in Gothic Chancelor has alternative look + if(piece == WhiteMarshall) piece = WhiteSilver; else + if(piece == BlackMarshall) piece = BlackSilver; + } +#endif + /* Calculate delay in milliseconds (2-delays per complete flash) */ flash_delay = 500 / appData.flashRate; @@ -4251,11 +4510,40 @@ void DrawSquare(row, column, piece, do_flash) square_color = SquareColor(row, column); - if ( // [HGM] holdings: next 5 lines blank out area between board and holdings + if ( // [HGM] holdings: blank out area between board and holdings column == BOARD_LEFT-1 || column == BOARD_RGHT || (column == BOARD_LEFT-2 && row < BOARD_HEIGHT-gameInfo.holdingsSize) || (column == BOARD_RGHT+1 && row >= gameInfo.holdingsSize) ) { - BlankSquare(x, y, 2, EmptySquare, xBoardWindow); + BlankSquare(x, y, 2, EmptySquare, xBoardWindow); + + // [HGM] print piece counts next to holdings + string[1] = NULLCHAR; + if (column == (flipView ? BOARD_LEFT-1 : BOARD_RGHT) && piece > 1 ) { + string[0] = '0' + piece; + XTextExtents(countFontStruct, string, 1, &direction, + &font_ascent, &font_descent, &overall); + if (appData.monoMode) { + XDrawImageString(xDisplay, xBoardWindow, countGC, + x + squareSize - overall.width - 2, + y + font_ascent + 1, string, 1); + } else { + XDrawString(xDisplay, xBoardWindow, countGC, + x + squareSize - overall.width - 2, + y + font_ascent + 1, string, 1); + } + } + if (column == (flipView ? BOARD_RGHT : BOARD_LEFT-1) && piece > 1) { + string[0] = '0' + piece; + XTextExtents(countFontStruct, string, 1, &direction, + &font_ascent, &font_descent, &overall); + if (appData.monoMode) { + XDrawImageString(xDisplay, xBoardWindow, countGC, + x + 2, y + font_ascent + 1, string, 1); + } else { + XDrawString(xDisplay, xBoardWindow, countGC, + x + 2, y + font_ascent + 1, string, 1); + } + } } else { if (piece == EmptySquare || appData.blindfold) { BlankSquare(x, y, square_color, piece, xBoardWindow); @@ -4278,8 +4566,9 @@ void DrawSquare(row, column, piece, do_flash) } string[1] = NULLCHAR; - if (appData.showCoords && row == (flipView ? BOARD_HEIGHT-1 : 0)) { - string[0] = 'a' + column; + if (appData.showCoords && row == (flipView ? BOARD_HEIGHT-1 : 0) + && column >= BOARD_LEFT && column < BOARD_RGHT) { + string[0] = 'a' + column - BOARD_LEFT; XTextExtents(coordFontStruct, string, 1, &direction, &font_ascent, &font_descent, &overall); if (appData.monoMode) { @@ -4292,7 +4581,7 @@ void DrawSquare(row, column, piece, do_flash) y + squareSize - font_descent - 1, string, 1); } } - if (appData.showCoords && column == (flipView ? BOARD_WIDTH-1 : 0)) { + if (appData.showCoords && column == (flipView ? BOARD_RGHT-1 : BOARD_LEFT)) { string[0] = ONE + row; XTextExtents(coordFontStruct, string, 1, &direction, &font_ascent, &font_descent, &overall); @@ -4469,7 +4758,7 @@ void XDrawPosition(w, repaint, board) } else { if (lineGap > 0) XDrawSegments(xDisplay, xBoardWindow, lineGC, - gridSegments, (BOARD_SIZE + 1) * 2); + gridSegments, BOARD_HEIGHT + BOARD_WIDTH + 2); for (i = 0; i < BOARD_HEIGHT; i++) for (j = 0; j < BOARD_WIDTH; j++) { @@ -6820,14 +7109,37 @@ void ShowThinkingProc(w, event, prms, nprms) { Arg args[16]; - ShowThinkingEvent(!appData.showThinking); - + appData.showThinking = !appData.showThinking; // [HGM] thinking: tken out of ShowThinkingEvent + ShowThinkingEvent(); +#if 0 + // [HGM] thinking: currently no suc menu item; replaced by Hide Thinking (From Human) if (appData.showThinking) { XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); } else { XtSetArg(args[0], XtNleftBitmap, None); } XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Thinking"), + args, 1); +#endif +} + +void HideThinkingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ + Arg args[16]; + + appData.hideThinkingFromHuman = !appData.hideThinkingFromHuman; // [HGM] thinking: tken out of ShowThinkingEvent + ShowThinkingEvent(); + + if (appData.hideThinkingFromHuman) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Hide Thinking"), args, 1); } @@ -6889,10 +7201,12 @@ void AboutProc(w, event, prms, nprms) #else char *zippy = ""; #endif - sprintf(buf, "%s%s\n\n%s\n%s\n\n%s%s\n%s", + sprintf(buf, "%s%s\n\n%s\n%s\n%s\n%s\n\n%s%s\n%s", programVersion, zippy, "Copyright 1991 Digital Equipment Corporation", - "Enhancements Copyright 1992-2001 Free Software Foundation", + "Enhancements Copyright 1992-2001 Free Software Foundation", + "Enhancements Copyright 2005 Alessandro Scotti", + "Enhancements Copyright 2007-2008 H.G.Muller", PRODUCT, " is free software and carries NO WARRANTY;", "see the file COPYING for more information."); ErrorPopUp("About XBoard", buf, FALSE); @@ -6981,6 +7295,17 @@ void DisplayTitle(text) } else if (appData.cmailGameName[0] != NULLCHAR) { sprintf(icon, "%s", "CMail"); sprintf(title, "%s: %s", programName, "CMail"); +#ifdef GOTHIC + // [HGM] license: This stuff should really be done in back-end, but WinBoard already had a pop-up for it + } else if (gameInfo.variant == VariantGothic) { + strcpy(icon, programName); + strcpy(title, GOTHIC); +#endif +#ifdef FALCON + } else if (gameInfo.variant == VariantFalcon) { + strcpy(icon, programName); + strcpy(title, FALCON); +#endif } else if (appData.noChessProgram) { strcpy(icon, programName); strcpy(title, programName); @@ -7658,14 +7983,16 @@ int StartChildProcess(cmdLine, dir, pr) SetUpChildIO(to_prog, from_prog); if ((pid = fork()) == 0) { - /* Child process */ - dup2(to_prog[0], 0); - dup2(from_prog[1], 1); - close(to_prog[0]); - close(to_prog[1]); + /* Child process */ + // [HGM] PSWBTM: made order resistant against case where fd of created pipe was 0 or 1 + close(to_prog[1]); // first close the unused pipe ends close(from_prog[0]); - close(from_prog[1]); - dup2(1, fileno(stderr)); /* force stderr to the pipe */ + dup2(to_prog[0], 0); // to_prog was created first, nd is the only one to use 0 or 1 + dup2(from_prog[1], 1); + if(to_prog[0] >= 2) close(to_prog[0]); // if 0 or 1, the dup2 already cosed the original + close(from_prog[1]); // and closing again loses one of the pipes! + if(fileno(stderr) >= 2) // better safe than sorry... + dup2(1, fileno(stderr)); /* force stderr to the pipe */ if (dir[0] != NULLCHAR && chdir(dir) != 0) { perror(dir); @@ -8727,5 +9054,7 @@ DrawDragPiece () void SetProgramStats( FrontEndProgramStats * stats ) { - // [HR] TODO + // [HR] TODO + // [HGM] done, but perhaps backend should call this directly? + EngineOutputUpdate( stats ); } diff --git a/xboard.h b/xboard.h index 03e2d5c..88b463b 100644 --- a/xboard.h +++ b/xboard.h @@ -1,119 +1,117 @@ -/* - * xboard.h -- Parameter definitions for X front end - * $Id: xboard.h,v 2.1 2003/10/27 19:21:00 mann Exp $ - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-95 Free Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - */ - -#include - -#define ICS_LOGON ".icsrc" -#define INFOFILE "xboard.info" -#define MANPAGE "xboard.6" -#define CLOCK_FONT "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*" -#define COORD_FONT "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*" -#define DEFAULT_FONT "-*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*" -#define COLOR_SHOUT "green" -#define COLOR_SSHOUT "green,black,1" -#define COLOR_CHANNEL1 "cyan" -#define COLOR_CHANNEL "cyan,black,1" -#define COLOR_KIBITZ "magenta,black,1" -#define COLOR_TELL "yellow,black,1" -#define COLOR_CHALLENGE "red,black,1" -#define COLOR_REQUEST "red" -#define COLOR_SEEK "blue" -#define COLOR_NORMAL "default" - -typedef struct { - char *name; - int squareSize; - int lineGap; - int clockFontPxlSize; - int coordFontPxlSize; - int fontPxlSize; - int smallLayout; - int tinyLayout; - int minScreenSize; -} SizeDefaults; - -#define SIZE_DEFAULTS \ -{ { "Titanic", 129, 4, 34, 14, 14, 0, 0, 1200 }, \ - { "Colossal", 116, 4, 34, 14, 14, 0, 0, 1200 }, \ - { "Giant", 108, 3, 34, 14, 14, 0, 0, 1024 }, \ - { "Huge", 95, 3, 34, 14, 14, 0, 0, 1024 }, \ - { "Big", 87, 3, 34, 14, 14, 0, 0, 864 }, \ - { "Large", 80, 3, 34, 14, 14, 0, 0, 864 }, \ - { "Bulky", 72, 3, 34, 12, 14, 0, 0, 864 }, \ - { "Medium", 64, 3, 34, 12, 14, 0, 0, 768 }, \ - { "Moderate", 58, 3, 34, 12, 14, 0, 0, 768 }, \ - { "Average", 54, 2, 30, 11, 12, 0, 0, 600 }, \ - { "Middling", 49, 2, 24, 10, 12, 0, 0, 600 }, \ - { "Mediocre", 45, 2, 20, 10, 12, 1, 0, 600 }, \ - { "Small", 40, 2, 20, 10, 12, 1, 0, 480 }, \ - { "Slim", 37, 2, 20, 10, 12, 1, 0, 480 }, \ - { "Petite", 33, 1, 15, 9, 11, 1, 0, 480 }, \ - { "Dinky", 29, 1, 15, 9, 11, 1, 0, 480 }, \ - { "Teeny", 25, 1, 12, 8, 11, 1, 1, 480 }, \ - { "Tiny", 21, 1, 12, 8, 11, 1, 1, 0 }, \ - { NULL, 0, 0, 0, 0, 0, 0 } } - -#define BORDER_X_OFFSET 3 -#define BORDER_Y_OFFSET 27 -#define FIRST_CHESS_PROGRAM "./fmax" -#define SECOND_CHESS_PROGRAM "./fmax" -#define FIRST_DIRECTORY "./Fairy-Max" -#define SECOND_DIRECTORY "./Fairy-Max" - -/* Default to no flashing (the "usual" XBoard behavior) */ -#define FLASH_COUNT 0 /* Number of times to flash */ -#define FLASH_RATE 5 /* Flashes per second */ - -/* Default delay per character (in msec) while sending login script */ -#define MS_LOGIN_DELAY 0 - -typedef int (*FileProc) P((FILE *f, int n, char *title)); -void CatchDeleteWindow(Widget w, String procname); - -#define TOPLEVEL 1 /* preference item; 1 = make popup windows toplevel */ - +/* + * xboard.h -- Parameter definitions for X front end + * $Id: xboard.h,v 2.1 2003/10/27 19:21:00 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-95 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + +#include + +#define ICS_LOGON ".icsrc" +#define INFOFILE "xboard.info" +#define MANPAGE "xboard.6" +#define CLOCK_FONT "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*" +#define COORD_FONT "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*" +#define DEFAULT_FONT "-*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*" +#define COLOR_SHOUT "green" +#define COLOR_SSHOUT "green,black,1" +#define COLOR_CHANNEL1 "cyan" +#define COLOR_CHANNEL "cyan,black,1" +#define COLOR_KIBITZ "magenta,black,1" +#define COLOR_TELL "yellow,black,1" +#define COLOR_CHALLENGE "red,black,1" +#define COLOR_REQUEST "red" +#define COLOR_SEEK "blue" +#define COLOR_NORMAL "default" + +typedef struct { + char *name; + int squareSize; + int lineGap; + int clockFontPxlSize; + int coordFontPxlSize; + int fontPxlSize; + int smallLayout; + int tinyLayout; + int minScreenSize; +} SizeDefaults; + +#define SIZE_DEFAULTS \ +{ { "Titanic", 129, 4, 34, 14, 14, 0, 0, 1200 }, \ + { "Colossal", 116, 4, 34, 14, 14, 0, 0, 1200 }, \ + { "Giant", 108, 3, 34, 14, 14, 0, 0, 1024 }, \ + { "Huge", 95, 3, 34, 14, 14, 0, 0, 1024 }, \ + { "Big", 87, 3, 34, 14, 14, 0, 0, 864 }, \ + { "Large", 80, 3, 34, 14, 14, 0, 0, 864 }, \ + { "Bulky", 72, 3, 34, 12, 14, 0, 0, 864 }, \ + { "Medium", 64, 3, 34, 12, 14, 0, 0, 768 }, \ + { "Moderate", 58, 3, 34, 12, 14, 0, 0, 768 }, \ + { "Average", 54, 2, 30, 11, 12, 0, 0, 600 }, \ + { "Middling", 49, 2, 24, 10, 12, 0, 0, 600 }, \ + { "Mediocre", 45, 2, 20, 10, 12, 1, 0, 600 }, \ + { "Small", 40, 2, 20, 10, 12, 1, 0, 480 }, \ + { "Slim", 37, 2, 20, 10, 12, 1, 0, 480 }, \ + { "Petite", 33, 1, 15, 9, 11, 1, 0, 480 }, \ + { "Dinky", 29, 1, 15, 9, 11, 1, 0, 480 }, \ + { "Teeny", 25, 1, 12, 8, 11, 1, 1, 480 }, \ + { "Tiny", 21, 1, 12, 8, 11, 1, 1, 0 }, \ + { NULL, 0, 0, 0, 0, 0, 0 } } + +#define BORDER_X_OFFSET 3 +#define BORDER_Y_OFFSET 27 +#define FIRST_CHESS_PROGRAM "./fmax" +#define SECOND_CHESS_PROGRAM "./fmax" + +/* Default to no flashing (the "usual" XBoard behavior) */ +#define FLASH_COUNT 0 /* Number of times to flash */ +#define FLASH_RATE 5 /* Flashes per second */ + +/* Default delay per character (in msec) while sending login script */ +#define MS_LOGIN_DELAY 0 + +typedef int (*FileProc) P((FILE *f, int n, char *title)); +void CatchDeleteWindow(Widget w, String procname); + +#define TOPLEVEL 1 /* preference item; 1 = make popup windows toplevel */ + diff --git a/xboard.texi b/xboard.texi index b6e9634..0e0c270 100644 --- a/xboard.texi +++ b/xboard.texi @@ -1,3 +1,5 @@ +@setfilename xboard.info + @ifinfo @format INFO-DIR-SECTION Games @@ -119,7 +121,9 @@ for white and the right button (or shift+middle) for black. When you are playing a bughouse game on an Internet Chess Server, a list of the offboard pieces that each player has available is shown in the window title after the player's name; in addition, the piece menus show the -number of pieces available of each type. +number of pieces available of each type. From version 4.3.14 on, it is +also possible in crazyhouse, bughouse or shogi to dag and drop pieces +to the board from the holdings squares displayed next to the board. All other XBoard commands are available from the menu bar. The most frequently used commands also have shortcut keys or on-screen buttons. @@ -144,15 +148,35 @@ feature to work. @cindex File Menu @cindex Menu, File @table @asis -@item Reset -@cindex Reset, Menu Item +@item New Game +@cindex New Game, Menu Item Resets XBoard and the chess engine to the beginning of a new chess game. The @kbd{r} key is a keyboard equivalent. In Internet Chess Server mode, clears the current state of XBoard, then resynchronizes with the ICS by sending a refresh command. If you want to stop playing, observing, or examining an ICS game, use an -appropriate command from the Action menu, not @samp{Reset}. +appropriate command from the Action menu, not @samp{New Game}. @xref{Action Menu}. +@item New Shuffle Game +@cindex New Shuffle Game, Menu Item +Similar to @samp{New Game}, but allows you to specify a particular initial position +(according to a standardized numbering system) +in chess variants which use randomized opening positions (e.g. Chess960). +The selected opening position will persistently be chosen on any following +New Game command until you use this menu to select another. Selecting +position number -1 will produce a newly randomized position on any new game. +Using this menu item in variants that normally do not shuffle their opening position +does cause these variants to become shuffle variants until you use the +@samp{New Shuffle Game} menu to explicitly switch the randomization off, +or select a new variant. +@item New Variant +@cindex New variant, Menu Item +Allows you to select a new chess variant in non-ICS mode. +(In ICS play, the ICS is responsible for deciding which variant will be played, +and XBoard adapts autmatically.) If you play with an engine, the engine must +be able to play the selected variant, or the command will be ignored. +XBoard supports all major variants, such as xiangqi, shogi, chess, chess960, +Capablanca Chess, shatranj, crazyhous, bughouse. @item Load Game @cindex Load Game, Menu Item Plays a game from a record file. The @kbd{g} key is a keyboard equivalent. @@ -385,6 +409,15 @@ selecting @samp{Load Game} from the File menu). While XBoard is in @cindex Show Game List, Menu Item Shows or hides the list of games generated by the last @samp{Load Game} command. +@item Show Move History +@cindex Show Move History, Menu Item +Shows or hides a list of moves of the current game. +This list allows you to move the display to any earlier position in the game +by clicking on the corresponding move. +@item Show Engine Output +@cindex Show Engine Output, Menu Item +Shows or hides a window in which the thinking output of any loaded engines +is displayed. @item Edit Tags @cindex Edit Tags, Menu Item Lets you edit the PGN (portable game notation) @@ -602,6 +635,54 @@ depending on whether it is your opponent's move or yours. @cindex Menu, Options @cindex Options Menu @table @asis +@item Flip View +@cindex Flip View, Menu Item +Inverts your view of the chess board for the duration of the +current game. Starting a new game returns the board to normal. +The @kbd{v} key is a keyboard equivalent. +@item Adjudications +@cindex Adjudications, Menu Item +Pops up a sub-menu where you can enable or disable various adjudications +that XBoard can perform in engine-engine games. +You can instruct XBoard to detect and terminate the game on checkmate +or stalemate, even if the engines would not do so, to verify engine +result claims (forfeiting engines that make false claims), rather than +naively following the engine, to declare draw on posititions +which can never be won for lack of mating material, (e.g. KBK), +or which are impossble to win unless the opponent seeks its own demise +(e.g. KBKN). +For these adjudications to work, @samp{Test Legality} should be switched on. +It is also possible to insruct XBoard to enforce a 50-move or 3-fold-repeat +rule and automtically declare draw (after a user-adjustable number of moves +or repeats) even if the engines are prepared to go on. +It is also possible to have XBoard declare draw on games that seem to drag on +forever, or adjudicate a loss if both engines agree (for 3 cosecutive moves) that one +of them is behind more than a user-adjustable score threshold. +For the latter adjudication to work, XBoard should be able to properly understand +the engine's scores. To faclitate the latter, you can inform xboard here if +the engines report scores from the viewpoint of white, or from that of their own color. +@item Engine Settings +@citem Engine Settings, Menu Item +Pops up a sub-menu where you can set some engine parameters common to most engines, +such as hash-table size, tablebase cache size, maximum number of processors +that SMP engines can use, and where to find the Polyglot adapter needed +to run UCI engines under XBoard. The feature tht allows setting of these parameters on +engines is new since XBoard 4.3.15, so not many WinBoard engines respond +to it yet, but UCI engines should. +It is also possible to specify a GUI opening book here, i.e. an opening +book that XBoard consults for any position a playing engine gets in. +It then forces the engine to play the book move, rather than to think up its own, +if that position is found in the book. +The book can switched on and off independently for either engine. +@item Time Control +@cindex Time Control, Menu Item +Pops up a sub-menu where you can set the time-control parameters interactively. +Allows you to select classical or incremental time controls, +set the moves per session, session duration, and time increment. +Also allows specification of time-odds factors for one or both engines. +If an engine is given a time-odds factor N, all time quota it gets, +be it at the beginning of a session or through the time increment or +fixed time per move, will be divided by N. @item Always Queen @cindex Always Queen, Menu Item If this option is off, XBoard brings up a dialog @@ -684,11 +765,6 @@ the pieces are invisible. If this option is on, whenever a move is completed, the moved piece flashes. The number of times to flash is set by the flashCount command-line option; it defaults to 3 if Flash Moves is first turned on from the menu. -@item Flip View -@cindex Flip View, Menu Item -Inverts your view of the chess board for the duration of the -current game. Starting a new game returns the board to normal. -The @kbd{v} key is a keyboard equivalent. If you are playing a game on an ICS, the board is always oriented at the start of the game so that your pawns move from @@ -799,9 +875,9 @@ by shouts from other ICS users while playing. @cindex Show Coords, Menu Item If this option is on, XBoard displays algebraic coordinates along the board's left and bottom edges. -@item Show Thinking -@cindex Show Thinking, Menu Item -If this option is set, the chess engine's notion of the score and best +@item Hide Thinking +@cindex Hide Thinking, Menu Item +If this option is off, the chess engine's notion of the score and best line of play from the current position is displayed as it is thinking. The score indicates how many pawns ahead (or if negative, behind) the chess engine thinks it is. In matches between two @@ -944,9 +1020,11 @@ true or false (@samp{XBoard*longOptionName: true}). @menu * Chess engine options:: Controlling the chess engine. +* WB + UCI Engine Settings:: Setting some very common engine parameters * ICS options:: Connecting to and using ICS. * Load and Save options:: Input/output options. * User interface options:: Look and feel options. +* Adjudication options:: Control adjudcation of engine-engine games. * Other options:: Miscellaneous. @end menu @@ -1000,14 +1078,58 @@ when searching for a move to make. Without this option, the chess engine chooses its search depth based on the number of moves and amount of time remaining until the next time control. With the option, the engine will cut off its search early if it reaches the specified depth. +@item -firstNPS number +@itemx -secondNPS number +@cindex firstNPS, option +@cindex secondNPS, option +Tells the chess engine to use an internal time standard based on its node count, +rather then wall-clock time, to make its timing decisions. +The time in virtual seconds should be obtained by dividing the node count +through the given number, like the number was a rate in nodes per second. +Xboard will manage the clocks in accordance with this, relying on the number +of nodes reported by the engine in its thinking output. If the given number equals zero, +it can obviously not be used to convert nodes to seconds, and the time reported +by the engine is used to decrement the XBoard clock in stead. The engine is supposed to +report in CPU time it uses, rather than wall-clock time, in this mode. This option +can provide fairer conditions for engine-engine matches on heavily loaded machines, +or with very fast games (where the wall clock is too inaccurate). +@code{showThinking} must be on for this option to work. Default: -1 (off). +Not many engines might support this yet! +@item -firstTimeOdds factor +@itemx -secondTimeOdds factor +@cindex firstTimeOdds, option +@cindex secondTimeOdds, option +Reduces the time given to the mentioned engine by the given factor. +If pondering is off, the effect is indistinguishable from what would happen +if the engine was running on an n-times slower machine. Default: 1. +@item -timeOddsMode mode +@cindex timeOddsMode, option +This option determines how the case is handled where both engines have a time-odds handicap. +If mode=1, the engine that gets the most time will always get the nominal time, +as specified by the time-control options, and its opponent's time is renormalized accordingly. +If mode=0, both play with reduced time. Default: 0. +@item -hideThinkingFromHuman true/false +Controls the Hide Thinking option. @xref{Options Menu}. Default: true. +(Relaces the Show-Thinking option of older xboard versions.) @item -thinking/-xthinking or -showThinking true/false @cindex thinking, option @cindex showThinking, option -Sets the Show Thinking option. @xref{Options Menu}. Default: false. +Forces the engine to send thinking output to xboard. +Used to be the only way to control if thinking output was displayed +in older xboard versions, +but as the thinking output in xboard 4.3 is also used for several other +purposes (adjudication, storing in PGN file) the display of it is now controlled +by the new option Hide Thinking. @xref{Options Menu}. Default: false. +(But if xboard needs the thinking output for some purpose, +it makes the engine send it despite the setting of this option.) @item -ponder/-xponder or -ponderNextMove true/false @cindex ponder, option @cindex ponderNextMove, option Sets the Ponder Next Move menu option. @xref{Options Menu}. Default: true. +@item -smpCores number +@citem smpCores, option +Specifies the maxmum nmber of CPUs an SMP engine is allowed to use. +Only works for engines that support the WinBoard-protocol cores feature. @item -mg or -matchGames n @cindex mg, option @cindex matchGames, option @@ -1027,17 +1149,24 @@ displays the match score and exits. Default: 0 (do not run a match). @cindex matchMode, option Setting @code{matchMode} to true is equivalent to setting @code{matchGames} to 1. +@item -sameColorGames n +@cinex sameColorGames, option +Automatically runs an n-game match between two chess engines, +without alternating colors. +Otherwise the same applies as for the @samp{-matchGames} option, +over which it takes precedence if both are specified. (See there.) +Default: 0 (do not run a match). @item -fcp or -firstChessProgram program @cindex fcp, option @cindex firstChessProgram, option Name of first chess engine. -Default: @file{gnuchessx}. +Default: @file{Fairy-Max}. @item -scp or -secondChessProgram program @cindex scp, option @cindex secondChessProgram, option Name of second chess engine, if needed. A second chess engine is started only in Two Machines (match) mode. -Default: @file{gnuchessx}. +Default: @file{Fairy-Max}. @item -fb/-xfb or -firstPlaysBlack true/false @cindex fb, option @cindex firstPlaysBlack, option @@ -1133,6 +1262,80 @@ protocol to use. By default, version-number is 2. In version 1, the "protover" command is not sent to the engine; since version 1 is a subset of version 2, nothing else changes. Other values for version-number are not supported. +@item -firstScoreAbs true/false +@itemx -secondScoreAbs true/false +@cindex firstScoreAbs, option +@cindex secondScoreAbs, option +If this option is set, the score reported by the engine is taken to be +that in favor of white, even when the engine plays black. +Important when XBoard uses the score for adjudications, or in PGN reporting. +@end table + + + +@node UCI + WB Engine Settings +@cindex Engine Settings +@cindex Settings, Engine +@table @asis +@item -fUCI or -firstIsUCI true/false +@itemx -sUCI or -secondIsUCI true/false +@cindex fUCI, option +@cindex sUCI, option +@cindex firstIsUCI, option +@cindex secondIsUCI, option +Indicates if the mentioned engine executable file is an UCI engine, +and should be run with the aid of the Polyglot adapter rather than directly. +Xboard will then pass the other UCI options and engine name to Polyglot +through a .ini temporary file ceated for the purpose. +@item -PolyglotDir filename +@cindex PolyglotDir, option +Gives the name of the directory in which the Polyglot adapter for UCI engines expects its files. +Default: "/usr/local/share/polyglot". +@item -usePolyglotBook true/false +@cindex usePolyglotBook, option +Specifies if the Polygot book should be used. +@item -PolyglotBook filename +@cindex PolyglotBook, option +Gives the filename of the opening book that Polyglot should use. +From XBoard 4.3.15 on, native WinBoard engines will also use the opening book specified here, +provided the @code{usePolyglotBook} option is set to true, +and the option @code{firstHasOwnBookUCI} or @code{secondHasOwnBookUCI} applying to the engine +is set to false. +The engine will be kept in force mode as long as the current position is in book, +and XBoard will select the book moves for it. Default "". +@item -fNoOwnBookUCI or -firstHasOwnBookUCI true/false +@itemx -sNoOwnBookUCI or -secondHasOwnBookUCI true/false +@cindex fNoOwnBookUCI, option +@cindex sNoOwnBookUCI, option +@cindex firstHasOwnBookUCI, option +@cindex secondHasOwnBookUCI, option +Indicates if the mentioned engine has its own opening book it should play from, +rather than using the external book through XBoard. Default: false. +@item -defaultHashSize n +@cindex defaultHashSize, option +Sets the size of the hash table to n MegaBytes. Together with the EGTB cache size +this number is also used to calculate the memory setting of WinBoard engines, +for those that support the memory feature of WinBoard protocol. Default: 64. +@item -defaultCacheSizeEGTB n +@cindex defaultCacheSizeEGTB, option +Sets the size of the EGTB cache to n MegaBytes. Together with the hash-table size +this number is also used to calculate the memory setting of WinBoard engines, +for those that support the memory feature of WinBoard protocol. Default: 4. +@item -defaultPathEGTB filename +@cindex defaultPathEGTB, option +Gives the name of the directory where the end-game tablebases are installed, for UCI engines. +Default: "/usr/local/share/egtb". +@item -egtFormats string +@cindex egtFormats, option +Specifies which end-game tables are installed on the computer, and where. +The argument is a comma-separated list of format specifications, +each specification consisting of a format name, a colon, and a directory path name, +e.g. "nalimov:/usr/local/share/egtb". +If the name part matches that of a format that the engine requests through a feature command, +xboard will relay the path name for this format to the engine through an egtpath command. +One egtpath command for each matching format will be sent. +Popular formats are "nalimov" DTM tablebases and "scorpio" bitbases. +Default: "". @end table @node ICS options @@ -1285,6 +1488,12 @@ Sets the Auto Flag menu option. @xref{Options Menu}. Default: false. @cindex autobs, option @cindex autoObserve, option Sets the Auto Observe menu option. @xref{Options Menu}. Default: false. +@item -autoKibitz +@cindex autoKibitz, option` +Enables kibitzing of the engines last thinking output (depth, score, time, speed, PV) +before it moved +to the ICS, in zippy mode. The option @code{showThinking} must be switched on for +this option to work. @item -moves/-xmoves or -getMoveList true/false @cindex moves, option @cindex getMoveList, option @@ -1455,6 +1664,20 @@ The menu is also suppressed if @code{matchMode} is enabled or if the game file is a pipe; in these cases the first game in the file is loaded immediately. Use the @file{pxboard} shell script provided with XBoard if you want to pipe in files containing multiple games and still see the menu. +If the loadGameIndex specifies an index -1, this triggers auto-increment +of the index in @code{matchMode}, which means that after every game the +index is incremented by one, causing each game of the match to be played +from the next game in the file. Similarly, specifying an index value of -2 +causes the index to be incremented every two games, so that each game +in the file is used twice (with reversed colors). +The @code{rewindIndex} option causes the index to be reset to the +first game of the file when it has reached a specified value. +@item -rewindIndex n +@citem rewindIndex, option +Causes a position file or game file to be rewound to its beginning after n +positions or games in auto-increment @code{matchMode}. +See @code{loadPositionIndex} and @code{loadGameIndex}. +default: 0 (no rewind). @item -td or -timeDelay seconds @cindex td, option @cindex timeDelay, option @@ -1484,13 +1707,32 @@ specified position file at startup. The file name @file{-} specifies the standard input. If the @code{loadPositionIndex} option is set to N, the Nth position found in the file is loaded; otherwise the first position is loaded. +If the loadPositionIndex specifies an index -1, this triggers auto-increment +of the index in @code{matchMode}, which means that after every game the +index is incremented by one, causing each game of the match to be played +from the next position in the file. Similarly, specifying an index value of -2 +causes the index to be incremented every two games, so that each position +in the file is used twice (with the engines playing opposite colors). +The @code{rewindIndex} option causes the index to be reset to the +first position of the file when it has reached a specified value. @item -spf or -savePositionFile file @cindex spf, option @cindex savePositionFile, option If this option is set, XBoard appends the final position reached in every game played to the specified file. The file name @file{-} specifies the standard output. -@item -oldsave/-xoldsave or -oldSaveStyle true/false +@item -pgnExtendedInfo true/false +@cindex pgnExtendedInfo, option` +If this option is set, WinBoard saves depth, score and time used for each +move that the engine found as a comment in the PGN file. +Default: false. +@item -pgnEventHeader string +@cindex pgnEventHeader, option` +Sets the name used in the PGN event tag to string. +Default: "Computer Chess Game". +@item -saveOutOfBookInfo true/false +@cindex saveOutOfBookInfo, option` +Include the information on how the engine(s) game out of its opening book in a special ‘annotator’ tag with the PGN file.@item -oldsave/-xoldsave or -oldSaveStyle true/false @cindex oldsave, option @cindex oldSaveStyle, option Sets the Old Save Style menu option. @xref{Options Menu}. Default: false. @@ -1770,6 +2012,61 @@ Number of milliseconds delay between each animation frame when Animate Moves is on. @end table +@node Adjudication Options +@section Adjudication Options +@cindex Options, adjudication +@table @asis +@item -adjudicateLossThreshold n +@cindex adjudicateLossThreshold, option +If the given value is non-zero, XBoard adjudicates the game as a loss +if both engines agree for a duration of 6 consecutive ply that the score +is below the given score threshold for that engine. Make sure the score +is interpreted properly by XBoard, +using @code{-firstScoreAbs} and @code{-secondScoreAbs} if needed. +Default: 0 (no adjudiction) +@item -adjudicateDrawMoves n +@cindex adjudicateDrawMoves, option +If the given value is non-zero, XBoard adjudicates the game as a draw +if after the given number of moves it was not yet decided. Defaut: 0 (no adjudication) +@item -checkMates true/false +@cindex checkMates, option +If this option is set, XBoard detects all checkmates and stalemates, +and ends the game as soon as they occur. +Legality-testing must be switched on for this option to work. +Default: true +@item -testClaims true/false +@cindex testClaims, option +If this option is set, XBoard verifies all result claims made by engines, +and those who send false claims will forfeit the game because of it. +Legality-testing must be switched on for this option to work. Default: true +@item -materialDraws true/false +@cindex materialDraws, option +If this option is set, XBoard adjudicates games as draws when there is +no sufficient material left to inflict a checkmate. +This applies to KBKB with like bishops (any number, actually), and to KBK, KNK and KK. +Legality-testing must be switched on for this option to work. Default: true +@item -trivialDraws true/false +@cindex trivialDraws, option +If this option is set, XBoard adjudicates games as draws that cannot be +usually won without opponent cooperation. This applies to KBKB with unlike bishops, +and to KBKN, KNKN, KNNK, KRKR and KQKQ. The draw is called after 6 ply into these end-games, +to allow quick mates that can occur in some exceptional positions to be found by the engines. +KQKQ does not really belong in this category, and might be taken out in the future. +(When bitbase-based adjudications are implemented.) +Legality-testing must be on for this option to work. Default: false +@item -ruleMoves n +@cindex ruleMoves, option +If the given value is non-zero, XBoard adjudicates the game as a draw after the given +number of consecutive reversible moves. Engine draw claims are always accepted after 50 moves, +irrespective of the given value of n. +@item -repeatsToDraw n +If the given value is non-zero, xboard adjudicates the game as a draw if a position +is repeated the given number of times. Engines draw claims are always accepted after 3 repeats, +(on the 3rd occurrence, actually), irrespective of the value of n. +Beware that positions that have different castling or en-passant rights do not count +as repeats, XBoard is fully e.p. and castling aware! +@end table + @node Other options @section Other Options @cindex Options, miscellaneous @@ -1810,17 +2107,83 @@ kriegspiel Opponent's pieces are invisible atomic Capturing piece explodes (ICC wild 27) 3check Win by giving check 3 times (ICC wild 25) shatranj An ancient precursor of chess (ICC wild 28) +xiangqi Chinese Chess (on a 9x10 board) +shogi Japanese Chess (on a 9x9 board & piece drops) +capablanca Capablanca Chess (10x8 board, with Archbishop + and Chancellor pieces) +gothic similar, with a better initial position +caparandom An FRC-like version of Capablanca Chess (10x8) +janus A game with two Archbishops (10x8 board) +courier Medieval intermedite between shatranj and + modern Chess (on 12x8 board) +falcon Patented 10x8 variant with two Falcon pieces +berolina Pawns capture straight ahead, and move diagonal +cylinder Pieces wrap around the board edge +knightmate King moves as Knight, and vice versa +super Superchess (shuffle variant with 4 exo-pieces) +fairy A catchall variant in which all piece types + known to XBoard can participate (8x8) unknown Catchall for other unknown variants @end example -In the shuffle variants, xboard does not shuffle the pieces, but -you can do it by hand using Edit Position. Some variants are -supported only in ICS mode, including fischerandom, bughouse, and +In the shuffle variants, XBoard now does shuffle the pieces, although +you can still do it by hand using Edit Position. Some variants are +supported only in ICS mode, including bughouse, and kriegspiel. The winning/drawing conditions in crazyhouse (offboard interposition on mate), losers, suicide, giveaway, atomic, and 3check -are not fully understood. In crazyhouse, xboard does not yet keep -track of offboard pieces. Shatranj is unsupported, but it may be -usable if you turn off Test Legality. +are not fully understood. +Berolina and cylinder chess can only be played with legality testing off. +In crazyhouse, XBoard now does keep +track of offboard pieces. In shatranj it does implement the baring +rule when mate detection is switched on. +@item -boardHeight N +@cindex boardHeight, option +Allows you to set a non-standard number of board ranks in any variant. +If the height is given as -1, the default height for the variant is used. +Default: -1 +@item -boardWidth N +@cindex boardWidth, option +Allows you to set a non-standard number of board files in any variant. +If the width is given as -1, the default width for the variant is used. +With a non-standard width, the initial position will always be an empty board, +as the usual opening array will not fit. +Default: -1 +@item -holdingsSize N +@cindex holdingsSize, option +Allows you to set a non-standard size for the holdings in any variant. +If the size is given as -1, the default holdings size for the variant is used. +The first N piece types will go into the holdings on capture, and you will be +able to drop them on the board in stead of making a normal move. If size equals 0, +there will be no holdings. +Default: -1 +@item -defaultFrcPosition N +@cindex defaultFrcPosition, option +Specifies the number of the opening position in shuffle games like Chess960. +A value of -1 means the position is randomly generated by XBoard +at the beginning of every game. +Default: -1 +@item -pieceToSquareTable string +@cindex pieceToSquareTable, option +The characters that are used to represent the piece types XBoard knows in FEN +diagrams and SAN moves. The string argument has to have an even length +(or it will be ignored), as white and black pieces have to be given separately +(in that order). The last letter for each color will be the King. +The letters before that will be PNBRQ and then a whole host of fairy pieces +in an order that has not fully crystallized yet (currently FEACWMOHIJGDVSLU, +F=Ferz, Elephant, A=Archbishop, C=Chancellor, W=Wazir, M=Commoner, O=Cannon, +H=Nightrider). You should list at least all pieces that occur in the variant +you are playing. If you have less than 44 characters in the string, the pieces +not mentioned will get assigned a period, and you will not be able to distinguish +them in FENs. You can also explicitly assign pieces a period, in which case they +will not be counted in deciding which captured pieces can go into the holdings. +A tilde '~' as a piece name does mean this piece is used to represent a promoted +Pawn in crazyhouse-like games, i.e. on capture it turns back onto a Pawn. +A '+' similarly indicates the piece is a shogi-style promoted piece, that should +revert to its non-promoted version on capture (rather than to a Pawn). +Note that promoted pieces are represented by pieces 11 further in the list. +You should not have to use this option often: each variant has its own default +setting for the piece representation in FEN, which should be sufficient in normal use. +Default: "" @item -debug/-xdebug or -debugMode true/false @cindex debug, option @cindex debugMode, option @@ -1836,6 +2199,10 @@ configured and compiled. @cindex remoteUser, option User name on the remote system when running programs with the @code{remoteShell}. The default is your local user name. +@item -userName username +@cindex userName, option +Name under which the Human player will be listed in the PGN file. +Default is the login name on your local computer. @end table @node Chess Servers @@ -2126,32 +2493,35 @@ parsing routines. The game parser recognizes only algebraic notation. -The internal move legality tester does not look at the game history, -so in some cases it misses illegal castling or en passant captures. -It permits castling with the king on the d file because this is possible in -some "wild 1" games on ICS. It does not check -piece drops in bughouse and crazyhouse to see if you actually -hold the piece you are trying to drop. -However, if you attempt an illegal move when using -a chess engine or chess server, XBoard will accept the error message -that comes back, undo the move, and let you try another. - -Fischer Random castling is not understood. You can probably play -Fischer Random successfully on ICS by typing castling moves into the ICS -Interaction window, but they will not be animated correctly, and saved -games will not be loaded correctly if castling occurs. - -FEN positions saved by XBoard -never include correct information about whether castling is legal or -how many half-moves have been made since the last irreversible move, -and sometimes may not correctly indicate when en passant capture is available. - -The mate detector does not understand that non-contact mate is not -really mate in bughouse and crazyhouse. The only problem this causes -while playing is minor: a @samp{#} (mate indicator) character will show -up after a non-contact mating move in the move list; XBoard will -not assume the game is over at that point. However, if you are editing -a game, Edit Game mode will be terminated by a non-contact mate. +Many of the following points used to be limitations in XBoard 4.2.7 and earlier, +but are now fixed: +The internal move legality tester in XBoard 4.3.xx does look at the game history, +and is fully aware of castling or en-passant-capture rights. It permits castling with +the king on the d file because this is possible in some "wild 1" games on ICS. +The piece-drop menu does not check piece drops in bughouse to see if you actually hold +the piece you are trying to drop. But this way of dropping pieces should be considered +an obsolete feature, now that pieces can be dropped by dragging them from the holdings +to the board. Anyway, if you would attempt an illegal move when using a chess engine or the ICS, +WinBoard will accept the error message that comes back, undo the move, and let you try another. +FEN positions saved by XBoard do include correct information about whether castling or +en passant are legal, and also handle the 50-move counter. +The mate detector does not understand that non-contact mate is not really mate in bughouse. +The only problem this causes while playing is minor: a "#" (mate indicator) character will +show up after a non-contact mating move in the move list. XBoard will not assume the game +is over at that point, not even when the option Detect Mates is on. +Edit Game mode always uses the rules of the selected variant, +which can be a variant that uses piece drops. +You can load and edit games that contain piece drops. +The (obsolete) piece menus are not active, +but you can perform piece drops by dragging pieces from the holdings. +Edit Position mode does not allow you to edit the crazyhouse holdings properly. +You cannot drag pieces to the holding, and using the popup menu to put pieces +there does not adapt the holding counts and leads to an inconsistent state. +Set up crazyhouse positions by loading / pasting a bFEN, from there you can set the holdings. +Fischer Random castling is fully understood. +You can enter castlings by dragging the King on top of your Rook. +You can probably also play Fischer Random successfully on ICS by typing +castling moves into the ICS Interaction window. The menus may not work if your keyboard is in Caps Lock or Num Lock mode. This seems to be a problem with the Athena menu widget, @@ -2191,6 +2561,12 @@ Your detailed description of the problem . @end example +The WinBoard / XBoard 4.3 line is being developed by H.G. Muller +independently of the GNU Savannah xboard project. +Bug reports on this version, and suggestions for improvements and additions, +are best posted in the WinBoard forum, +WinBoard-development section (http://www.open-aurec.com/wbforum). + If you improve XBoard, please send a message about your changes, and we will get in touch with you about merging them in to the main line of development. @@ -2203,7 +2579,7 @@ Also see our Web site at http://savannah.gnu.org/projects/xboard/. Tim Mann has been responsible for XBoard versions 1.3 and beyond, and for WinBoard, a port of XBoard to Microsoft Win32 (Windows NT and -Windows 95). +Windows 95). H.G.Muller is responsible for version 4.3. Mark Williams contributed the initial (WinBoard-only) implementation of many new features added to both XBoard and WinBoard in version @@ -2227,6 +2603,21 @@ responsible for versions 1.0 through 1.2. Evan Welsh wrote @code{CMail}. Patrick Surry helped in designing, testing, and documenting CMail. +Allessandro Scotti added many elements to the user interface of WinBoard, +including the board textures and font-based rendering, the evaluation-graph, +move-history and engine-output window. +He was also responsible for adding the UCI support. + +H.G. Muller made WinBoard castling- and e.p.-aware, +added variant support with adjustable board sizes, +the crazyhouse holdings, and the fairy pieces. +In addition he added most of the adjudication options, +made WinBoard more robust in dealing with buggy and crashing engines, +and extended time control with a time-odds and node-count-based modes. +Most of the options that initially wre WinBoard only have now been back-ported to XBoard. + +Michel van den Bergh provided the code for reading Polyglot opening books. + @node CMail @chapter CMail @cindex cmail @@ -2445,6 +2836,30 @@ ftp://ftp.gnu.org/gnu/gnuchess/ You can use XBoard to play a game against GNU Chess, or to interface GNU Chess to an ICS. +@node Fairy-Max +@section Fairy-Max + +Fairy-Max is a derivative from the World's smallest Chess program micro-Max, +which measures only about 100 lines of source code. +The main difference with micro-Max is that Fairy-Max loads its move-generator +tables from a file, so that the rules for piece movement can be easily configured +to implement unorthodox pieces. +Fairy-Max can therefore play a lage number of variants, normal Chess being one of those. +In addition it plas Knightmate, Capablanca and Gothic Chess, Shatranj, Courier Chess, +Cylinder chess, Berolina Chess, while the user can easily define new variants. +It can be obtained from: + +http://home.hccnet.nl/h.g.muller/dwnldpage.html + +@node HoiChess +@section HoiChess + +HoiChess is a not-so-very-strong Chess engine, which comes with a derivative HoiXiangqi, +able to play Chinese Chess. It can be obtained from the standard Linux repositories +through: + +sudo apt-get install hoichess + @node Crafty @section Crafty diff --git a/xengineoutput.c b/xengineoutput.c new file mode 100644 index 0000000..72b6e26 --- /dev/null +++ b/xengineoutput.c @@ -0,0 +1,1266 @@ +/* + * Engine output (PV) + * + * Author: Alessandro Scotti (Dec 2005) + * + * ------------------------------------------------------------------------ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * ------------------------------------------------------------------------ + */ +#include "config.h" + +#include +#include +#include +#include + +#if STDC_HEADERS +# include +# include +#else /* not STDC_HEADERS */ +extern char *getenv(); +# if HAVE_STRING_H +# include +# else /* not HAVE_STRING_H */ +# include +# endif /* not HAVE_STRING_H */ +#endif /* not STDC_HEADERS */ + +#if HAVE_UNISTD_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "frontend.h" +#include "backend.h" +#include "xboard.h" +// Add xengineo.h later + +#include + +// [HGM] pixmaps of some ICONS used in the engine-outut window +#include "pixmaps/WHITE_14.xpm" +#include "pixmaps/BLACK_14.xpm" +#include "pixmaps/CLEAR_14.xpm" +#include "pixmaps/UNKNOWN_14.xpm" +#include "pixmaps/THINKING_14.xpm" +#include "pixmaps/PONDER_14.xpm" +#include "pixmaps/ANALYZING_14.xpm" + +#ifdef SNAP +#include "wsnap.h" +#endif + +#define _LL_ 100 + +// imports from xboard.c +extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; +extern Display *xDisplay; +extern Window xBoardWindow; +extern int squareSize; +extern Pixmap xMarkPixmap, wIconPixmap, bIconPixmap; +extern char *layoutName; + +// temporary kludge to avoid compile errors untill all Windows code has been replaced +#define HICON int * +#define HWND int * + +// [HGM] define numbers to indicate icons, for referring to them in platform-independent way +#define nColorBlack 1 +#define nColorWhite 2 +#define nColorUnknown 3 +#define nClear 4 +#define nPondering 5 +#define nThinking 6 +#define nAnalyzing 7 + +Pixmap icons[8]; // [HGM] this front-end array translates back-end icon indicator to handle + +// [HGM] same for output fields (note that there are two of each type, one per color) +#define nColorIcon 1 +#define nStateIcon 2 +#define nLabel 3 +#define nStateData 4 +#define nLabelNPS 5 +#define nMemo 6 + +Widget outputField[2][7]; // [HGM] front-end array to translate output field to window handle + +void EngineOutputPopDown(); +void engineOutputPopUp(char *title, char *text); +int EngineOutputIsUp(); +static void SetEngineColorIcon( int which ); + +#define SHOW_PONDERING + +/* Imports from backend.c */ +char * SavePart(char *str); + +/* Imports from winboard.c */ +//extern HWND engineOutputDialog; +extern Arg layoutArgs[2], formArgs[2], messageArgs[4]; + +//extern WindowPlacement wpEngineOutput; + +Position engineOutputX = -1, engineOutputY = -1; +Dimension engineOutputW, engineOutputH; +Widget engineOutputShell; +int engineOutputDialogUp; + +/* Module variables */ +#define H_MARGIN 2 +#define V_MARGIN 2 +#define LABEL_V_DISTANCE 1 /* Distance between label and memo */ +#define SPLITTER_SIZE 4 /* Distance between first memo and second label */ + +#define ICON_SIZE 14 + +#define STATE_UNKNOWN -1 +#define STATE_THINKING 0 +#define STATE_IDLE 1 +#define STATE_PONDERING 2 +#define STATE_ANALYZING 3 + +static int windowMode = 1; + +static int needInit = TRUE; + +static int lastDepth[2] = { -1, -1 }; +static int lastForwardMostMove[2] = { -1, -1 }; +static int engineState[2] = { -1, -1 }; + +typedef struct { + char * name; + int which; + int depth; + unsigned long nodes; + int score; + int time; + char * pv; + char * hint; + int an_move_index; + int an_move_count; +} EngineOutputData; + +static VerifyDisplayMode(); +static void UpdateControls( EngineOutputData * ed ); +static SetEngineState( int which, int state, char * state_data ); + +void ReadIcon(char *pixData[], int iconNr) +{ + int r; + + if ((r=XpmCreatePixmapFromData(xDisplay, XtWindow(outputField[0][nColorIcon]), + pixData, + &(icons[iconNr]), + NULL, NULL /*&attr*/)) != 0) { + fprintf(stderr, "Error %d loading icon image\n", r); + exit(1); + } +} + +static void InitializeEngineOutput() +{ int i; + + ReadIcon(WHITE_14, nColorWhite); + ReadIcon(BLACK_14, nColorBlack); + ReadIcon(UNKNOWN_14, nColorUnknown); + + ReadIcon(CLEAR_14, nClear); + ReadIcon(PONDER_14, nPondering); + ReadIcon(THINK_14, nThinking); + ReadIcon(ANALYZE_14, nAnalyzing); +// icons[nClear] = wIconPixmap; +// icons[nPondering] = bIconPixmap; // icons[nThinking] = wIconPixmap; +// icons[nAnalyzing] = bIconPixmap; } + +#if 0 +// Windows routines commented out + +// front end +static HICON LoadIconEx( int id ) +{ + return LoadImage( hInst, MAKEINTRESOURCE(id), IMAGE_ICON, ICON_SIZE, ICON_SIZE, 0 ); +} + +// [HGM] the platform-dependent way of indicating where output should go is now all +// concentrated here, where a table of platform-dependent handles are initialized. +// This cleanses most other routines of front-end stuff, so they can go into the back end. +static void InitializeEngineOutput() +{ + // if( needInit ) { // needInit was already tested before call + // [HGM] made this into a table, rather than separate global variables + icons[nColorBlack] = LoadIconEx( IDI_BLACK_14 ); + icons[nColorWhite] = LoadIconEx( IDI_WHITE_14 ); + icons[nColorUnknown] = LoadIconEx( IDI_UNKNOWN_14 ); + icons[nClear] = LoadIconEx( IDI_TRANS_14 ); + icons[nPondering] = LoadIconEx( IDI_PONDER_14 ); + icons[nThinking] = LoadIconEx( IDI_CLOCK_14 ); + icons[nAnalyzing] = LoadIconEx( IDI_ANALYZE2_14 ); + + // [HGM] also make a table of handles to output controls + // Note that engineOutputDialog must be defined first! + outputField[0][nColorIcon] = GetDlgItem( engineOutputDialog, IDC_Color1 ); + outputField[0][nLabel] = GetDlgItem( engineOutputDialog, IDC_EngineLabel1 ); + outputField[0][nStateIcon] = GetDlgItem( engineOutputDialog, IDC_StateIcon1 ); + outputField[0][nStateData] = GetDlgItem( engineOutputDialog, IDC_StateData1 ); + outputField[0][nLabelNPS] = GetDlgItem( engineOutputDialog, IDC_Engine1_NPS ); + outputField[0][nMemo] = GetDlgItem( engineOutputDialog, IDC_EngineMemo1 ); + + outputField[1][nColorIcon] = GetDlgItem( engineOutputDialog, IDC_Color2 ); + outputField[1][nLabel] = GetDlgItem( engineOutputDialog, IDC_EngineLabel2 ); + outputField[1][nStateIcon] = GetDlgItem( engineOutputDialog, IDC_StateIcon2 ); + outputField[1][nStateData] = GetDlgItem( engineOutputDialog, IDC_StateData2 ); + outputField[1][nLabelNPS] = GetDlgItem( engineOutputDialog, IDC_Engine2_NPS ); + outputField[1][nMemo] = GetDlgItem( engineOutputDialog, IDC_EngineMemo2 ); +// needInit = FALSE; +// } +} + +// front end +static void SetControlPos( HWND hDlg, int id, int x, int y, int width, int height ) +{ + HWND hControl = GetDlgItem( hDlg, id ); + + SetWindowPos( hControl, HWND_TOP, x, y, width, height, SWP_NOZORDER ); +} + +#define HIDDEN_X 20000 +#define HIDDEN_Y 20000 + +// front end +static void HideControl( HWND hDlg, int id ) +{ + HWND hControl = GetDlgItem( hDlg, id ); + RECT rc; + + GetWindowRect( hControl, &rc ); + + /* + Avoid hiding an already hidden control, because that causes many + unnecessary WM_ERASEBKGND messages! + */ + if( rc.left != HIDDEN_X || rc.top != HIDDEN_Y ) { + SetControlPos( hDlg, id, 20000, 20000, 100, 100 ); + } +} + +// front end, although we might make GetWindowRect front end instead +static int GetControlWidth( HWND hDlg, int id ) +{ + RECT rc; + + GetWindowRect( GetDlgItem( hDlg, id ), &rc ); + + return rc.right - rc.left; +} + +// front end? +static int GetControlHeight( HWND hDlg, int id ) +{ + RECT rc; + + GetWindowRect( GetDlgItem( hDlg, id ), &rc ); + + return rc.bottom - rc.top; +} + +static int GetHeaderHeight() +{ + int result = GetControlHeight( engineOutputDialog, IDC_EngineLabel1 ); + + if( result < ICON_SIZE ) result = ICON_SIZE; + + return result; +} + +// The size calculations should be backend? If setControlPos is a platform-dependent way of doing things, +// a platform-independent wrapper for it should be supplied. +static void PositionControlSet( HWND hDlg, int x, int y, int clientWidth, int memoHeight, int idColor, int idEngineLabel, int idNPS, int idMemo, int idStateIcon, int idStateData ) +{ + int label_x = x + ICON_SIZE + H_MARGIN; + int label_h = GetControlHeight( hDlg, IDC_EngineLabel1 ); + int label_y = y + ICON_SIZE - label_h; + int nps_w = GetControlWidth( hDlg, IDC_Engine1_NPS ); + int nps_x = clientWidth - H_MARGIN - nps_w; + int state_data_w = GetControlWidth( hDlg, IDC_StateData1 ); + int state_data_x = nps_x - H_MARGIN - state_data_w; + int state_icon_x = state_data_x - ICON_SIZE - 2; + int max_w = clientWidth - 2*H_MARGIN; + int memo_y = y + ICON_SIZE + LABEL_V_DISTANCE; + + SetControlPos( hDlg, idColor, x, y, ICON_SIZE, ICON_SIZE ); + SetControlPos( hDlg, idEngineLabel, label_x, label_y, state_icon_x - label_x, label_h ); + SetControlPos( hDlg, idStateIcon, state_icon_x, y, ICON_SIZE, ICON_SIZE ); + SetControlPos( hDlg, idStateData, state_data_x, label_y, state_data_w, label_h ); + SetControlPos( hDlg, idNPS, nps_x, label_y, nps_w, label_h ); + SetControlPos( hDlg, idMemo, x, memo_y, max_w, memoHeight ); +} + +// Also here some of the size calculations should go to the back end, and their actual application to a front-end routine +static void ResizeWindowControls( HWND hDlg, int mode ) +{ + RECT rc; + int headerHeight = GetHeaderHeight(); + int labelHeight = GetControlHeight( hDlg, IDC_EngineLabel1 ); + int labelOffset = H_MARGIN + ICON_SIZE + H_MARGIN; + int labelDeltaY = ICON_SIZE - labelHeight; + int clientWidth; + int clientHeight; + int maxControlWidth; + int npsWidth; + + /* Initialize variables */ + GetClientRect( hDlg, &rc ); + + clientWidth = rc.right - rc.left; + clientHeight = rc.bottom - rc.top; + + maxControlWidth = clientWidth - 2*H_MARGIN; + + npsWidth = GetControlWidth( hDlg, IDC_Engine1_NPS ); + + /* Resize controls */ + if( mode == 0 ) { + /* One engine */ + PositionControlSet( hDlg, H_MARGIN, V_MARGIN, + clientWidth, + clientHeight - V_MARGIN - LABEL_V_DISTANCE - headerHeight- V_MARGIN, + IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); + + /* Hide controls for the second engine */ + HideControl( hDlg, IDC_Color2 ); + HideControl( hDlg, IDC_EngineLabel2 ); + HideControl( hDlg, IDC_StateIcon2 ); + HideControl( hDlg, IDC_StateData2 ); + HideControl( hDlg, IDC_Engine2_NPS ); + HideControl( hDlg, IDC_EngineMemo2 ); + SendDlgItemMessage( hDlg, IDC_EngineMemo2, WM_SETTEXT, 0, (LPARAM) "" ); + /* TODO: we should also hide/disable them!!! what about tab stops?!?! */ + } + else { + /* Two engines */ + int memo_h = (clientHeight - headerHeight*2 - V_MARGIN*2 - LABEL_V_DISTANCE*2 - SPLITTER_SIZE) / 2; + int header1_y = V_MARGIN; + int header2_y = V_MARGIN + headerHeight + LABEL_V_DISTANCE + memo_h + SPLITTER_SIZE; + + PositionControlSet( hDlg, H_MARGIN, header1_y, clientWidth, memo_h, + IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); + + PositionControlSet( hDlg, H_MARGIN, header2_y, clientWidth, memo_h, + IDC_Color2, IDC_EngineLabel2, IDC_Engine2_NPS, IDC_EngineMemo2, IDC_StateIcon2, IDC_StateData2 ); + } + + InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo1), NULL, FALSE ); + InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo2), NULL, FALSE ); +} + +// front end. Actual printing of PV lines into the output field +static void InsertIntoMemo( int which, char * text ) +{ + SendMessage( outputField[which][nMemo], EM_SETSEL, 0, 0 ); + + SendMessage( outputField[which][nMemo], EM_REPLACESEL, (WPARAM) FALSE, (LPARAM) text ); +} + +// front end. Associates an icon with an output field ("control" in Windows jargon). +// [HGM] let it find out the output field from the 'which' number by itself +static void SetIcon( int which, int field, int nIcon ) +{ + + if( nIcon != 0 ) { + SendMessage( outputField[which][field], STM_SETICON, (WPARAM) icons[nIcon], 0 ); + } +} + +// front end wrapper for SetWindowText, taking control number in stead of handle +void DoSetWindowText(int which, int field, char *s_label) +{ + SetWindowText( outputField[which][field], s_label ); +} +#endif + +void DoSetWindowText(int which, int field, char *s_label) +{ + Arg arg; + + XtSetArg(arg, XtNlabel, (XtArgVal) s_label); + XtSetValues(outputField[which][field], &arg, 1); +} + +static void InsertIntoMemo( int which, char * text ) +{ + Arg arg; XawTextBlock t; Widget edit; + + t.ptr = text; t.firstPos = 0; t.length = strlen(text); t.format = XawFmt8Bit; + edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text"); + XawTextReplace(edit, 0, 0, &t); +// XtSetArg(arg, XtNstring, (XtArgVal) text); +// XtSetValues(outputField[which][nMemo], &arg, 1); +} + +static void SetIcon( int which, int field, int nIcon ) +{ + Arg arg; + + if( nIcon != 0 ) { + XtSetArg(arg, XtNleftBitmap, (XtArgVal) icons[nIcon]); + XtSetValues(outputField[which][field], &arg, 1); + } +} + +void DoClearMemo(int which) { Arg args[16]; + int j; + Widget edit; + + edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text"); + XtCallActionProc(edit, "select-all", NULL, NULL, 0); + XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); +} + +// The following routines are mutated clones of the commentPopUp routines + +void PositionControlSet(which, form, bw_width) + int which; + Widget form; + Dimension bw_width; { + Arg args[16]; + Widget edit, NameWidget, ColorWidget, ModeWidget, MoveWidget, NodesWidget; + int j, mutable=1; + j = 0; + XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; + XtSetArg(args[j], XtNlabel, (XtArgVal) ""); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; XtSetArg(args[j], XtNright, XtChainLeft); j++; XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) 17); j++; + outputField[which][nColorIcon] = ColorWidget = + XtCreateManagedWidget("Color", labelWidgetClass, + form, args, j); + + j = 0; + XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; + XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; + XtSetArg(args[j], XtNfromHoriz, (XtArgVal) ColorWidget); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) bw_width/2 - 57); j++; + outputField[which][nLabel] = NameWidget = + XtCreateManagedWidget("Engine", labelWidgetClass, + form, args, j); + + j = 0; + XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; + XtSetArg(args[j], XtNlabel, (XtArgVal) ""); j++; + XtSetArg(args[j], XtNfromHoriz, (XtArgVal) NameWidget); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) 20); j++; + outputField[which][nStateIcon] = ModeWidget = + XtCreateManagedWidget("Mode", labelWidgetClass, + form, args, j); + + j = 0; + XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; + XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; + XtSetArg(args[j], XtNlabel, (XtArgVal) ""); j++; + XtSetArg(args[j], XtNfromHoriz, (XtArgVal) ModeWidget); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) bw_width/2 - 102); j++; + outputField[which][nStateData] = MoveWidget = + XtCreateManagedWidget("Move", labelWidgetClass, + form, args, j); + + j = 0; + XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; + XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyRight); j++; + XtSetArg(args[j], XtNlabel, (XtArgVal) "NPS"); j++; + XtSetArg(args[j], XtNfromHoriz, (XtArgVal) MoveWidget); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; XtSetArg(args[j], XtNright, XtChainRight); j++; XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) 100); j++; + outputField[which][nLabelNPS] = NodesWidget = + XtCreateManagedWidget("Nodes", labelWidgetClass, + form, args, j); + + // create "text" within "form" + j = 0; + if (mutable) { + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + } + XtSetArg(args[j], XtNstring, ""); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, bw_width); j++; /*force wider than buttons*/ +#if 0 + XtSetArg(args[j], XtNscrollVertical, XawtextScrollWhenNeeded); j++; +#else + /* !!Work around an apparent bug in XFree86 4.0.1 (X11R6.4.3) */ + XtSetArg(args[j], XtNscrollVertical, XawtextScrollAlways); j++; + XtSetArg(args[j], XtNscrollHorizontal, XawtextScrollWhenNeeded); j++; #endif +// XtSetArg(args[j], XtNautoFill, True); j++; +// XtSetArg(args[j], XtNwrap, XawtextWrapWord); j++; + outputField[which][nMemo] = edit = + XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j); + + j = 0; + XtSetArg(args[j], XtNfromVert, ColorWidget); j++; +// XtSetArg(args[j], XtNresizable, (XtArgVal) True); j++; + XtSetValues(edit, args, j); +} + +Widget EngineOutputCreate(name, text) + char *name, *text; +{ + Arg args[16]; + Widget shell, layout, form, form2, edit; + Dimension bw_width, bw_height; + int j; + + // get board width + j = 0; + XtSetArg(args[j], XtNwidth, &bw_width); j++; XtSetArg(args[j], XtNheight, &bw_height); j++; XtGetValues(boardWidget, args, j); + + // define form within layout within shell. + j = 0; + XtSetArg(args[j], XtNresizable, True); j++; + shell = + XtCreatePopupShell(name, transientShellWidgetClass, + shellWidget, args, j); + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, shell, + layoutArgs, XtNumber(layoutArgs)); + // divide window vertically into two equal parts, by creating two forms + form = + XtCreateManagedWidget("form", formWidgetClass, layout, + formArgs, XtNumber(formArgs)); + form2 = + XtCreateManagedWidget("form2", formWidgetClass, layout, + formArgs, XtNumber(formArgs)); + j = 0; XtSetArg(args[j], XtNfromVert, (XtArgVal) form); j++; XtSetValues(form2, args, j); + // make sure width is known in advance, for better placement of child widgets + j = 0; XtSetArg(args[j], XtNwidth, (XtArgVal) bw_width-16); j++; XtSetArg(args[j], XtNheight, (XtArgVal) bw_height/2); j++; XtSetValues(shell, args, j); + + // fill up both forms with control elements + PositionControlSet(0, form, bw_width); + PositionControlSet(1, form2, bw_width); + + XtRealizeWidget(shell); + + if (engineOutputX == -1) { + int xx, yy; + Window junk; + Dimension pw_height; + Dimension ew_height; +#if 0 + j = 0; + XtSetArg(args[j], XtNheight, &ew_height); j++; + XtGetValues(edit, args, j); + + j = 0; + XtSetArg(args[j], XtNheight, &pw_height); j++; + XtGetValues(shell, args, j); + engineOutputH = pw_height + (lines - 1) * ew_height; + engineOutputW = bw_width - 16; +#else + engineOutputH = bw_height/2; engineOutputW = bw_width-16; #endif + + XSync(xDisplay, False); +#ifdef NOTDEF + /* This code seems to tickle an X bug if it is executed too soon + after xboard starts up. The coordinates get transformed as if + the main window was positioned at (0, 0). + */ + XtTranslateCoords(shellWidget, + (bw_width - engineOutputW) / 2, 0 - engineOutputH / 2, + &engineOutputX, &engineOutputY); +#else /*!NOTDEF*/ + XTranslateCoordinates(xDisplay, XtWindow(shellWidget), + RootWindowOfScreen(XtScreen(shellWidget)), + (bw_width - engineOutputW) / 2, 0 - engineOutputH / 2, + &xx, &yy, &junk); + engineOutputX = xx; + engineOutputY = yy; +#endif /*!NOTDEF*/ + if (engineOutputY < 0) engineOutputY = 0; /*avoid positioning top offscreen*/ + } + j = 0; + XtSetArg(args[j], XtNheight, engineOutputH); j++; XtSetArg(args[j], XtNwidth, engineOutputW); j++; + XtSetArg(args[j], XtNx, engineOutputX); j++; + XtSetArg(args[j], XtNy, engineOutputY); j++; + XtSetValues(shell, args, j); +// XtSetKeyboardFocus(shell, edit); + + return shell; +} + +void ResizeWindowControls(shell, mode) + Widget shell; + int mode; +{ + Widget form1, form2; + Arg args[16]; + int j; + Dimension ew_height, tmp; + + form1 = XtNameToWidget(shell, "*form"); + form2 = XtNameToWidget(shell, "*form2"); + + j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) &ew_height); j++; XtGetValues(form1, args, j); + j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) &tmp); j++; XtGetValues(form2, args, j); + ew_height += tmp; // total height + + if(mode==0) { + j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) 5); j++; + XtSetValues(form2, args, j); + j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) (ew_height-5)); j++; + XtSetValues(form1, args, j); + } else { + j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) (ew_height/2)); j++; + XtSetValues(form1, args, j); + j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) (ew_height/2)); j++; + XtSetValues(form2, args, j); + } +} + +#if 0 +void EngineOutputCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; +{ + String name; + Arg args[16]; + int j; + + j = 0; + XtSetArg(args[j], XtNlabel, &name); j++; + XtGetValues(w, args, j); + + if (strcmp(name, "close") == 0) { + EngineOutputPopDown(); + } else if (strcmp(name, "edit") == 0) { + EngineOutputPopDown(); + EditCommentEvent(); + } +} +#endif + +#if 0 +// This seems pure front end +LRESULT CALLBACK EngineOutputProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) +{ + static SnapData sd; + + switch (message) { + case WM_INITDIALOG: + if( engineOutputDialog == NULL ) { + engineOutputDialog = hDlg; + + RestoreWindowPlacement( hDlg, &wpEngineOutput ); /* Restore window placement */ + + ResizeWindowControls( hDlg, windowMode ); + + SetEngineState( 0, STATE_IDLE, "" ); + SetEngineState( 1, STATE_IDLE, "" ); + } + + return FALSE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + EndDialog(hDlg, TRUE); + return TRUE; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + return TRUE; + + default: + break; + } + + break; + + case WM_GETMINMAXINFO: + { + MINMAXINFO * mmi = (MINMAXINFO *) lParam; + + mmi->ptMinTrackSize.x = 100; + mmi->ptMinTrackSize.y = 160; + } + break; + + case WM_CLOSE: + EngineOutputPopDown(); + break; + + case WM_SIZE: + ResizeWindowControls( hDlg, windowMode ); + break; + + case WM_ENTERSIZEMOVE: + return OnEnterSizeMove( &sd, hDlg, wParam, lParam ); + + case WM_SIZING: + return OnSizing( &sd, hDlg, wParam, lParam ); + + case WM_MOVING: + return OnMoving( &sd, hDlg, wParam, lParam ); + + case WM_EXITSIZEMOVE: + return OnExitSizeMove( &sd, hDlg, wParam, lParam ); + } + + return FALSE; +} +#endif + +void EngineOutputPopUp(title, text) + char *title, *text; +{ + Arg args[16]; + int j; + Widget edit; + + if (engineOutputShell == NULL) { + engineOutputShell = + EngineOutputCreate(title, text); + XtRealizeWidget(engineOutputShell); + CatchDeleteWindow(engineOutputShell, "EngineOutputPopDown"); + if( needInit ) { + InitializeEngineOutput(); + needInit = FALSE; } + SetEngineColorIcon( 0 ); + SetEngineColorIcon( 1 ); + SetEngineState( 0, STATE_IDLE, "" ); + SetEngineState( 1, STATE_IDLE, "" ); + } else { + edit = XtNameToWidget(engineOutputShell, "*form.text"); + j = 0; + XtSetArg(args[j], XtNstring, text); j++; + XtSetValues(edit, args, j); + j = 0; + XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; + XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; + XtSetValues(engineOutputShell, args, j); + } + + XtPopup(engineOutputShell, XtGrabNone); + XSync(xDisplay, False); + + j=0; + XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Engine Output"), + args, j); + + engineOutputDialogUp = True; + ShowThinkingEvent(); // [HGM] thinking: might need to prompt engine for thinking output +} + +#if 0 +// front end +void EngineOutputPopUp() +{ + FARPROC lpProc; + + CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_CHECKED); + + if( engineOutputDialog ) { + SendMessage( engineOutputDialog, WM_INITDIALOG, 0, 0 ); + + if( ! engineOutputDialogUp ) { + ShowWindow(engineOutputDialog, SW_SHOW); + } + } + else { + lpProc = MakeProcInstance( (FARPROC) EngineOutputProc, hInst ); + + /* Note to self: dialog must have the WS_VISIBLE style set, otherwise it's not shown! */ + CreateDialog( hInst, MAKEINTRESOURCE(DLG_EngineOutput), hwndMain, (DLGPROC)lpProc ); + + FreeProcInstance(lpProc); + } + + // [HGM] displaced to after creation of dialog, to allow initialization of output fields + if( needInit ) { + InitializeEngineOutput(); + needInit = FALSE; + } + + engineOutputDialogUp = TRUE; +} +#endif + +void EngineOutputPopDown() +{ + Arg args[16]; + int j; + + if (!engineOutputDialogUp) return; + j = 0; + XtSetArg(args[j], XtNx, &engineOutputX); j++; + XtSetArg(args[j], XtNy, &engineOutputY); j++; + XtSetArg(args[j], XtNwidth, &engineOutputW); j++; + XtSetArg(args[j], XtNheight, &engineOutputH); j++; + XtGetValues(engineOutputShell, args, j); + XtPopdown(engineOutputShell); + XSync(xDisplay, False); + j=0; + XtSetArg(args[j], XtNleftBitmap, None); j++; + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Engine Output"), + args, j); + + engineOutputDialogUp = False; + ShowThinkingEvent(); // [HGM] thinking: might need to shut off thinking output +} + +#if 0 +// front end +void EngineOutputPopDown() +{ + CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_UNCHECKED); + + if( engineOutputDialog ) { + ShowWindow(engineOutputDialog, SW_HIDE); + } + + engineOutputDialogUp = FALSE; +} + +// front end. [HGM] Takes handle of output control from table, so only number is passed +void DoClearMemo(int which) +{ + SendMessage( outputField[which][nMemo], WM_SETTEXT, 0, (LPARAM) "" ); +} +#endif + +//------------------------ pure back-end routines ------------------------------- + + +// back end, due to front-end wrapper for SetWindowText, and new SetIcon arguments +static SetEngineState( int which, int state, char * state_data ) +{ + int x_which = 1 - which; + + if( engineState[ which ] != state ) { + engineState[ which ] = state; + + switch( state ) { + case STATE_THINKING: + SetIcon( which, nStateIcon, nThinking ); + if( engineState[ x_which ] == STATE_THINKING ) { + SetEngineState( x_which, STATE_IDLE, "" ); + } + break; + case STATE_PONDERING: + SetIcon( which, nStateIcon, nPondering ); + break; + case STATE_ANALYZING: + SetIcon( which, nStateIcon, nAnalyzing ); + break; + default: + SetIcon( which, nStateIcon, nClear ); + break; + } + } + + if( state_data != 0 ) { + DoSetWindowText( which, nStateData, state_data ); + } +} + +// back end, now the front-end wrapper ClearMemo is used, and ed no longer contains handles. +void EngineOutputUpdate( FrontEndProgramStats * stats ) +{ + EngineOutputData ed; + int clearMemo = FALSE; + int which; + int depth; + + if( stats == 0 ) { + SetEngineState( 0, STATE_IDLE, "" ); + SetEngineState( 1, STATE_IDLE, "" ); + return; + } + + which = stats->which; + depth = stats->depth; + + if( which < 0 || which > 1 || depth < 0 || stats->time < 0 || stats->pv == 0 ) { + return; + } + + if( engineOutputShell == NULL ) { + return; + } + + VerifyDisplayMode(); + + ed.which = which; + ed.depth = depth; + ed.nodes = stats->nodes; + ed.score = stats->score; + ed.time = stats->time; + ed.pv = stats->pv; + ed.hint = stats->hint; + ed.an_move_index = stats->an_move_index; + ed.an_move_count = stats->an_move_count; + + /* Get target control. [HGM] this is moved to front end, which get them from a table */ + if( which == 0 ) { + ed.name = first.tidy; + } + else { + ed.name = second.tidy; + } + + /* Clear memo if needed */ + if( lastDepth[which] > depth || (lastDepth[which] == depth && depth <= 1) ) { + clearMemo = TRUE; + } + + if( lastForwardMostMove[which] != forwardMostMove ) { + clearMemo = TRUE; + } + + if( clearMemo ) DoClearMemo(which); + + /* Update */ + lastDepth[which] = depth; + lastForwardMostMove[which] = forwardMostMove; + + if( ed.pv != 0 && ed.pv[0] == ' ' ) { + if( strncmp( ed.pv, " no PV", 6 ) == 0 ) { /* Hack on hack! :-O */ + ed.pv = ""; + } + } + + UpdateControls( &ed ); +} + +#define ENGINE_COLOR_WHITE 'w' +#define ENGINE_COLOR_BLACK 'b' +#define ENGINE_COLOR_UNKNOWN ' ' + +// pure back end +char GetEngineColor( int which ) +{ + char result = ENGINE_COLOR_UNKNOWN; + + if( which == 0 || which == 1 ) { + ChessProgramState * cps; + + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + result = ENGINE_COLOR_BLACK; + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + result = ENGINE_COLOR_WHITE; + break; + case AnalyzeMode: + case AnalyzeFile: + result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; + break; + case TwoMachinesPlay: + cps = (which == 0) ? &first : &second; + result = cps->twoMachinesColor[0]; + result = result == 'w' ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; + break; + } + } + + return result; +} + +// pure back end +char GetActiveEngineColor() +{ + char result = ENGINE_COLOR_UNKNOWN; + + if( gameMode == TwoMachinesPlay ) { + result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; + } + + return result; +} + +// pure back end +static int IsEnginePondering( int which ) +{ + int result = FALSE; + + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + if( WhiteOnMove(forwardMostMove) ) result = TRUE; + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + if( ! WhiteOnMove(forwardMostMove) ) result = TRUE; + break; + case TwoMachinesPlay: + if( GetActiveEngineColor() != ENGINE_COLOR_UNKNOWN ) { + if( GetEngineColor( which ) != GetActiveEngineColor() ) result = TRUE; + } + break; + } + + return result; +} + +// back end +static void SetDisplayMode( int mode ) +{ + if( windowMode != mode ) { + windowMode = mode; + + ResizeWindowControls( engineOutputShell, mode ); + } +} + +// pure back end +static VerifyDisplayMode() +{ + int mode; + + /* Get proper mode for current game */ + switch( gameMode ) { + case AnalyzeMode: + case AnalyzeFile: + case MachinePlaysWhite: + case MachinePlaysBlack: + case IcsPlayingWhite: + case IcsPlayingBlack: + mode = 0; + break; + case TwoMachinesPlay: + mode = 1; + break; + default: + /* Do not change */ + return; + } + + SetDisplayMode( mode ); +} + +// back end. Determine what icon to se in the color-icon field, and print it +static void SetEngineColorIcon( int which ) +{ + char color = GetEngineColor(which); + int nicon = 0; + + if( color == ENGINE_COLOR_BLACK ) + nicon = nColorBlack; + else if( color == ENGINE_COLOR_WHITE ) + nicon = nColorWhite; + else + nicon = nColorUnknown; + + SetIcon( which, nColorIcon, nicon ); +} + +#define MAX_NAME_LENGTH 32 + +// pure back end, now SetWindowText is called via wrapper DoSetWindowText +static void UpdateControls( EngineOutputData * ed ) +{ + int isPondering = FALSE; + + char s_label[MAX_NAME_LENGTH + 32]; + + char * name = ed->name; + + /* Label */ + if( name == 0 || *name == '\0' ) { + name = "?"; + } + + strncpy( s_label, name, MAX_NAME_LENGTH ); + s_label[ MAX_NAME_LENGTH-1 ] = '\0'; + +#ifdef SHOW_PONDERING + if( IsEnginePondering( ed->which ) ) { + char buf[8]; + + buf[0] = '\0'; + + if( ed->hint != 0 && *ed->hint != '\0' ) { + strncpy( buf, ed->hint, sizeof(buf) ); + buf[sizeof(buf)-1] = '\0'; + } + else if( ed->pv != 0 && *ed->pv != '\0' ) { + char * sep = strchr( ed->pv, ' ' ); + int buflen = sizeof(buf); + + if( sep != NULL ) { + buflen = sep - ed->pv + 1; + if( buflen > sizeof(buf) ) buflen = sizeof(buf); + } + + strncpy( buf, ed->pv, buflen ); + buf[ buflen-1 ] = '\0'; + } + + SetEngineState( ed->which, STATE_PONDERING, buf ); + } + else if( gameMode == TwoMachinesPlay ) { + SetEngineState( ed->which, STATE_THINKING, "" ); + } + else if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ) { + char buf[64]; + int time_secs = ed->time / 100; + int time_mins = time_secs / 60; + + buf[0] = '\0'; + + if( ed->an_move_index != 0 && ed->an_move_count != 0 && *ed->hint != '\0' ) { + char mov[16]; + + strncpy( mov, ed->hint, sizeof(mov) ); + mov[ sizeof(mov)-1 ] = '\0'; + + sprintf( buf, "%d/%d: %s [%02d:%02d:%02d]", ed->an_move_index, ed->an_move_count, mov, time_mins / 60, time_mins % 60, time_secs % 60 ); + } + + SetEngineState( ed->which, STATE_ANALYZING, buf ); + } + else { + SetEngineState( ed->which, STATE_IDLE, "" ); + } +#endif + + DoSetWindowText( ed->which, nLabel, s_label ); + + s_label[0] = '\0'; + + if( ed->time > 0 && ed->nodes > 0 ) { + unsigned long nps_100 = ed->nodes / ed->time; + + if( nps_100 < 100000 ) { + sprintf( s_label, "NPS: %lu", nps_100 * 100 ); + } + else { + sprintf( s_label, "NPS: %.1fk", nps_100 / 10.0 ); + } + } + + DoSetWindowText( ed->which, nLabelNPS, s_label ); + + /* Memo */ + if( ed->pv != 0 && *ed->pv != '\0' ) { + char s_nodes[24]; + char s_score[16]; + char s_time[24]; + char buf[256]; + int buflen; + int time_secs = ed->time / 100; + int time_cent = ed->time % 100; + + /* Nodes */ + if( ed->nodes < 1000000 ) { + sprintf( s_nodes, "%lu", ed->nodes ); + } + else { + sprintf( s_nodes, "%.1fM", ed->nodes / 1000000.0 ); + } + + /* Score */ + if( ed->score > 0 ) { + sprintf( s_score, "+%.2f", ed->score / 100.0 ); + } else + sprintf( s_score, "%.2f", ed->score / 100.0 ); + + /* Time */ + sprintf( s_time, "%d:%02d.%02d", time_secs / 60, time_secs % 60, time_cent ); + + /* Put all together... */ + sprintf( buf, "%3d %s %s\t%s\t", ed->depth, s_score, s_nodes, s_time ); + + /* Add PV */ + buflen = strlen(buf); + + strncpy( buf + buflen, ed->pv, sizeof(buf) - buflen ); + + buf[ sizeof(buf) - 3 ] = '\0'; + + strcat( buf + buflen, "\n" ); + + /* Update memo */ + InsertIntoMemo( ed->which, buf ); + } + + /* Colors */ + SetEngineColorIcon( ed->which ); +} + +// back end +int EngineOutputIsUp() +{ + return engineOutputDialogUp; +} + +void +EngineOutputProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ + if (engineOutputDialogUp) { + EngineOutputPopDown(); + } else { + EngineOutputPopUp("engine output","This feature is experimental"); + } +// ToNrEvent(currentMove); +} + diff --git a/xhistory.c b/xhistory.c index 7f02ab8..5640fee 100644 --- a/xhistory.c +++ b/xhistory.c @@ -90,7 +90,7 @@ struct History{ struct History *hist=0; String dots=" ... "; - +Position gameHistoryX, gameHistoryY; void HistoryPopDown(w, client_data, call_data) Widget w; @@ -98,20 +98,26 @@ HistoryPopDown(w, client_data, call_data) { Arg args[16]; int j; - if(hist) - - XtPopdown(hist->sh); - hist->Up=False; + if(hist) { + // [HGM] remember old position + j = 0; + XtSetArg(args[j], XtNx, &gameHistoryX); j++; + XtSetArg(args[j], XtNy, &gameHistoryY); j++; + XtGetValues(hist->sh, args, j); + XtPopdown(hist->sh); + hist->Up=False; + } j=0; XtSetArg(args[j], XtNleftBitmap, None); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"), + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move History"), args, j); } void HistoryMoveProc(Widget w, XtPointer closure, XtPointer call_data) { int to; + XawListReturnStruct *R = (XawListReturnStruct *) call_data; if (w == hist->mvn || w == hist->mvw) { to=2*R->list_index-1; @@ -445,6 +451,12 @@ Widget HistoryCreate() strcpy(hist->black[i],""); } + // [HGM] remember old position + j = 0; + XtSetArg(args[j], XtNx, &gameHistoryX); j++; + XtSetArg(args[j], XtNy, &gameHistoryY); j++; + XtGetValues(hist->sh, args, j); + return hist->sh; } @@ -456,9 +468,16 @@ HistoryPopUp() if(!hist) HistoryCreate(); XtPopup(hist->sh, XtGrabNone); + + // [HGM] restore old position + j = 0; + XtSetArg(args[j], XtNx, gameHistoryX); j++; + XtSetArg(args[j], XtNy, gameHistoryY); j++; + XtSetValues(hist->sh, args, j); + j=0; XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"), + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move History"), args, j); hist->Up=True; } diff --git a/xoptions.c b/xoptions.c new file mode 100644 index 0000000..1165a09 --- /dev/null +++ b/xoptions.c @@ -0,0 +1,1401 @@ +/* + * xoptions.c -- Move list window, part of X front end for XBoard + * + * Copyright 2000 Free Software Foundation, Inc. + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + * + * See the file ChangeLog for a revision history. + */ + +// [HGM] this file is the counterpart of woptions.c, containing xboard popup menus +// similar to those of WinBoard, to set the most common options interactively. + +#include "config.h" + +#include +#include +#include +#include + +#if STDC_HEADERS +# include +# include +#else /* not STDC_HEADERS */ +extern char *getenv(); +# if HAVE_STRING_H +# include +# else /* not HAVE_STRING_H */ +# include +# endif /* not HAVE_STRING_H */ +#endif /* not STDC_HEADERS */ + +#if HAVE_UNISTD_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "backend.h" +#include "xboard.h" + +extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; +extern Display *xDisplay; +extern int squareSize; +extern Pixmap xMarkPixmap; +extern char *layoutName; +extern Window xBoardWindow; +extern Arg layoutArgs[2], formArgs[2]; +Pixel timerForegroundPixel, timerBackgroundPixel; + +// [HGM] the following code for makng menu popups was cloned from the FileNamePopUp routines + +static Widget previous = NULL; + +void SetFocus(Widget w, XtPointer data, XEvent *event, Boolean *b) +{ + Arg args; + + if(previous) { + XtSetArg(args, XtNdisplayCaret, False); + XtSetValues(previous, &args, 1); + } + XtSetArg(args, XtNdisplayCaret, True); + XtSetValues(w, &args, 1); + XtSetKeyboardFocus((Widget) data, w); + previous = w; +} + +//--------------------------- New Shuffle Game -------------------------------------------- +extern int shuffleOpenings; +extern int startedFromPositionFile; +int shuffleUp; +Widget shuffleShell; + +void ShufflePopDown() +{ + if (!shuffleUp) return; + XtPopdown(shuffleShell); + XtDestroyWidget(shuffleShell); + shuffleUp = False; + ModeHighlight(); +} + +void ShuffleCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; +{ + String name; + Widget w2; + Arg args[16]; + char buf[80]; + + XtSetArg(args[0], XtNlabel, &name); + XtGetValues(w, args, 1); + + if (strcmp(name, "cancel") == 0) { + ShufflePopDown(); + return; + } + if (strcmp(name, "off") == 0) { + ShufflePopDown(); + shuffleOpenings = False; // [HGM] should be moved to New Variant menu, once we have it! + ResetGameEvent(); + AnalysisPopDown(); + return; + } + if (strcmp(name, "random") == 0) { + sprintf(buf, "%d", rand()); + XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value + XtSetValues(XtParent(w), args, 1); + return; + } + if (strcmp(name, "ok") == 0) { + int nr; String name; + name = XawDialogGetValueString(w2 = XtParent(w)); + if(sscanf(name ,"%d",&nr) != 1) { + sprintf(buf, "%d", appData.defaultFrcPosition); + XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value + XtSetValues(w2, args, 1); + return; + } + appData.defaultFrcPosition = nr; + shuffleOpenings = True; + ShufflePopDown(); + ResetGameEvent(); + AnalysisPopDown(); + return; + } +} + +void ShufflePopUp() +{ + Arg args[16]; + Widget popup, layout, dialog, edit; + Window root, child; + int x, y, i; + int win_x, win_y; + unsigned int mask; + char def[80]; + + i = 0; + XtSetArg(args[i], XtNresizable, True); i++; + XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; + shuffleShell = popup = + XtCreatePopupShell("New Shuffle Game", transientShellWidgetClass, + shellWidget, args, i); + + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, popup, + layoutArgs, XtNumber(layoutArgs)); + + sprintf(def, "%d\n", appData.defaultFrcPosition); + i = 0; + XtSetArg(args[i], XtNlabel, "Start-position number:"); i++; + XtSetArg(args[i], XtNvalue, def); i++; + XtSetArg(args[i], XtNborderWidth, 0); i++; + dialog = XtCreateManagedWidget("Shuffle", dialogWidgetClass, + layout, args, i); + +// XtSetArg(args[0], XtNeditType, XawtextEdit); // [HGM] can't get edit to work decently +// XtSetArg(args[1], XtNuseStringInPlace, False); +// XtSetValues(dialog, args, 2); + + XawDialogAddButton(dialog, "ok", ShuffleCallback, (XtPointer) dialog); + XawDialogAddButton(dialog, "cancel", ShuffleCallback, (XtPointer) dialog); + XawDialogAddButton(dialog, "random", ShuffleCallback, (XtPointer) dialog); + XawDialogAddButton(dialog, "off", ShuffleCallback, (XtPointer) dialog); + + XtRealizeWidget(popup); + CatchDeleteWindow(popup, "ShufflePopDown"); + + XQueryPointer(xDisplay, xBoardWindow, &root, &child, + &x, &y, &win_x, &win_y, &mask); + + XtSetArg(args[0], XtNx, x - 10); + XtSetArg(args[1], XtNy, y - 30); + XtSetValues(popup, args, 2); + + XtPopup(popup, XtGrabExclusive); + shuffleUp = True; + + edit = XtNameToWidget(dialog, "*value"); + + XtSetKeyboardFocus(popup, edit); +} + +void ShuffleMenuProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ +// if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { +// Reset(FALSE, TRUE); +// } + ShufflePopUp(); +} + +//--------------------------- Time-Control Menu Popup ---------------------------------- +int TimeControlUp; +Widget TimeControlShell; +int tcInc; +Widget tcMess1, tcMess2, tcData, tcTime, tcOdds1, tcOdds2; +int tcIncrement, tcMoves; + +void TimeControlPopDown() +{ + if (!TimeControlUp) return; + XtPopdown(TimeControlShell); + XtDestroyWidget(TimeControlShell); + TimeControlUp = False; + ModeHighlight(); +} + +void TimeControlCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; +{ + String name, txt; + Widget w2; + Arg args[16]; + char buf[80]; + int j; + + XtSetArg(args[0], XtNlabel, &name); + XtGetValues(w, args, 1); + + if (strcmp(name, "classical") == 0) { + if(!tcInc) return; + j=0; + XtSetArg(args[j], XtNlabel, "minutes for each"); j++; + XtSetValues(tcMess1, args, j); + j=0; + XtSetArg(args[j], XtNlabel, "moves"); j++; + XtSetValues(tcMess2, args, j); + j=0; + XtSetArg(args[j], XtNstring, &name); j++; + XtGetValues(tcData, args, j); + tcIncrement = 0; sscanf(name, "%d", &tcIncrement); + sprintf(buf, "%d", tcMoves); + j=0; + XtSetArg(args[j], XtNstring, buf); j++; + XtSetValues(tcData, args, j); + tcInc = False; + return; + } + if (strcmp(name, "incremental") == 0) { + if(tcInc) return; + j=0; + XtSetArg(args[j], XtNlabel, "minutes, plus"); j++; + XtSetValues(tcMess1, args, j); + j=0; + XtSetArg(args[j], XtNlabel, "sec/move"); j++; + XtSetValues(tcMess2, args, j); + j=0; + XtSetArg(args[j], XtNstring, &name); j++; + XtGetValues(tcData, args, j); + tcMoves = appData.movesPerSession; sscanf(name, "%d", &tcMoves); + sprintf(buf, "%d", tcIncrement); + j=0; + XtSetArg(args[j], XtNstring, buf); j++; + XtSetValues(tcData, args, j); + tcInc = True; + return; + } + if (strcmp(name, " OK ") == 0) { + int inc, mps, tc, ok; + XtSetArg(args[0], XtNstring, &txt); + XtGetValues(tcData, args, 1); + if(tcInc) { + ok = sscanf(txt, "%d", &inc); mps = 0; + if(!ok && txt[0] == 0) { inc = 0; ok = 1; } // accept empty string as zero + ok &= (inc >= 0); + } else { + ok = sscanf(txt, "%d", &mps); inc = -1; + ok &= (mps > 0); + } + if(ok != 1) { + XtSetArg(args[0], XtNstring, ""); // erase any offending input + XtSetValues(tcData, args, 1); + return; + } + XtSetArg(args[0], XtNstring, &txt); + XtGetValues(tcTime, args, 1); + if(!ParseTimeControl(txt, inc, mps)) { + XtSetArg(args[0], XtNstring, ""); // erase any offending input + XtSetValues(tcTime, args, 1); + DisplayError("Bad Time-Control String", 0); + return; + } + appData.movesPerSession = mps; + appData.timeIncrement = inc; + appData.timeControl = strdup(txt); + XtSetArg(args[0], XtNstring, &txt); + XtGetValues(tcOdds1, args, 1); + appData.firstTimeOdds = first.timeOdds + = (sscanf(txt, "%d", &j) == 1 && j > 0) ? j : 1; + XtGetValues(tcOdds2, args, 1); + appData.secondTimeOdds = second.timeOdds + = (sscanf(txt, "%d", &j) == 1 && j > 0) ? j : 1; + + Reset(True, True); + TimeControlPopDown(); + return; + } +} + +void TimeControlPopUp() +{ + Arg args[16]; + Widget popup, layout, form, edit, b_ok, b_cancel, b_clas, b_inc, mess; + Window root, child; + int x, y, i, j; + int win_x, win_y; + unsigned int mask; + char def[80]; + + tcInc = (appData.timeIncrement >= 0); + tcMoves = appData.movesPerSession; tcIncrement = appData.timeIncrement; + if(!tcInc) tcIncrement = 0; + sprintf(def, "%d", tcInc ? tcIncrement : tcMoves); + + i = 0; + XtSetArg(args[i], XtNresizable, True); i++; +// XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; + TimeControlShell = popup = + XtCreatePopupShell("TimeControl Menu", transientShellWidgetClass, + shellWidget, args, i); + + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, popup, + layoutArgs, XtNumber(layoutArgs)); + + form = + XtCreateManagedWidget(layoutName, formWidgetClass, layout, + formArgs, XtNumber(formArgs)); + + j = 0; +// XtSetArg(args[j], XtNwidth, (XtArgVal) 300); j++; +// XtSetArg(args[j], XtNheight, (XtArgVal) 85); j++; + XtSetValues(popup, args, j); + + j= 0; + XtSetArg(args[j], XtNborderWidth, 1); j++; + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + XtSetArg(args[j], XtNstring, appData.timeControl); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, 85); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + tcTime = XtCreateManagedWidget("TC", asciiTextWidgetClass, form, args, j); + XtAddEventHandler(tcTime, ButtonPressMask, False, SetFocus, (XtPointer) popup); + + j= 0; + XtSetArg(args[j], XtNlabel, tcInc ? " minutes, plus " : "minutes for each"); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + XtSetArg(args[j], XtNfromHoriz, tcTime); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + // XtSetArg(args[j], XtNwidth, 100); j++; + // XtSetArg(args[j], XtNheight, 20); j++; + tcMess1 = XtCreateManagedWidget("TCtext", labelWidgetClass, form, args, j); + + j= 0; + XtSetArg(args[j], XtNborderWidth, 1); j++; + XtSetArg(args[j], XtNfromHoriz, tcMess1); j++; + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + XtSetArg(args[j], XtNstring, def); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, 40); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + tcData = XtCreateManagedWidget("MPS", asciiTextWidgetClass, form, args, j); + XtAddEventHandler(tcData, ButtonPressMask, False, SetFocus, (XtPointer) popup); + + j= 0; + XtSetArg(args[j], XtNlabel, tcInc ? "sec/move" : "moves "); j++; + XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + XtSetArg(args[j], XtNfromHoriz, tcData); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; +// XtSetArg(args[j], XtNwidth, 80); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + tcMess2 = XtCreateManagedWidget("MPStext", labelWidgetClass, + form, args, j); + + j= 0; + XtSetArg(args[j], XtNborderWidth, 1); j++; + XtSetArg(args[j], XtNfromVert, tcTime); j++; + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + XtSetArg(args[j], XtNstring, "1"); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, 40); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + tcOdds1 = XtCreateManagedWidget("Odds1", asciiTextWidgetClass, form, args, j); + XtAddEventHandler(tcOdds1, ButtonPressMask, False, SetFocus, (XtPointer) popup); + + j= 0; + XtSetArg(args[j], XtNborderWidth, 1); j++; + XtSetArg(args[j], XtNfromVert, tcTime); j++; + XtSetArg(args[j], XtNfromHoriz, tcOdds1); j++; + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + XtSetArg(args[j], XtNstring, "1"); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, 40); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + tcOdds2 = XtCreateManagedWidget("Odds2", asciiTextWidgetClass, form, args, j); + XtAddEventHandler(tcOdds2, ButtonPressMask, False, SetFocus, (XtPointer) popup); + + j= 0; + XtSetArg(args[j], XtNlabel, "Engine #1 and #2 Time-Odds Factors"); j++; + XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + XtSetArg(args[j], XtNfromVert, tcTime); j++; + XtSetArg(args[j], XtNfromHoriz, tcOdds2); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; +// XtSetArg(args[j], XtNwidth, 200); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + mess = XtCreateManagedWidget("Oddstext", labelWidgetClass, + form, args, j); + j=0; + XtSetArg(args[j], XtNfromVert, tcOdds1); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + b_clas= XtCreateManagedWidget("classical", commandWidgetClass, + form, args, j); + XtAddCallback(b_clas, XtNcallback, TimeControlCallback, (XtPointer) 0); + + j=0; + XtSetArg(args[j], XtNfromVert, tcOdds1); j++; + XtSetArg(args[j], XtNfromHoriz, b_clas); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + b_inc = XtCreateManagedWidget("incremental", commandWidgetClass, + form, args, j); + XtAddCallback(b_inc, XtNcallback, TimeControlCallback, (XtPointer) 0); + + j=0; + XtSetArg(args[j], XtNfromVert, tcOdds1); j++; + XtSetArg(args[j], XtNfromHoriz, tcData); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + b_ok= XtCreateManagedWidget(" OK ", commandWidgetClass, + form, args, j); + XtAddCallback(b_ok, XtNcallback, TimeControlCallback, (XtPointer) 0); + + j=0; + XtSetArg(args[j], XtNfromVert, tcOdds1); j++; + XtSetArg(args[j], XtNfromHoriz, b_ok); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + b_cancel= XtCreateManagedWidget("cancel", commandWidgetClass, + form, args, j); + XtAddCallback(b_cancel, XtNcallback, TimeControlPopDown, (XtPointer) 0); + + XtRealizeWidget(popup); + CatchDeleteWindow(popup, "TimeControlPopDown"); + + XQueryPointer(xDisplay, xBoardWindow, &root, &child, + &x, &y, &win_x, &win_y, &mask); + + XtSetArg(args[0], XtNx, x - 10); + XtSetArg(args[1], XtNy, y - 30); + XtSetValues(popup, args, 2); + + XtPopup(popup, XtGrabExclusive); + TimeControlUp = True; + + previous = NULL; + SetFocus(tcTime, popup, (XEvent*) NULL, False); +// XtSetKeyboardFocus(popup, tcTime); +} + +void TimeControlProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ + TimeControlPopUp(); +} + +//--------------------------- Engine-Options Menu Popup ---------------------------------- +int EngineUp; +Widget EngineShell; +extern int adjudicateLossThreshold; + +Widget engDrawMoves, engThreshold, engRule, engRepeat; + +void EnginePopDown() +{ + if (!EngineUp) return; + XtPopdown(EngineShell); + XtDestroyWidget(EngineShell); + EngineUp = False; + ModeHighlight(); +} + +int ReadToggle(Widget w) +{ + Arg args; Boolean res; + + XtSetArg(args, XtNstate, &res); + XtGetValues(w, &args, 1); + + return res; +} + +Widget w1, w2, w3, w4, w5, w6, w7, w8; + +void EngineCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; +{ + String name; + Widget s2; + Arg args[16]; + char buf[80]; + int j; + + XtSetArg(args[0], XtNlabel, &name); + XtGetValues(w, args, 1); + + if (strcmp(name, "OK") == 0) { + // read all switches + appData.periodicUpdates = ReadToggle(w1); +// appData.hideThinkingFromHuman = ReadToggle(w2); + appData.firstScoreIsAbsolute = ReadToggle(w3); + appData.secondScoreIsAbsolute = ReadToggle(w4); + appData.testClaims = ReadToggle(w5); + appData.checkMates = ReadToggle(w6); + appData.materialDraws = ReadToggle(w7); + appData.trivialDraws = ReadToggle(w8); + + // adjust setting in other menu for duplicates + // (perhaps duplicates should be removed from general Option Menu?) +// XtSetArg(args[0], XtNleftBitmap, appData.showThinking ? xMarkPixmap : None); +// XtSetValues(XtNameToWidget(menuBarWidget, +// "menuOptions.Show Thinking"), args, 1); + + // read out numeric controls, simply ignore bad formats for now + XtSetArg(args[0], XtNstring, &name); + XtGetValues(engDrawMoves, args, 1); + if(sscanf(name, "%d", &j) == 1) appData.adjudicateDrawMoves = j; + XtGetValues(engThreshold, args, 1); + if(sscanf(name, "%d", &j) == 1) + adjudicateLossThreshold = appData.adjudicateLossThreshold = -j; // inverted! + XtGetValues(engRule, args, 1); + if(sscanf(name, "%d", &j) == 1) appData.ruleMoves = j; + XtGetValues(engRepeat, args, 1); + if(sscanf(name, "%d", &j) == 1) appData.drawRepeats = j; + + EnginePopDown(); + ShowThinkingEvent(); // [HGM] thinking: score adjudication might need thinking output + return; + } +} + +void EnginePopUp() +{ + Arg args[16]; + Widget popup, layout, form, edit, b_ok, b_cancel, b_clas, b_inc, s1; + Window root, child; + int x, y, i, j, width; + int win_x, win_y; + unsigned int mask; + char def[80]; + + tcInc = (appData.timeIncrement >= 0); + tcMoves = appData.movesPerSession; tcIncrement = appData.timeIncrement; + if(!tcInc) tcIncrement = 0; + sprintf(def, "%d", tcInc ? tcIncrement : tcMoves); + + i = 0; + XtSetArg(args[i], XtNresizable, True); i++; +// XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; + EngineShell = popup = + XtCreatePopupShell("Adjudications", transientShellWidgetClass, + shellWidget, args, i); + + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, popup, + layoutArgs, XtNumber(layoutArgs)); + + form = + XtCreateManagedWidget(layoutName, formWidgetClass, layout, + formArgs, XtNumber(formArgs)); + + j = 0; +// XtSetArg(args[j], XtNwidth, (XtArgVal) 250); j++; +// XtSetArg(args[j], XtNheight, (XtArgVal) 400); j++; +// XtSetValues(popup, args, j); + + j = 0; +// XtSetArg(args[j], XtNwidth, (XtArgVal) 250); j++; +// XtSetArg(args[j], XtNheight, (XtArgVal) 20); j++; + XtSetArg(args[j], XtNleft, (XtArgVal) XtChainLeft); j++; + XtSetArg(args[j], XtNright, (XtArgVal) XtChainRight); j++; + XtSetArg(args[j], XtNstate, appData.periodicUpdates); j++; +// XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; + w1 = XtCreateManagedWidget("Periodic Updates (Analysis Mode)", toggleWidgetClass, form, args, j); + + XtSetArg(args[j], XtNwidth, (XtArgVal) &width); + XtGetValues(w1, &args[j], 1); + +// XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w1); +// XtSetArg(args[j-3], XtNstate, appData.hideThinkingFromHuman); +// w2 = XtCreateManagedWidget("Hide Thinking from Human", toggleWidgetClass, form, args, j); + + XtSetArg(args[j], XtNwidth, (XtArgVal) width); j++; + XtSetArg(args[j-2], XtNstate, appData.firstScoreIsAbsolute); + XtSetArg(args[j], XtNfromVert, (XtArgVal) w1); j++; + w3 = XtCreateManagedWidget("Engine #1 Score is Absolute", toggleWidgetClass, form, args, j); + + XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w3); + XtSetArg(args[j-3], XtNstate, appData.secondScoreIsAbsolute); + w4 = XtCreateManagedWidget("Engine #2 Score is Absolute", toggleWidgetClass, form, args, j); + + s1 = XtCreateManagedWidget("\nEngine-Engine Adjudications:", labelWidgetClass, form, args, 3); + + XtSetArg(args[j-1], XtNfromVert, (XtArgVal) s1); + XtSetArg(args[j-3], XtNstate, appData.testClaims); + w5 = XtCreateManagedWidget("Verify Engine Result Claims", toggleWidgetClass, form, args, j); + + XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w5); + XtSetArg(args[j-3], XtNstate, appData.checkMates); + w6 = XtCreateManagedWidget("Detect All Mates", toggleWidgetClass, form, args, j); + + XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w6); + XtSetArg(args[j-3], XtNstate, appData.materialDraws); + w7 = XtCreateManagedWidget("Draw when Insuff. Mating Material", toggleWidgetClass, form, args, j); + + XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w7); + XtSetArg(args[j-3], XtNstate, appData.trivialDraws); + w8 = XtCreateManagedWidget("Adjudicate Trivial Draws", toggleWidgetClass, form, args, j); + + XtSetArg(args[0], XtNfromVert, (XtArgVal) w4); + XtSetArg(args[1], XtNborderWidth, (XtArgVal) 0); + XtSetValues(s1, args, 2); + + sprintf(def, "%d", appData.adjudicateDrawMoves); + j= 0; + XtSetArg(args[j], XtNborderWidth, 1); j++; + XtSetArg(args[j], XtNfromVert, w8); j++; + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + XtSetArg(args[j], XtNstring, def); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, 60); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + engDrawMoves = XtCreateManagedWidget("Length", asciiTextWidgetClass, form, args, j); + XtAddEventHandler(engDrawMoves, ButtonPressMask, False, SetFocus, (XtPointer) popup); + + j= 0; + XtSetArg(args[j], XtNlabel, " moves maximum, then draw"); j++; + XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + XtSetArg(args[j], XtNfromVert, w8); j++; + XtSetArg(args[j], XtNfromHoriz, engDrawMoves); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; +// XtSetArg(args[j], XtNwidth, 170); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + tcMess1 = XtCreateManagedWidget("TCtext", labelWidgetClass, form, args, j); + + sprintf(def, "%d", -appData.adjudicateLossThreshold); // inverted! + j= 0; + XtSetArg(args[j], XtNborderWidth, 1); j++; + XtSetArg(args[j], XtNfromVert, engDrawMoves); j++; + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + XtSetArg(args[j], XtNstring, def); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, 60); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + engThreshold = XtCreateManagedWidget("Threshold", asciiTextWidgetClass, form, args, j); + XtAddEventHandler(engThreshold, ButtonPressMask, False, SetFocus, (XtPointer) popup); + + j= 0; + XtSetArg(args[j], XtNlabel, "-centiPawn lead is win"); j++; + XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + XtSetArg(args[j], XtNfromVert, engDrawMoves); j++; + XtSetArg(args[j], XtNfromHoriz, engThreshold); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; +// XtSetArg(args[j], XtNwidth, 150); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + tcMess2 = XtCreateManagedWidget("MPStext", labelWidgetClass, form, args, j); + + sprintf(def, "%d", appData.ruleMoves); + j= 0; + XtSetArg(args[j], XtNborderWidth, 1); j++; + XtSetArg(args[j], XtNfromVert, engThreshold); j++; + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + XtSetArg(args[j], XtNstring, def); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, 30); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + engRule = XtCreateManagedWidget("Rule", asciiTextWidgetClass, form, args, j); + XtAddEventHandler(engRule, ButtonPressMask, False, SetFocus, (XtPointer) popup); + + j= 0; + XtSetArg(args[j], XtNlabel, "-move rule applied"); j++; + XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + XtSetArg(args[j], XtNfromVert, engThreshold); j++; + XtSetArg(args[j], XtNfromHoriz, engRule); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; +// XtSetArg(args[j], XtNwidth, 130); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + tcMess1 = XtCreateManagedWidget("TCtext", labelWidgetClass, form, args, j); + + sprintf(def, "%d", appData.drawRepeats); + j= 0; + XtSetArg(args[j], XtNborderWidth, 1); j++; + XtSetArg(args[j], XtNfromVert, engRule); j++; + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + XtSetArg(args[j], XtNstring, def); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, 30); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + engRepeat = XtCreateManagedWidget("Repeats", asciiTextWidgetClass, form, args, j); + XtAddEventHandler(engRepeat, ButtonPressMask, False, SetFocus, (XtPointer) popup); + + j= 0; + XtSetArg(args[j], XtNlabel, "-fold repeat is draw"); j++; + XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + XtSetArg(args[j], XtNfromVert, engRule); j++; + XtSetArg(args[j], XtNfromHoriz, engRepeat); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; +// XtSetArg(args[j], XtNwidth, 130); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + tcMess2 = XtCreateManagedWidget("MPStext", labelWidgetClass, form, args, j); + + j=0; + XtSetArg(args[j], XtNfromVert, engRepeat); j++; + XtSetArg(args[j], XtNfromHoriz, tcMess2); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + b_ok= XtCreateManagedWidget("OK", commandWidgetClass, form, args, j); + XtAddCallback(b_ok, XtNcallback, EngineCallback, (XtPointer) 0); + + j=0; + XtSetArg(args[j], XtNfromVert, engRepeat); j++; + XtSetArg(args[j], XtNfromHoriz, b_ok); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + b_cancel= XtCreateManagedWidget("cancel", commandWidgetClass, + form, args, j); + XtAddCallback(b_cancel, XtNcallback, EnginePopDown, (XtPointer) 0); + + XtRealizeWidget(popup); + CatchDeleteWindow(popup, "EnginePopDown"); + + XQueryPointer(xDisplay, xBoardWindow, &root, &child, + &x, &y, &win_x, &win_y, &mask); + + XtSetArg(args[0], XtNx, x - 10); + XtSetArg(args[1], XtNy, y - 30); + XtSetValues(popup, args, 2); + + XtPopup(popup, XtGrabExclusive); + EngineUp = True; + + previous = NULL; + SetFocus(engThreshold, popup, (XEvent*) NULL, False); +} + +void EngineMenuProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ + EnginePopUp(); +} + +//--------------------------- New-Variant Menu PopUp ----------------------------------- +struct NewVarButton { + char *name; + char *color; + Widget handle; + VariantClass variant; +}; + +struct NewVarButton buttonDesc[] = { + {"normal", "#FFFFFF", 0, VariantNormal}, + {"FRC", "#FFFFFF", 0, VariantFischeRandom}, + {"wild castle", "#FFFFFF", 0, VariantWildCastle}, + {"no castle", "#FFFFFF", 0, VariantNoCastle}, + {"knightmate", "#FFFFFF", 0, VariantKnightmate}, + {"berolina", "#FFFFFF", 0, VariantBerolina}, + {"cylinder", "#FFFFFF", 0, VariantCylinder}, + {"shatranj", "#FFFFFF", 0, VariantShatranj}, + {"atomic", "#FFFFFF", 0, VariantAtomic}, + {"two kings", "#FFFFFF", 0, VariantTwoKings}, + {"3-checks", "#FFFFFF", 0, Variant3Check}, + {"suicide", "#FFFFBF", 0, VariantSuicide}, + {"give-away", "#FFFFBF", 0, VariantGiveaway}, + {"losers", "#FFFFBF", 0, VariantLosers}, + {"fairy", "#BFBFBF", 0, VariantFairy}, + {"Superchess", "#FFBFBF", 0, VariantSuper}, + {"crazyhouse", "#FFBFBF", 0, VariantCrazyhouse}, + {"bughouse", "#FFBFBF", 0, VariantBughouse}, + {"shogi (9x9)", "#BFFFFF", 0, VariantShogi}, + {"xiangqi (9x10)", "#BFFFFF", 0, VariantXiangqi}, + {"courier (12x8)", "#BFFFBF", 0, VariantCourier}, + {"janus (10x8)", "#BFBFFF", 0, VariantJanus}, + {"Capablanca (10x8)", "#BFBFFF", 0, VariantCapablanca}, + {"CRC (10x8)", "#BFBFFF", 0, VariantCapaRandom}, +#ifdef GOTHIC + {"Gothic (10x8)", "#BFBFFF", 0, VariantGothic}, +#endif +#ifdef FALCON + {"Falcon (10x8)", "#BFBFFF", 0, VariantFalcon}, +#endif + {NULL, 0, 0, (VariantClass) 0} +}; + +int NewVariantUp; +Widget NewVariantShell; + +void NewVariantPopDown() +{ + if (!NewVariantUp) return; + XtPopdown(NewVariantShell); + XtDestroyWidget(NewVariantShell); + NewVariantUp = False; + ModeHighlight(); +} + +void NewVariantCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; +{ + String name; + Widget w2; + Arg args[16]; + char buf[80]; + VariantClass v; + + XtSetArg(args[0], XtNlabel, &name); + XtGetValues(w, args, 1); + + if (strcmp(name, " OK ") == 0) { + int nr = (int) XawToggleGetCurrent(buttonDesc[0].handle) - 1; + if(nr < 0) return; + v = buttonDesc[nr].variant; + if(!appData.noChessProgram) { + char *name = VariantName(v), buf[MSG_SIZ]; + if (first.protocolVersion > 1 && StrStr(first.variants, name) == NULL) { + /* [HGM] in protocol 2 we check if variant is suported by engine */ + sprintf(buf, "Variant %s not supported by %s", name, first.tidy); + DisplayError(buf, 0); +// NewVariantPopDown(); + return; /* ignore OK if first engine does not support it */ + } else + if (second.initDone && second.protocolVersion > 1 && StrStr(second.variants, name) == NULL) { + sprintf(buf, "Warning: second engine (%s) does not support this!", second.tidy); + DisplayError(buf, 0); /* use of second engine is optional; only warn user */ + } + } + + gameInfo.variant = v; + appData.variant = VariantName(v); + + shuffleOpenings = FALSE; /* [HGM] shuffle: possible shuffle reset when we switch */ + startedFromPositionFile = FALSE; /* [HGM] loadPos: no longer valid in new variant */ + appData.pieceToCharTable = NULL; + Reset(True, True); + NewVariantPopDown(); + return; + } +} + +void NewVariantPopUp() +{ + Arg args[16]; + Widget popup, layout, dialog, edit, form, last = NULL, b_ok, b_cancel; + Window root, child; + int x, y, i, j; + int win_x, win_y; + unsigned int mask; + char def[80]; + XrmValue vFrom, vTo; + + i = 0; + XtSetArg(args[i], XtNresizable, True); i++; +// XtSetArg(args[i], XtNwidth, 250); i++; +// XtSetArg(args[i], XtNheight, 300); i++; + NewVariantShell = popup = + XtCreatePopupShell("NewVariant Menu", transientShellWidgetClass, + shellWidget, args, i); + + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, popup, + layoutArgs, XtNumber(layoutArgs)); + + form = + XtCreateManagedWidget("form", formWidgetClass, layout, + formArgs, XtNumber(formArgs)); + + for(i = 0; buttonDesc[i].name != NULL; i++) { + Pixel buttonColor; + if (!appData.monoMode) { + vFrom.addr = (caddr_t) buttonDesc[i].color; + vFrom.size = strlen(buttonDesc[i].color); + XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); + if (vTo.addr == NULL) { + buttonColor = (Pixel) -1; + } else { + buttonColor = *(Pixel *) vTo.addr; + } + } + + j = 0; + XtSetArg(args[j], XtNradioGroup, last); j++; + XtSetArg(args[j], XtNwidth, 125); j++; +// XtSetArg(args[j], XtNheight, 16); j++; + XtSetArg(args[j], XtNfromVert, i == 15 ? NULL : last); j++; + XtSetArg(args[j], XtNfromHoriz, i < 15 ? NULL : buttonDesc[i-15].handle); j++; + XtSetArg(args[j], XtNradioData, i+1); j++; + XtSetArg(args[j], XtNbackground, buttonColor); j++; + XtSetArg(args[j], XtNstate, gameInfo.variant == buttonDesc[i].variant); j++; + buttonDesc[i].handle = last = + XtCreateManagedWidget(buttonDesc[i].name, toggleWidgetClass, form, args, j); + } + + j=0; + XtSetArg(args[j], XtNfromVert, buttonDesc[12].handle); j++; + XtSetArg(args[j], XtNfromHoriz, buttonDesc[12].handle); j++; + XtSetArg(args[j], XtNheight, 35); j++; +// XtSetArg(args[j], XtNwidth, 60); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + b_cancel= XtCreateManagedWidget("CANCEL", commandWidgetClass, form, args, j); + XtAddCallback(b_cancel, XtNcallback, NewVariantPopDown, (XtPointer) 0); + + j=0; + XtSetArg(args[j], XtNfromHoriz, b_cancel); j++; + XtSetArg(args[j], XtNfromVert, buttonDesc[12].handle); j++; + XtSetArg(args[j], XtNheight, 35); j++; +// XtSetArg(args[j], XtNwidth, 60); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + b_ok= XtCreateManagedWidget(" OK ", commandWidgetClass, form, args, j); + XtAddCallback(b_ok, XtNcallback, NewVariantCallback, (XtPointer) 0); + + XtRealizeWidget(popup); + CatchDeleteWindow(popup, "NewVariantPopDown"); + + XQueryPointer(xDisplay, xBoardWindow, &root, &child, + &x, &y, &win_x, &win_y, &mask); + + XtSetArg(args[0], XtNx, x - 10); + XtSetArg(args[1], XtNy, y - 30); + XtSetValues(popup, args, 2); + + XtPopup(popup, XtGrabExclusive); + NewVariantUp = True; +} + +void NewVariantProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ + NewVariantPopUp(); +} + +//--------------------------- UCI Menu Popup ------------------------------------------ +int UciUp; +Widget UciShell; + +struct UciControl { + char *name; + Widget handle; + void *ptr; +}; + +struct UciControl controlDesc[] = { + {"maximum nr of CPUs:", 0, &appData.smpCores}, + {"Polyglot Directory:", 0, &appData.polyglotDir}, + {"Hash Size (MB):", 0, &appData.defaultHashSize}, + {"EGTB Path:", 0, &appData.defaultPathEGTB}, + {"EGTB Cache (MB):", 0, &appData.defaultCacheSizeEGTB}, + {"Polyglot Book:", 0, &appData.polyglotBook}, + {NULL, 0, NULL}, +}; + +void UciPopDown() +{ + if (!UciUp) return; + XtPopdown(UciShell); + XtDestroyWidget(UciShell); + UciUp = False; + ModeHighlight(); +} + +void UciCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; +{ + String name; + Arg args[16]; + char buf[80]; + int oldCores = appData.smpCores, ponder = 0; + + XtSetArg(args[0], XtNlabel, &name); + XtGetValues(w, args, 1); + + if (strcmp(name, "OK") == 0) { + int nr, i, j; String name; + for(i=0; i<6; i++) { + XtSetArg(args[0], XtNstring, &name); + XtGetValues(controlDesc[i].handle, args, 1); + if(i&1) { + if(name) + *(char**) controlDesc[i].ptr = strdup(name); + } else { + if(sscanf(name, "%d", &j) == 1) + *(int*) controlDesc[i].ptr = j; + } + } + XtSetArg(args[0], XtNstate, &appData.usePolyglotBook); + XtGetValues(w1, args, 1); + XtSetArg(args[0], XtNstate, &appData.firstHasOwnBookUCI); + XtGetValues(w2, args, 1); + XtSetArg(args[0], XtNstate, &appData.secondHasOwnBookUCI); + XtGetValues(w3, args, 1); + XtSetArg(args[0], XtNstate, &ponder); + XtGetValues(w4, args, 1); + + // adjust setting in other menu for duplicates + // (perhaps duplicates should be removed from general Option Menu?) + XtSetArg(args[0], XtNleftBitmap, ponder ? xMarkPixmap : None); + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Ponder Next Move"), args, 1); + + // make sure changes are sent to first engine by re-initializing it + // if it was already started pre-emptively at end of previous game + if(gameMode == BeginningOfGame) Reset(True, True); else { + // Some changed setting need immediate sending always. + PonderNextMoveEvent(ponder); + if(oldCores != appData.smpCores) + NewSettingEvent(False, "cores", appData.smpCores); + } + UciPopDown(); + return; + } +} + +void UciPopUp() +{ + Arg args[16]; + Widget popup, layout, dialog, edit, form, b_ok, b_cancel, last = NULL, new, upperLeft; + Window root, child; + int x, y, i, j; + int win_x, win_y; + unsigned int mask; + char def[80]; + + i = 0; + XtSetArg(args[i], XtNresizable, True); i++; +// XtSetArg(args[i], XtNwidth, 300); i++; + UciShell = popup = + XtCreatePopupShell("Engine Settings", transientShellWidgetClass, + shellWidget, args, i); + + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, popup, + layoutArgs, XtNumber(layoutArgs)); + + + form = + XtCreateManagedWidget("form", formWidgetClass, layout, + formArgs, XtNumber(formArgs)); + + j = 0; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; +// XtSetArg(args[j], XtNheight, 20); j++; + for(i = 0; controlDesc[i].name != NULL; i++) { + j = 3; + XtSetArg(args[j], XtNfromVert, last); j++; +// XtSetArg(args[j], XtNwidth, 130); j++; + XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + new = XtCreateManagedWidget(controlDesc[i].name, labelWidgetClass, form, args, j); + if(i==0) upperLeft = new; + + j = 4; + XtSetArg(args[j], XtNborderWidth, 1); j++; + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, i&1 ? 245 : 50); j++; + if(i&1) { + XtSetArg(args[j], XtNstring, * (char**) controlDesc[i].ptr ? + * (char**) controlDesc[i].ptr : ""); j++; + } else { + sprintf(def, "%d", * (int*) controlDesc[i].ptr); + XtSetArg(args[j], XtNstring, def); j++; + } + XtSetArg(args[j], XtNfromHoriz, upperLeft); j++; + controlDesc[i].handle = last = + XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j); + XtAddEventHandler(last, ButtonPressMask, False, SetFocus, (XtPointer) popup); + } + + j=0; + XtSetArg(args[j], XtNfromHoriz, controlDesc[0].handle); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNleft, XtChainRight); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + XtSetArg(args[j], XtNstate, appData.ponderNextMove); j++; + w4 = XtCreateManagedWidget("Ponder", toggleWidgetClass, form, args, j); + + j=0; + XtSetArg(args[j], XtNfromVert, last); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + b_ok = XtCreateManagedWidget("OK", commandWidgetClass, form, args, j); + XtAddCallback(b_ok, XtNcallback, UciCallback, (XtPointer) 0); + + XtSetArg(args[j], XtNfromHoriz, b_ok); j++; + b_cancel = XtCreateManagedWidget("cancel", commandWidgetClass, form, args, j); + XtAddCallback(b_cancel, XtNcallback, UciPopDown, (XtPointer) 0); + + j = 5; + XtSetArg(args[j], XtNfromHoriz, upperLeft); j++; + XtSetArg(args[j], XtNstate, appData.usePolyglotBook); j++; + w1 = XtCreateManagedWidget(" use book ", toggleWidgetClass, form, args, j); +// XtAddCallback(w1, XtNcallback, UciCallback, (XtPointer) 0); + + j = 5; + XtSetArg(args[j], XtNfromHoriz, w1); j++; + XtSetArg(args[j], XtNstate, appData.firstHasOwnBookUCI); j++; + w2 = XtCreateManagedWidget("own book 1", toggleWidgetClass, form, args, j); +// XtAddCallback(w2, XtNcallback, UciCallback, (XtPointer) 0); + + j = 5; + XtSetArg(args[j], XtNfromHoriz, w2); j++; + XtSetArg(args[j], XtNstate, appData.secondHasOwnBookUCI); j++; + w3 = XtCreateManagedWidget("own book 2", toggleWidgetClass, form, args, j); +// XtAddCallback(w3, XtNcallback, UciCallback, (XtPointer) 0); + + XtRealizeWidget(popup); + CatchDeleteWindow(popup, "UciPopDown"); + + XQueryPointer(xDisplay, xBoardWindow, &root, &child, + &x, &y, &win_x, &win_y, &mask); + + XtSetArg(args[0], XtNx, x - 10); + XtSetArg(args[1], XtNy, y - 30); + XtSetValues(popup, args, 2); + + XtPopup(popup, XtGrabExclusive); + UciUp = True; + + previous = NULL; + SetFocus(controlDesc[2].handle, popup, (XEvent*) NULL, False); +// XtSetKeyboardFocus(popup, controlDesc[1].handle); +} + +void UciMenuProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ + UciPopUp(); +} + +//--------------------------- General Popup for Cloning ---------------------------------- +#if 0 +int XXXUp; +Widget XXXShell; + +void XXXPopDown() +{ + if (!XXXUp) return; + XtPopdown(XXXShell); + XtDestroyWidget(XXXShell); + XXXUp = False; + ModeHighlight(); +} + +void XXXCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; +{ + String name; + Widget w2; + Arg args[16]; + char buf[80]; + + XtSetArg(args[0], XtNlabel, &name); + XtGetValues(w, args, 1); + + if (strcmp(name, "cancel") == 0) { + XXXPopDown(); + return; + } + if (strcmp(name, "ok") == 0) { + int nr; String name; + name = XawDialogGetValueString(w2 = XtParent(w)); + if(sscanf(name ,"%d",&nr) != 1) { + sprintf(buf, "%d", appData.defaultFrcPosition); + XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value + XtSetValues(w2, args, 1); + return; + } + XXXPopDown(); + return; + } +} + +void XXXPopUp() +{ + Arg args[16]; + Widget popup, layout, dialog, edit; + Window root, child; + int x, y, i; + int win_x, win_y; + unsigned int mask; + char def[80]; + + i = 0; + XtSetArg(args[i], XtNresizable, True); i++; + XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; + XXXShell = popup = + XtCreatePopupShell("XXX Menu", transientShellWidgetClass, + shellWidget, args, i); + + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, popup, + layoutArgs, XtNumber(layoutArgs)); + + sprintf(def, "%d\n", appData.defaultFrcPosition); + i = 0; + XtSetArg(args[i], XtNlabel, ""); i++; + XtSetArg(args[i], XtNvalue, def); i++; + XtSetArg(args[i], XtNborderWidth, 0); i++; + dialog = XtCreateManagedWidget("XXX", dialogWidgetClass, + layout, args, i); + + XawDialogAddButton(dialog, "ok", XXXCallback, (XtPointer) dialog); + XawDialogAddButton(dialog, "cancel", XXXCallback, (XtPointer) dialog); + + XtRealizeWidget(popup); + CatchDeleteWindow(popup, "XXXPopDown"); + + XQueryPointer(xDisplay, xBoardWindow, &root, &child, + &x, &y, &win_x, &win_y, &mask); + + XtSetArg(args[0], XtNx, x - 10); + XtSetArg(args[1], XtNy, y - 30); + XtSetValues(popup, args, 2); + + XtPopup(popup, XtGrabExclusive); + XXXUp = True; + + edit = XtNameToWidget(dialog, "*value"); + + previous = NULL; + SetFocus(engThreshold, popup, (XEvent*) NULL, False); +} + +void XXXMenuProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; +{ + XXXPopUp(); +} +#endif + diff --git a/zippy.c b/zippy.c index c788318..f75ecb2 100644 --- a/zippy.c +++ b/zippy.c @@ -873,7 +873,11 @@ int ZippyMatch(buf, i) if (looking_at(buf, i, "Challenge: * (*) *(*) * * * * Loaded from *")) { /* note: star_match[2] can include "[white] " or "[black] " before our own name. */ - ZippyHandleChallenge(star_match[4], star_match[8], + if(star_match[8] == NULL || star_match[8][0] == 0) // [HGM] chessd: open-source ICS has file on next line + ZippyHandleChallenge(star_match[4], star_match[5], + star_match[6], star_match[7], + StripHighlightAndTitle(star_match[0])); + else ZippyHandleChallenge(star_match[4], star_match[8], star_match[6], star_match[7], StripHighlightAndTitle(star_match[0])); return TRUE; -- 1.7.0.4