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.0+],[https://savannah.gnu.org/bugs/?group=gnushogi])
9 AC_CONFIG_SRCDIR([version.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],
37 AS_IF([test "x$with_curses" != xno],
38 [AC_CHECK_LIB([curses], [clrtoeol],
39 [AC_SUBST([LIBCURSES], ["-lcurses"])
40 AC_DEFINE([HAVE_LIBCURSES], [1],
41 [Define if you have lib])
44 [--with-curses was given, but test for curses failed])],
49 AC_CHECK_LIB(termcap, tgoto)
54 # C compiler warnings.
56 if [[ $ac_cv_c_compiler_gnu = yes ]]
58 WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes -ansi -pedantic"
59 CEXTRAFLAGS="-fsigned-char -funroll-loops \$(HASH)"
60 # For profiling targets:
61 CEXTRAFLAGS2="-fsigned-char -pg -fprofile-arcs -ftest-coverage \$(HASH)"
63 # Who knows what warnings your compiler uses?
65 CEXTRAFLAGS="\$(HASH)"
70 AC_SUBST(CEXTRAFLAGS2)
73 AC_MSG_NOTICE([header files])
77 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/file.h sys/ioctl.h])
78 AC_CHECK_HEADERS([sys/param.h sys/time.h unistd.h])
79 AC_CHECK_HEADERS(errno.h)
83 AC_MSG_NOTICE([typedefs])
94 AC_MSG_NOTICE([compiler characteristics])
99 AC_MSG_NOTICE([library functions])
102 AC_PROG_GCC_TRADITIONAL
104 AC_FUNC_SETVBUF_REVERSED
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(setlinebuf setvbuf)
113 # Set various user-definable options.
115 # Valid OPT settings:
116 # --with-top-part-bitmaps
119 # --with-first-shogi-program=PROGNAME
120 # --with-second-shogi-program=PROGNAME
121 # --with-first-host=HOSTNAME
122 # --with-second-host=HOSTNAME
126 FIRST_SHOGI_PROGRAM=gnushogi
127 SECOND_SHOGI_PROGRAM=gnushogi
129 SECOND_HOST=localhost
131 AC_ARG_ENABLE(xshogi,
133 Compile the xshogi graphical interface to GNU shogi (default: no)],
134 enable_xshogi=$enableval,
137 AC_ARG_WITH(top-part-bitmaps,
138 [ --with-top-part-bitmaps Use top part of Kanji bitmaps only in xshogi.],
139 OPT=-DTOP_PART_BITMAPS)
141 AC_ARG_WITH(first-shogi-program,
142 [ --with-first-shogi-program=PROGNAME
143 Use PROGNAME as the first shogi program in xshogi (default: gnushogi)],
144 FIRST_SHOGI_PROGRAM=$withval)
146 AC_ARG_WITH(second-shogi-program,
147 [ --with-second-shogi-program=PROGNAME
148 Use PROGNAME as the second shogi program in xshogi (default: gnushogi)],
149 SECOND_SHOGI_PROGRAM=$withval)
151 AC_ARG_WITH(first-host,
152 [ --with-first-host=HOSTNAME
153 Use HOSTNAME as the machine on which the first shogi program
154 runs in xshogi (default: localhost)],
157 AC_ARG_WITH(second-host,
158 [ --with-second-host=HOSTNAME
159 Use HOSTNAME as the machine on which the second shogi program
160 runs in xshogi (default: localhost)],
161 SECOND_HOST=$withval)
164 AC_SUBST(FIRST_SHOGI_PROGRAM)
165 AC_SUBST(SECOND_SHOGI_PROGRAM)
167 AC_SUBST(SECOND_HOST)
169 if [[ $enable_xshogi = yes ]]
171 XSHOGI=xshogi_compile
172 XSHOGIINSTALL=xshogi_install
173 XSHOGICLEAN=xshogi_clean
181 AC_SUBST(XSHOGIINSTALL)
182 AC_SUBST(XSHOGICLEAN)
185 AC_CONFIG_FILES([Makefile
187 gnushogi/Makefile.profile