1
# ------------------------------------------------------------
2
# GNU shogi and xshogi configuration script.
3
# ------------------------------------------------------------
5
dnl Process this file with autoconf to produce a configure script.
7
AC_INIT(gnushogi/gnushogi.h)
8
AC_CONFIG_HEADER(config.h)
12
# Check for C compiler.
16
AC_MSG_CHECKING(for C compiler)
23
# Check for parser generators.
27
AC_MSG_CHECKING([for yacc/bison, lex/flex, and install])
36
# Check for X windows.
44
# Check for other libraries.
47
AC_CHECK_LIB(curses, clrtoeol)
49
dnl Replace `main' with a function in -ltermcap:
50
AC_CHECK_LIB(termcap, tgoto)
54
# C compiler warnings.
57
if [[ $ac_cv_prog_gcc = yes ]]
59
WARNINGS="-Wall -Wno-implicit-int"
60
CEXTRAFLAGS="-fsigned-char -funroll-loops \$(HASH)"
62
# Who knows what warnings your compiler uses?
64
CEXTRAFLAGS="\$(HASH)"
72
# Check for header files.
76
AC_MSG_CHECKING(for header files)
81
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
82
AC_CHECK_HEADERS(time.h sys/time.h sys/filio.h)
87
# Check for typedefs, structures, and compiler characteristics.
91
AC_MSG_CHECKING(for typedefs)
100
AC_MSG_CHECKING(for compiler characteristics)
103
AC_CHECK_SIZEOF(long)
107
# Check for library functions.
111
AC_MSG_CHECKING(for library functions)
114
AC_FUNC_SETVBUF_REVERSED
116
AC_CHECK_FUNCS(gethostname gettimeofday strstr strtol)
117
AC_CHECK_FUNCS(memcpy bcopy)
118
AC_CHECK_FUNCS(setlinebuf setvbuf)
122
# Set various user-definable options.
124
# Valid OPT settings:
125
# --with-top-part-bitmaps
128
# --with-first-shogi-program=PROGNAME
129
# --with-second-shogi-program=PROGNAME
130
# --with-first-host=HOSTNAME
131
# --with-second-host=HOSTNAME
135
FIRST_SHOGI_PROGRAM=gnushogi
136
SECOND_SHOGI_PROGRAM=gnushogi
138
SECOND_HOST=localhost
140
AC_ARG_WITH(top-part-bitmaps,
141
[ --with-top-part-bitmaps Use top part of Kanji bitmaps only.],
142
OPT=-DTOP_PART_BITMAPS)
144
AC_ARG_WITH(first-shogi-program,
145
[ --with-first-shogi-program=PROGNAME
146
Use PROGNAME as the first shogi program (default: gnushogi)],
147
FIRST_SHOGI_PROGRAM=$withval)
149
AC_ARG_WITH(second-shogi-program,
150
[ --with-second-shogi-program=PROGNAME
151
Use PROGNAME as the second shogi program (default: gnushogi)],
152
SECOND_SHOGI_PROGRAM=$withval)
154
AC_ARG_WITH(first-host,
155
[ --with-first-host=HOSTNAME
156
Use HOSTNAME as the machine on which the first shogi program
157
runs (default: localhost)],
160
AC_ARG_WITH(second-host,
161
[ --with-second-host=HOSTNAME
162
Use HOSTNAME as the machine on which the second shogi program
163
runs (default: localhost)],
164
SECOND_HOST=$withval)
168
Compile the xshogi graphical interface to GNU shogi (default: yes)],
169
with_xshogi=$withval,
173
AC_SUBST(FIRST_SHOGI_PROGRAM)
174
AC_SUBST(SECOND_SHOGI_PROGRAM)
176
AC_SUBST(SECOND_HOST)
178
if [[ $with_xshogi = yes ]]
180
XSHOGI=xshogi_compile
181
XSHOGIINSTALL=xshogi_install
182
XSHOGICLEAN=xshogi_clean
190
AC_SUBST(XSHOGIINSTALL)
191
AC_SUBST(XSHOGICLEAN)
195
echo outputting files...
197
AC_OUTPUT(Makefile gnushogi/Makefile xshogi/Makefile)