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