1 # ------------------------------------------------------------
2 # GNU shogi and xshogi configuration script.
3 # ------------------------------------------------------------
5 dnl Process this file with autoconf to produce a configure script.
8 AC_INIT([gnushogi],[1.4.1+],[https://savannah.gnu.org/bugs/?group=gnushogi])
10 AC_CONFIG_SRCDIR([gnushogi/gnushogi.h])
11 AC_CONFIG_HEADER(config.h)
14 AC_MSG_NOTICE([C compiler])
18 AC_MSG_NOTICE([yacc/bison, lex/flex, and install])
32 [AS_HELP_STRING([--with-curses],
33 [enable curses UI (default: yes if available)])],
38 AS_IF([test "x$with_curses" != xno],
39 [AC_CHECK_LIB([curses], [clrtoeol],
40 [AC_SUBST([LIBCURSES], [-lcurses])
41 AC_SUBST([CURSESDSP], [gnushogi-cursesdsp.o])
42 AC_SUBST([CURSESDSPMINI], [gnuminishogi-cursesdsp.o])
43 AC_DEFINE([HAVE_LIBCURSES], [1],
44 [Define if you have lib])
46 [AS_IF([test "x$with_curses" = xyes],
48 [--with-curses was given, but test for curses failed])])],
52 AC_CHECK_LIB([m], [pow])
53 AC_CHECK_LIB([termcap], [tgoto])
58 # C compiler warnings.
60 if [[ $ac_cv_c_compiler_gnu = yes ]]
62 WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes -ansi"
63 CEXTRAFLAGS="-fsigned-char -funroll-loops"
65 # Who knows what warnings your compiler uses?
74 AC_MSG_NOTICE([header files])
78 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/file.h sys/ioctl.h])
79 AC_CHECK_HEADERS([sys/param.h sys/time.h unistd.h])
80 AC_CHECK_HEADERS(errno.h)
84 AC_MSG_NOTICE([typedefs])
95 AC_MSG_NOTICE([compiler characteristics])
100 AC_MSG_NOTICE([library functions])
103 AC_PROG_GCC_TRADITIONAL
106 AC_CHECK_FUNCS([dup2 gethostname gettimeofday memset pow strcasecmp])
107 AC_CHECK_FUNCS([strchr strerror strrchr strstr strtol])
108 AC_CHECK_FUNCS([memcpy bcopy])
109 AC_CHECK_FUNCS([setvbuf setlinebuf])
113 # Set various user-definable options.
117 FIRST_SHOGI_PROGRAM=gnushogi
118 SECOND_SHOGI_PROGRAM=gnushogi
120 SECOND_HOST=localhost
122 AC_ARG_ENABLE([xshogi],
123 AS_HELP_STRING([--enable-xshogi],
124 [compile the xshogi graphical interface to GNU shogi (default: no)]),
125 [enable_xshogi=$enableval],
128 AC_ARG_WITH([top-part-bitmaps],
129 AS_HELP_STRING([--with-top-part-bitmaps],
130 [use top part of Kanji bitmaps only in xshogi]),
131 [OPT=-DTOP_PART_BITMAPS])
133 AC_ARG_WITH([first-shogi-program],
134 AS_HELP_STRING([--with-first-shogi-program=PROGNAME],
135 [use PROGNAME as the first shogi program in xshogi (default: gnushogi)]),
136 [FIRST_SHOGI_PROGRAM=$withval])
138 AC_ARG_WITH([second-shogi-program],
139 AS_HELP_STRING([--with-second-shogi-program=PROGNAME],
140 [use PROGNAME as the second shogi program in xshogi (default: gnushogi)]),
141 [SECOND_SHOGI_PROGRAM=$withval])
143 AC_ARG_WITH([first-host],
144 AS_HELP_STRING([--with-first-host=HOSTNAME],
145 [use HOSTNAME as the machine on which the first shogi program runs in xshogi (default: localhost)]),
146 [FIRST_HOST=$withval])
148 AC_ARG_WITH([second-host],
149 AS_HELP_STRING([--with-second-host=HOSTNAME],
150 [use HOSTNAME as the machine on which the second shogi program runs in xshogi (default: localhost)]),
151 [SECOND_HOST=$withval])
154 AC_SUBST(FIRST_SHOGI_PROGRAM)
155 AC_SUBST(SECOND_SHOGI_PROGRAM)
157 AC_SUBST(SECOND_HOST)
159 if [[ $enable_xshogi = yes ]]
175 AC_CONFIG_FILES([Makefile