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_SUBST([CURSESDSP], [cursesdsp.o])
41 AC_DEFINE([HAVE_LIBCURSES], [1],
42 [Define if you have lib])
45 [--with-curses was given, but test for curses failed])],
50 AC_CHECK_LIB(termcap, tgoto)
55 # C compiler warnings.
57 if [[ $ac_cv_c_compiler_gnu = yes ]]
59 WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes -ansi -pedantic"
60 CEXTRAFLAGS="-fsigned-char -funroll-loops \$(HASH)"
61 # For profiling targets:
62 CEXTRAFLAGS2="-fsigned-char -pg -fprofile-arcs -ftest-coverage \$(HASH)"
64 # Who knows what warnings your compiler uses?
66 CEXTRAFLAGS="\$(HASH)"
71 AC_SUBST(CEXTRAFLAGS2)
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
105 AC_FUNC_SETVBUF_REVERSED
107 AC_CHECK_FUNCS([dup2 gethostname gettimeofday memset pow strcasecmp])
108 AC_CHECK_FUNCS([strchr strerror strrchr strstr strtol])
109 AC_CHECK_FUNCS(memcpy bcopy)
110 AC_CHECK_FUNCS(setlinebuf setvbuf)
114 # Set various user-definable options.
116 # Valid OPT settings:
117 # --with-top-part-bitmaps
120 # --with-first-shogi-program=PROGNAME
121 # --with-second-shogi-program=PROGNAME
122 # --with-first-host=HOSTNAME
123 # --with-second-host=HOSTNAME
127 FIRST_SHOGI_PROGRAM=gnushogi
128 SECOND_SHOGI_PROGRAM=gnushogi
130 SECOND_HOST=localhost
132 AC_ARG_ENABLE(xshogi,
134 Compile the xshogi graphical interface to GNU shogi (default: no)],
135 enable_xshogi=$enableval,
138 AC_ARG_WITH(top-part-bitmaps,
139 [ --with-top-part-bitmaps Use top part of Kanji bitmaps only in xshogi.],
140 OPT=-DTOP_PART_BITMAPS)
142 AC_ARG_WITH(first-shogi-program,
143 [ --with-first-shogi-program=PROGNAME
144 Use PROGNAME as the first shogi program in xshogi (default: gnushogi)],
145 FIRST_SHOGI_PROGRAM=$withval)
147 AC_ARG_WITH(second-shogi-program,
148 [ --with-second-shogi-program=PROGNAME
149 Use PROGNAME as the second shogi program in xshogi (default: gnushogi)],
150 SECOND_SHOGI_PROGRAM=$withval)
152 AC_ARG_WITH(first-host,
153 [ --with-first-host=HOSTNAME
154 Use HOSTNAME as the machine on which the first shogi program
155 runs in xshogi (default: localhost)],
158 AC_ARG_WITH(second-host,
159 [ --with-second-host=HOSTNAME
160 Use HOSTNAME as the machine on which the second shogi program
161 runs in xshogi (default: localhost)],
162 SECOND_HOST=$withval)
165 AC_SUBST(FIRST_SHOGI_PROGRAM)
166 AC_SUBST(SECOND_SHOGI_PROGRAM)
168 AC_SUBST(SECOND_HOST)
170 if [[ $enable_xshogi = yes ]]
172 XSHOGI=xshogi_compile
173 XSHOGIINSTALL=xshogi_install
174 XSHOGICLEAN=xshogi_clean
182 AC_SUBST(XSHOGIINSTALL)
183 AC_SUBST(XSHOGICLEAN)
186 AC_CONFIG_FILES([Makefile
188 gnushogi/Makefile.profile