Fix multi-leg promotions
[xboard.git] / configure.ac
1 dnl| configure.in
2 dnl|
3 dnl| Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 dnl| 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc.
5 dnl|
6 dnl| GNU XBoard is free software: you can redistribute it and/or modify
7 dnl| it under the terms of the GNU General Public License as published by
8 dnl| the Free Software Foundation, either version 3 of the License, or (at
9 dnl| your option) any later version.
10 dnl|
11 dnl| GNU XBoard is distributed in the hope that it will be useful, but
12 dnl| WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl| General Public License for more details.
15 dnl|
16 dnl| You should have received a copy of the GNU General Public License
17 dnl| along with this program. If not, see http://www.gnu.org/licenses/.
18 dnl|
19 dnl| --------------------------------------------------------------------
20 dnl|
21 dnl| You can process this file with autoconf to produce a configure script.
22 dnl| However, normally the supplied configure script will work fine.
23 dnl|
24 dnl| If you do need to change the configure script, instead of editing
25 dnl| it directly, try to edit configure.in (in a way that will keep
26 dnl| it portable to sites and systems other than your own), and run autoconf
27 dnl| to regenerate configure.  Then submit your changes to be folded into
28 dnl| the standard version of xboard.
29
30 dnl| define second argument as MAJOR.MINOR.PATCHLEVEL. e.g. 4.4.0
31 dnl| MAJOR means large changes
32 dnl| MINOR can includes new features and bug fixes
33 dnl| PATCHLEVEL is used for bugfixes only
34 dnl| pre-release version have a -YYYYMMDD attached, e.g 4.9.0-20160313
35 AC_INIT([xboard],[4.9.0-20160402],[bug-xboard@gnu.org])
36
37 dnl| need this to be able to compile some files in a subdir (filebrowser)
38 AM_INIT_AUTOMAKE([subdir-objects])
39 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
40
41 AC_CONFIG_HEADERS([config.h])
42
43 dnl | a bunch of templates for defines used below
44 AH_TEMPLATE([FIRST_PTY_LETTER],[template])
45 AH_TEMPLATE([HAVE_FCNTL_H],[template])
46 AH_TEMPLATE([HAVE_GETHOSTNAME],[template])
47 AH_TEMPLATE([HAVE_GETTIMEOFDAY],[template])
48 AH_TEMPLATE([HAVE_RANDOM],[template])
49 AH_TEMPLATE([HAVE_SYS_SOCKET_H],[template])
50 AH_TEMPLATE([IBMRTAIX],[template])
51 AH_TEMPLATE([LAST_PTY_LETTER],[template])
52 AH_TEMPLATE([PTY_ITERATION],[template])
53 AH_TEMPLATE([PTY_NAME_SPRINTF],[template])
54 AH_TEMPLATE([PTY_OPEN],[template])
55 AH_TEMPLATE([PTY_TTY_NAME_SPRINTF],[template])
56 AH_TEMPLATE([REMOTE_SHELL],[template])
57 AH_TEMPLATE([RTU],[template])
58 AH_TEMPLATE([UNIPLUS],[template])
59 AH_TEMPLATE([USE_PTYS],[template])
60 AH_TEMPLATE([X_WCHAR],[template])
61 AH_TEMPLATE([ATTENTION],[template])
62 AH_TEMPLATE([DEFINED_SYS_ERRLIST],[template])
63 AH_TEMPLATE([USE_XAW3D],[template])
64 AH_TEMPLATE([X_LOCALE],[template])
65
66
67
68 if test -z "$CFLAGS" ; then
69 dnl| Prevent the next macro from setting CFLAGS to -g
70   CFLAGS=" "
71 fi
72 AC_PROG_CC
73
74 dnl| need this to be able to compile files in a subdir
75 AM_PROG_CC_C_O
76
77 AC_PROG_CPP
78 AC_ISC_POSIX
79 AC_PROG_INSTALL
80
81 dnl| add gettext support
82 AM_GNU_GETTEXT_VERSION(0.17)
83 AM_GNU_GETTEXT([external])
84
85 AC_CHECK_PROGS(RSH, remsh rsh, rsh)
86 AC_CHECK_PROGS(MINFO, makeinfo, makeinfo_not_found)
87 if test "$MINFO" = makeinfo_not_found ; then
88    echo Please install \"makeinfo\"
89    exit 1
90 fi
91 AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$RSH")
92 AC_CHECK_PROG(NROFF, nroff, [nroff -man], cat)
93 AC_SUBST(NROFFFLAGS)
94 AC_PATH_PROGS(AWKPATH, awk mawk gawk nawk)
95 AC_PATH_PROGS(PERLPATH, perl)
96
97 AC_HEADER_STDC
98 AC_HEADER_TIME
99 AC_HEADER_SYS_WAIT
100 AC_HEADER_DIRENT
101 AC_TYPE_SIGNAL
102 AC_CHECK_HEADERS(stropts.h sys/time.h string.h unistd.h sys/systeminfo.h)
103 AC_CHECK_HEADERS(fcntl.h sys/fcntl.h, break)
104 AC_CHECK_HEADERS(sys/socket.h lan/socket.h, break)
105 AC_CHECK_HEADER(stddef.h, [], AC_DEFINE(X_WCHAR, 1))
106
107 AC_CHECK_FUNCS(_getpty grantpt setitimer usleep)
108 AC_CHECK_FUNCS(gettimeofday ftime, break)
109 AC_CHECK_FUNCS(random rand48, break)
110 AC_CHECK_FUNCS(gethostname sysinfo, break)
111 AC_CHECK_FUNC(setlocale, [],
112   AC_CHECK_LIB(i, setlocale, [], AC_DEFINE(X_LOCALE, 1)))
113
114 AC_CHECK_LIB(seq, getpseudotty)
115
116 dnl | add compiler warnings only if compiler understands them
117 AC_MSG_CHECKING(whether compiler understands -Wall -Wno-parentheses)
118 SAVE_CFLAGS="$CFLAGS"
119 CFLAGS="$CFLAGS -Wall -Wno-parentheses"
120 AC_TRY_COMPILE([],[],
121   AC_MSG_RESULT(yes),
122   AC_MSG_RESULT(no)
123   CFLAGS="$SAVE_CFLAGS")
124
125 dnl | check for pkg-config
126 AC_CHECK_PROGS([PKGCONFIG], [pkg-config], pkgconfig_not_found)
127 AS_IF( [test "x$PKGCONFIG" = xpkgconfig_not_found],
128        AC_MSG_ERROR([cannot find pkg-config! Please install it.]))
129
130 dnl | check for cairo and librsvg
131 PKG_CHECK_MODULES([CAIRO], [ cairo >= 1.2.0 pangocairo librsvg-2.0 >= 2.14.0 ])
132 AC_SUBST(CAIRO_CFLAGS)
133 AC_SUBST(CAIRO_LIBS)
134
135 dnl | check which front end to use
136 dnl | first check for gtk
137 dnl | then for Xaw3d
138 dnl | and then for Xaw
139 FRONTEND_CFLAGS=""
140 FRONTEND_LIBS=""
141
142 AC_ARG_WITH([gtk],
143             [AS_HELP_STRING([--with-gtk],[use GTK front-end (default)])],
144             [with_GTK=$withval],
145             [with_GTK="yes"])
146
147 AC_ARG_WITH([Xaw3d],
148             [AS_HELP_STRING([--with-Xaw3d],[use Xaw3d front-end (not fully supported anymore)])],
149             [with_Xaw3d="$withval"],
150             [with_Xaw3d="no"])
151 dnl | overwrite default gtk
152 AS_IF([test "x$with_Xaw3d" = xyes], [with_GTK="no"])
153
154 AC_ARG_WITH([Xaw],
155             [AS_HELP_STRING([--with-Xaw],[use Xaw front-end])],
156             [with_Xaw="$withval"],
157             [with_Xaw="no"])
158 dnl | overwrite default gtk
159 AS_IF([test "x$with_Xaw" = xyes], [with_GTK="no"])
160
161 AC_ARG_WITH([iconsdir],
162             [AS_HELP_STRING([--with-iconsdir=DIR],
163             [path where icons get installed (default: $datadir/icons/hicolor/48x48/apps)])],
164             [ICONSDIR="$withval"],
165             [ICONSDIR='$(datadir)/icons/hicolor/48x48/apps'])
166
167 AC_ARG_WITH([svgiconsdir],
168             [AS_HELP_STRING([--with-svgiconsdir=DIR],
169             [path where svg icons get installed (default: $datadir/icons/hicolor/scalable/apps)])],
170             [SVGICONSDIR="$withval"],
171             [SVGICONSDIR='$(datadir)/icons/hicolor/scalable/apps'])
172
173 AC_ARG_WITH([desktopdir],
174             [AS_HELP_STRING([--with-desktopdir=DIR],
175                             [path where desktop files get installed (default: $datadir/applications)])],
176             [DESKTOPDIR="$withval"],
177             [DESKTOPDIR='$(datadir)/applications'])
178
179 AC_ARG_WITH([mimedir],
180             [AS_HELP_STRING([--with-mimedir=DIR],
181                             [path where mime files get installed (default: $datadir/mime/packages)])],
182             [MIMEDIR="$withval"],
183             [MIMEDIR='$(datadir)/mime/packages'])
184
185 AC_ARG_WITH([gamedatadir],
186             [AS_HELP_STRING([--with-gamedatadir=DIR],
187                             [path where game data files get installed (default: $datadir/games/xboard)])],
188             [GAMEDATADIR="$withval"],
189             [GAMEDATADIR='$(datadir)/games/xboard'])
190
191 AC_ARG_ENABLE([update-mimedb],
192               [AS_HELP_STRING([--disable-update-mimedb],[disable the update-mime-database after install [default=no]])],
193               [enable_mimedb="no"],
194               [enable_mimedb="yes"])
195
196 AC_ARG_ENABLE([osxapp],
197               [AS_HELP_STRING([--enable-osxapp],[build a OSX app [default=no]])],
198               [enable_OSXAPP=$enableval],
199               [enable_OSXAPP="no"])
200
201 AS_IF([test x"$enable_OSXAPP" = x"yes"], [
202      prefix=`pwd`/XBoard.app/Contents
203      AC_DEFINE([OSXAPP], [1], [We are building an OSX APP, redefine some functions])
204      with_GTK="yes"
205      enable_mimedb="no"
206      datarootdir='$(prefix)/Resources'
207      datadir='$(datarootdir)/share'
208      sysconfdir='$(datarootdir)/etc'
209      infodir='$(datadir)/info'
210      mandir='$(datadir)/man'
211      bindir='$(prefix)/MacOS'
212      localedir='$(datadir)/locale'
213      GAMEDATADIR='$(datadir)/xboard'],[])
214
215 AM_CONDITIONAL(OSX_APP, test x"$enable_OSXAPP" = x"yes")
216
217 AM_CONDITIONAL(NLS_ENABLED, test x"$USE_NLS" = x"yes")
218
219 AM_CONDITIONAL(ENABLE_UPDATE_MIMEDB, test x"$enable_mimedb" = x"yes")
220 if test x"$enable_mimedb" = x"yes"; then
221    AC_PATH_PROG([XDG_MIME],[xdg-mime])
222    AC_SUBST(XDG_MIME)
223    AC_PATH_PROG([XDG_DESKTOP_MENU],[xdg-desktop-menu])
224    AC_SUBST(XDG_DESKTOP_MENU)
225    AC_PATH_PROG([XDG_ICON_RESOURCE],[xdg-icon-resource])
226    AC_SUBST(XDG_ICON_RESOURCE)
227 fi
228
229 AC_SUBST(ICONSDIR)
230 AC_SUBST(SVGICONSDIR)
231 AC_SUBST(DESKTOPDIR)
232 AC_SUBST(MIMEDIR)
233 AC_SUBST(GAMEDATADIR)
234
235 dnl | check for libraries
236 if test x"$with_GTK" = x"yes" ; then
237   PKG_CHECK_MODULES([GTK], [ gtk+-2.0 >= 2.16.0 gmodule-2.0 ])
238   FRONTEND_CFLAGS=$GTK_CFLAGS
239   FRONTEND_LIBS=$GTK_LIBS
240   with_Xaw="no"
241 fi
242
243 if test x"$with_GTK" = x"no" ; then
244
245 dnl | general check for Xaw and Xaw3d
246   AC_PATH_XTRA
247   if test -n "$no_x" ; then
248     AC_MSG_ERROR([ "    $PACKAGE requires the X Window System header files and libraries!
249     They were not found on your system.  See FAQ topic C.2.
250     configure failed"])
251   fi
252
253   save_cflags="$CFLAGS"
254   save_cppflags="$CPPFLAGS"
255   CFLAGS="$CFLAGS $X_CFLAGS"
256   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
257   AC_CHECK_HEADER([X11/Intrinsic.h],[xt="yes"],[xt="no"])
258   CFLAGS="$save_cflags"
259   CPPFLAGS="$save_cppflags"
260
261   if test "$xt" = "no" ; then
262      AC_MSG_ERROR([Xt headers not found. Please install the X11 packages.])
263   fi
264
265 dnl | check availability of Xaw3d
266   FRONTEND_LIBS=
267   AS_IF([test x"$with_Xaw3d" != x"no"],
268             [AC_CHECK_LIB([Xaw3d],
269                     [XawTextReplace],
270                     [ FRONTEND_LIBS="-lXaw3d"
271                       AC_DEFINE([USE_XAW3D], [1], [Define if you want to use Xaw3d])],
272                     [AC_MSG_ERROR([--with-Xaw3d was given, but test for Xaw3d failed. Make sure that you have Xaw3d installed, else you might want to try the configure option --without-Xaw3d])],
273                                [-lXaw])])
274
275 dnl | no Xaw3d, check for Xaw; make it the default
276   if test x"$with_Xaw3d" = x"no" ; then
277      with_Xaw=yes
278      save_cflags="$CFLAGS"
279      save_cppflags="$CPPFLAGS"
280      CFLAGS="$CFLAGS $X_CFLAGS"
281      CPPFLAGS="$CPPFLAGS $X_CFLAGS"
282      AC_CHECK_HEADER([X11/Xaw/Dialog.h],[xaw_headers="yes"], [xaw_headers="no"])
283      CFLAGS="$save_cflags"
284      CPPFLAGS="$save_cppflags"
285
286      if test x"$xaw_headers" = x"no" ; then
287         AC_MSG_ERROR([Xaw headers not found. Please install the Xaw package and headers.])
288      fi
289
290      FRONTEND_LIBS="-lXaw"
291   fi
292
293 fi
294
295 dnl | make results available in Makefile.am
296 AM_CONDITIONAL([withGTK],   [test x"$with_GTK" = x"yes"])
297 AM_CONDITIONAL([withXaw],   [test x"$with_Xaw3d" = x"yes" || test x"$with_Xaw" = x"yes"])
298
299 dnl | end Front-end check
300
301 AC_CANONICAL_HOST
302
303 dnl| The following info is mostly gathered from GNU Emacs 19.24.  Basically,
304 dnl| we are trying to find out whether this is a System-V derivative in
305 dnl| which pipes don't work with select() and if so, whether there is anything
306 dnl| strange about the way to open a pty.  Some of the work was done above
307 dnl| by looking for _getpty, grantpt, and getpseudotty.  A few other strange
308 dnl| properties of particular systems are also handled here.
309
310 dnl| 4/6/97 I'm not sure there really are any systems where pipes
311 dnl| don't work with select(), and ptys cause problems on many
312 dnl| systems, so I'm changing the default to disable ptys in all
313 dnl| cases.  I will change it back if I get bug reports that are fixed
314 dnl| by doing a "configure --enable-ptys"
315
316 USE_PTYS=0
317 case "$host" in
318   *-*-hpux* )
319     AC_DEFINE(PTY_TTY_NAME_SPRINTF,
320         [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);])
321     AC_DEFINE(PTY_NAME_SPRINTF,
322         [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);])
323 dnl| USE_PTYS=1
324     if test "$GCC" = yes; then
325       CONF_CFLAGS="-fwritable-strings"
326     else
327
328 dnl| Note: You might be able to build xboard even if your compiler does not
329 dnl| support ANSI C (-Aa).  xboard itself does not require ANSI C.  I don't
330 dnl| know whether the X header files on HP-UX require it.
331
332       CONF_CFLAGS="-Aa -D_HPUX_SOURCE"
333     fi
334
335 dnl| HP doesn't supply a full set of X header files and libraries.  People
336 dnl| often have some things installed in one place and some in another.
337 dnl| AC_PATH_XTRA will find only one place, so we try to add all the
338 dnl| likely ones that might be missing here.  It might be better to
339 dnl| change AC_PATH_XTRA to try to extract this information from imake,
340 dnl| since folks who install the missing bits often configure their
341 dnl| imake to find them, but I don't want to delve into autoconf and
342 dnl| hack on its internals.
343
344     if test -d /opt/hppd/include/X11; then
345       X_CFLAGS="$X_CFLAGS -I/opt/hppd/include"
346       X_LIBS="$X_LIBS -L/opt/hppd/lib"
347     elif test -d /usr/contrib/X11R5/include; then
348       X_CFLAGS="$X_CFLAGS -I/usr/contrib/X11R5/include"
349       X_LIBS="$X_LIBS -L/usr/contrib/X11R5/lib"
350     elif test -d /usr/contrib/mitX11R5/include; then
351       X_CFLAGS="$X_CFLAGS -I/usr/contrib/mitX11R5/include"
352       X_LIBS="$X_LIBS -L/usr/contrib/mitX11R5/lib"
353     elif test -d /MIT/X11R5/include; then
354       X_CFLAGS="$X_CFLAGS -I/MIT/X11R5/include"
355       X_LIBS="$X_LIBS -L/MIT/X11R5/lib"
356     elif test -d /usr/local/include/X11R5; then
357       X_CFLAGS="$X_CFLAGS -I/usr/local/include/X11R5"
358       X_LIBS="$X_LIBS -L/usr/local/lib/X11R5"
359     fi
360     if test -d /usr/include/X11R5; then
361       X_CFLAGS="$X_CFLAGS -I/usr/include/X11R5"
362       X_LIBS="$X_LIBS -L/usr/lib/X11R5 -L/usr/lib/X11R4"
363     elif test -d /usr/include/X11R4; then
364       X_CFLAGS="$X_CFLAGS -I/usr/include/X11R4"
365       X_LIBS="$X_LIBS -L/usr/lib/X11R4"
366     fi
367   ;;
368
369   romp-ibm-aix* )
370     AC_DEFINE(IBMRTAIX, 1)
371 dnl| USE_PTYS=1
372   ;;
373
374   i386-ibm-aix )
375 dnl| USE_PTYS=1
376     if test "$GCC" = yes; then
377       CONF_CFLAGS="-fwritable-strings"
378     fi
379   ;;
380
381   *-*-aix3* | *-*-bosx* )
382     AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)])
383     AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");])
384     AC_DEFINE(PTY_TTY_NAME_SPRINTF, [strcpy (pty_name, ttyname (fd));])
385 dnl| USE_PTYS=1
386   ;;
387
388   *-*-cxux* )
389     AC_DEFINE(FIRST_PTY_LETTER, 'A')
390     AC_DEFINE(LAST_PTY_LETTER, 'P')
391 dnl| USE_PTYS=1
392   ;;
393
394   *-*-uniplus* )
395     AC_DEFINE(UNIPLUS, 1)
396 dnl| USE_PTYS=1
397   ;;
398
399   *-*-rtu* )
400     AC_DEFINE(FIRST_PTY_LETTER, 'z')
401     AC_DEFINE(PTY_TTY_NAME_SPRINTF,
402         [sprintf (pty_name, "/dev/ttyp%x", i);])
403     AC_DEFINE(PTY_NAME_SPRINTF,
404         [sprintf (pty_name, "/dev/pty%x", i);])
405     AC_DEFINE(RTU, 1)
406 dnl| USE_PTYS=1
407   ;;
408
409   *-*-iris* | *-*-irix3* )
410     AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)])
411     AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");])
412     AC_DEFINE(PTY_TTY_NAME_SPRINTF,
413         [sprintf (pty_name, "/dev/ttyq%d", minor(stb.st_rdev));])
414 dnl| USE_PTYS=1
415   ;;
416
417   *-*-irix* )
418 dnl| USE_PTYS=1
419   ;;
420
421   *-*-sunos4* | *-*-solaris1* )
422
423 dnl| Work around a bug in the SunOS 4.x linker.  Not needed if you have patches
424 dnl|  100512-02 and 100573-03 from Sun.  The X FAQ says that the following is
425 dnl|  "overkill," but doesn't explain what should be done instead.
426
427     if test "$GCC" = yes; then
428       PRE_XMULIB="-static"
429       POST_XMULIB="-dynamic"
430     else
431       PRE_XMULIB="-Bstatic"
432       POST_XMULIB="-Bdynamic"
433     fi
434   ;;
435
436   *-*-sunos5* | *-*-solaris2* )
437 dnl| USE_PTYS=1
438
439 dnl| I'm not sure -lelf is needed, but it was in the old Imakefile.
440 dnl| The other libraries should all be found by Ac_PATH_XTRA or other
441 dnl| code above.
442
443     X_LIBS="$X_LIBS -lelf"
444   ;;
445
446   *-*-sco* )
447     AC_DEFINE(PTY_ITERATION, [for (i = 0; ; i++)])
448     AC_DEFINE(PTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ptyp%d", i);])
449     AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ttyp%d", i);])
450 dnl| USE_PTYS=1
451   ;;
452
453   *-*-dynix* | *-*-ptx* )
454 dnl| USE_PTYS=1
455   ;;
456
457   *-*-esix* )
458 dnl| USE_PTYS=1
459   ;;
460
461   *-*-usg5-4* | *-*-sysvr4* )
462 dnl| USE_PTYS=1
463   ;;
464
465   *-*-usg* | *-*-sysv* | *-*-aix* )
466 dnl| USE_PTYS=1
467   ;;
468
469   vax-*-ultrix )
470     if test "$GCC" = yes; then
471       CONF_CFLAGS="-fwritable-strings"
472     fi
473   ;;
474
475 dnl| add some libs for OS X
476   *-apple-* )
477     AC_MSG_WARN([Apple support is experimental, please report any problems to bug-xboard@gnu.org])
478     AC_MSG_WARN([use --enable-osxapp to enable the build target and automatically adjust target directories])
479     AC_MSG_WARN([Building an OSX app currently relies on some programs such as dylib that we don't test for])
480     AC_MSG_WARN([patches welcome ;)])
481     AC_PATH_PROG(SW_VERS, sw_vers)
482     if test "x$SW_VERS" != "x"; then
483       AC_MSG_CHECKING(Mac OS X version)
484       MACOSX_VERSION=`$SW_VERS -productVersion`
485       AC_MSG_RESULT([$MACOSX_VERSION])
486     fi
487     FRONTEND_LIBS="$FRONTEND_LIBS -headerpad_max_install_names "
488     if test x"$enable_OSXAPP" = x"yes" ; then
489         FRONTEND_LIBS="$FRONTEND_LIBS -lgtkmacintegration-gtk2"
490     fi
491     FRONTEND_CFLAGS="$FRONTEND_CFLAGS -I/opt/local/include -L/opt/local/lib"
492   ;;
493 esac
494
495
496 AC_SUBST(FRONTEND_CFLAGS)
497 AC_SUBST(FRONTEND_LIBS)
498 AC_SUBST(PRE_XMULIB)
499 AC_SUBST(POST_XMULIB)
500 AC_SUBST(CONF_CFLAGS)
501 AC_SUBST(CONF_LDFLAGS)
502
503 AC_MSG_CHECKING(whether ptys or pipes should be used)
504 AC_ARG_ENABLE( [ptys],
505                [AS_HELP_STRING([--enable-ptys],[force use of pseudo-ttys with child processes])],
506 [if test "$enableval" = yes; then
507   USE_PTYS=1
508   enable_ptys="ptys"
509   AC_MSG_RESULT([ptys (user override)])
510 fi
511 if test "$enableval" = no; then
512   USE_PTYS=0
513   enable_ptys="pipes"
514   AC_MSG_RESULT([pipes (user override)])
515 fi],
516 [if test "$USE_PTYS" = 1; then
517   AC_MSG_RESULT(ptys)
518   enable_ptys="ptys"
519 else
520   AC_MSG_RESULT(pipes)
521   enable_ptys="pipes"
522 fi])
523 AC_DEFINE_UNQUOTED(USE_PTYS, $USE_PTYS)
524
525
526 dnl | define not to build zippy as a default, so that autoheader is happy
527 AC_ARG_ENABLE( [zippy],
528                [AS_HELP_STRING([--enable-zippy],[support interfacing a chess program to ICS (default)])],
529                [],
530                [enable_zippy="no"])
531
532 if test x"$enable_zippy" != x"no"; then
533   AC_DEFINE(ZIPPY, 1,[should zippy be enabled])
534 else
535   AC_DEFINE(ZIPPY, 0,[should zippy be enabled])
536 fi
537 AM_CONDITIONAL([ZIPPY], [test x$enable_zippy != xno])
538
539
540 AC_ARG_ENABLE(sigint,
541 [AS_HELP_STRING([--enable-sigint],[sending SIGINT (^C) wakes up GNU Chess (default)])],
542 [if test "$enableval" = yes; then
543   AC_DEFINE(ATTENTION, 1)
544 fi
545 enable_sigint=$enableval
546 ],
547 [enable_sigint="yes"
548 AC_DEFINE(ATTENTION, 1)])
549
550
551 if test x"$with_Xaw3d" = x"yes" -o  x"$with_Xaw" = x"yes" ; then
552 dnl | save all information for X in X_LIBS, also add the libraries themself
553 dnl | since AC_PATH_XTRA only adds the paths
554 X_LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS -lXmu -lX11 -lXt "
555 AC_SUBST(X_CFLAGS)
556 AC_SUBST(X_LIBS)
557 fi
558
559 dnl create a string with configure options that can be passed to the
560 dnl program, good for bug reports and version printout, see output below
561 CONFIGURE_OPTIONS="prefix=$prefix; datarootdir=$datarootdir; \
562 datadir=$datadir; gamedatadir=$GAMEDATADIR; desktopdir=$DESKTOPDIR; \
563 mimedir=$MIMEDIR; iconsdir=$ICONSDIR; svgiconsdir=$SVGICONSDIR; infodir=$infodir; \
564 sysconfigdir=$sysconfigdir; update_mimedb=$enable_mimedb; NLS=$USE_NLS; \
565 GTK=$with_GTK; Xaw3d=$with_Xaw3d; Xaw=$with_Xaw; \
566 ptys=$enable_ptys; zippy=$enable_zippy; sigint=$enable_sigint"
567
568 AC_SUBST(CONFIGURE_OPTIONS)
569
570 dnl |  output Makefile
571 AC_CONFIG_FILES([Makefile cmail po/Makefile.in osxapp/Info.plist])
572 AC_CONFIG_COMMANDS([test-stamp-h],[test -z "$CONFIG_HEADERS" || date > stamp-h])
573 AC_CONFIG_COMMANDS([chmod-cmail],[chmod 755 cmail])
574 AC_OUTPUT
575
576 dnl
577 dnl Output a summary
578 dnl
579 echo ""
580 echo " Configurations summary:"
581 echo ""
582 echo "        prefix:          $prefix       "
583 echo "        datarootdir:     $datarootdir  "
584 echo "        datadir:         $datadir      "
585 echo "        gamedatadir:     $GAMEDATADIR  "
586 echo "        desktopdir:      $DESKTOPDIR   "
587 echo "        mimedir:         $MIMEDIR      "
588 echo "        iconsdir:        $ICONSDIR     "
589 echo "        svgiconsdir:     $SVGICONSDIR  "
590 echo "        infodir:         $infodir   (info files will go here)"
591 echo "        sysconfdir:      $sysconfdir   (xboard.conf will go here)"
592 echo ""
593 echo "        update mimedb:   $enable_mimedb"
594 echo ""
595 echo "        NLS support:     $USE_NLS"
596 echo ""
597 echo "        GTK:             $with_GTK"
598 echo "        Xaw3d:           $with_Xaw3d"
599 echo "        Xaw:             $with_Xaw"
600 echo ""
601 echo "        ptys:            $enable_ptys"
602 echo "        zippy:           $enable_zippy"
603 echo "        sigint:          $enable_sigint"