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])
9 AC_CONFIG_SRCDIR([gnushogi/gnushogi.h])
10 AC_CONFIG_HEADER(config.h)
13 AC_MSG_NOTICE([C compiler])
17 AC_MSG_NOTICE([yacc/bison, lex/flex, and install])
31 [AS_HELP_STRING([--with-curses],
32 [enable curses UI (default: yes if available)])],
37 AS_IF([test "x$with_curses" != xno],
38 [AC_CHECK_LIB([curses], [clrtoeol],
39 [AC_SUBST([LIBCURSES], [-lcurses])
40 AC_SUBST([CURSESDSP], [cursesdsp.o])
41 AC_DEFINE([HAVE_LIBCURSES], [1],
42 [Define if you have lib])
44 [AS_IF([test "x$with_curses" = xyes],
46 [--with-curses was given, but test for curses failed])])],
50 AC_CHECK_LIB([m], [pow])
51 AC_CHECK_LIB([termcap], [tgoto])
56 # C compiler warnings.
58 if [[ $ac_cv_c_compiler_gnu = yes ]]
60 WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes -ansi -pedantic"
61 CEXTRAFLAGS="-fsigned-char -funroll-loops"
63 # Who knows what warnings your compiler uses?
72 AC_MSG_NOTICE([header files])
76 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/file.h sys/ioctl.h])
77 AC_CHECK_HEADERS([sys/param.h sys/time.h unistd.h])
78 AC_CHECK_HEADERS(errno.h)
82 AC_MSG_NOTICE([typedefs])
93 AC_MSG_NOTICE([compiler characteristics])
98 AC_MSG_NOTICE([library functions])
101 AC_PROG_GCC_TRADITIONAL
104 AC_CHECK_FUNCS([dup2 gethostname gettimeofday memset pow strcasecmp])
105 AC_CHECK_FUNCS([strchr strerror strrchr strstr strtol])
106 AC_CHECK_FUNCS([memcpy bcopy])
107 AC_CHECK_FUNCS([setvbuf setlinebuf])
111 # Set various user-definable options.
114 AC_ARG_ENABLE([minishogi],
116 Build gnuminishogi instead of gnushogi (default: no)],
117 [AC_DEFINE([MINISHOGI], [], [Define to build gnuminishogi instead of gnushogi])
118 AC_SUBST([PROGNAME], [gnuminishogi])
120 [AC_SUBST([PROGNAME], [gnushogi])
124 FIRST_SHOGI_PROGRAM=gnushogi
125 SECOND_SHOGI_PROGRAM=gnushogi
127 SECOND_HOST=localhost
129 AC_ARG_ENABLE([xshogi],
130 AS_HELP_STRING([--enable-xshogi],
131 [compile the xshogi graphical interface to GNU shogi (default: no)]),
132 [enable_xshogi=$enableval],
135 AC_ARG_WITH([top-part-bitmaps],
136 AS_HELP_STRING([--with-top-part-bitmaps],
137 [use top part of Kanji bitmaps only in xshogi]),
138 [OPT=-DTOP_PART_BITMAPS])
140 AC_ARG_WITH([first-shogi-program],
141 AS_HELP_STRING([--with-first-shogi-program=PROGNAME],
142 [use PROGNAME as the first shogi program in xshogi (default: gnushogi)]),
143 [FIRST_SHOGI_PROGRAM=$withval])
145 AC_ARG_WITH([second-shogi-program],
146 AS_HELP_STRING([--with-second-shogi-program=PROGNAME],
147 [use PROGNAME as the second shogi program in xshogi (default: gnushogi)]),
148 [SECOND_SHOGI_PROGRAM=$withval])
150 AC_ARG_WITH([first-host],
151 AS_HELP_STRING([--with-first-host=HOSTNAME],
152 [use HOSTNAME as the machine on which the first shogi program runs in xshogi (default: localhost)]),
153 [FIRST_HOST=$withval])
155 AC_ARG_WITH([second-host],
156 AS_HELP_STRING([--with-second-host=HOSTNAME],
157 [use HOSTNAME as the machine on which the second shogi program runs in xshogi (default: localhost)]),
158 [SECOND_HOST=$withval])
161 AC_SUBST(FIRST_SHOGI_PROGRAM)
162 AC_SUBST(SECOND_SHOGI_PROGRAM)
164 AC_SUBST(SECOND_HOST)
166 if [[ $enable_xshogi = yes ]]
168 XSHOGI=xshogi_compile
169 XSHOGIINSTALL=xshogi_install
170 XSHOGICLEAN=xshogi_clean
178 AC_SUBST(XSHOGIINSTALL)
179 AC_SUBST(XSHOGICLEAN)
182 AC_CONFIG_FILES([Makefile