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.3.2],[mvanier@cs.caltech.edu])
9 AC_CONFIG_SRCDIR([version.h])
10 AC_CONFIG_HEADER(config.h)
14 # Check for C compiler.
18 AC_MSG_CHECKING(for C compiler)
25 # Check for parser generators.
29 AC_MSG_CHECKING([for yacc/bison, lex/flex, and install])
38 # Check for X windows.
46 # Check for other libraries.
49 AC_CHECK_LIB(curses, clrtoeol)
51 dnl Replace `main' with a function in -ltermcap:
52 AC_CHECK_LIB(termcap, tgoto)
56 # C compiler warnings.
59 if [[ $ac_cv_c_compiler_gnu = yes ]]
61 WARNINGS="-Wall -Wno-implicit-int -Wstrict-prototypes -ansi -pedantic"
62 CEXTRAFLAGS="-fsigned-char -funroll-loops \$(HASH)"
63 # For profiling targets:
64 CEXTRAFLAGS2="-fsigned-char -pg -fprofile-arcs -ftest-coverage \$(HASH)"
66 # Who knows what warnings your compiler uses?
68 CEXTRAFLAGS="\$(HASH)"
73 AC_SUBST(CEXTRAFLAGS2)
77 # Check for header files.
81 AC_MSG_CHECKING(for header files)
86 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/file.h sys/ioctl.h])
87 AC_CHECK_HEADERS([sys/param.h sys/time.h unistd.h])
88 AC_CHECK_HEADERS(errno.h)
93 # Check for typedefs, structures, and compiler characteristics.
97 AC_MSG_CHECKING(for typedefs)
109 AC_MSG_CHECKING(for compiler characteristics)
112 AC_CHECK_SIZEOF(long)
116 # Check for library functions.
120 AC_MSG_CHECKING(for library functions)
124 AC_PROG_GCC_TRADITIONAL
126 AC_FUNC_SETVBUF_REVERSED
128 AC_CHECK_FUNCS([dup2 gethostname gettimeofday memset pow strcasecmp])
129 AC_CHECK_FUNCS([strchr strerror strrchr strstr strtol])
130 AC_CHECK_FUNCS(memcpy bcopy)
131 AC_CHECK_FUNCS(setlinebuf setvbuf)
135 # Set various user-definable options.
137 # Valid OPT settings:
138 # --with-top-part-bitmaps
141 # --with-first-shogi-program=PROGNAME
142 # --with-second-shogi-program=PROGNAME
143 # --with-first-host=HOSTNAME
144 # --with-second-host=HOSTNAME
148 FIRST_SHOGI_PROGRAM=gnushogi
149 SECOND_SHOGI_PROGRAM=gnushogi
151 SECOND_HOST=localhost
155 Compile the xshogi graphical interface to GNU shogi (default: no)],
156 with_xshogi=$withval,
159 AC_ARG_WITH(top-part-bitmaps,
160 [ --with-top-part-bitmaps Use top part of Kanji bitmaps only in xshogi.],
161 OPT=-DTOP_PART_BITMAPS)
163 AC_ARG_WITH(first-shogi-program,
164 [ --with-first-shogi-program=PROGNAME
165 Use PROGNAME as the first shogi program in xshogi (default: gnushogi)],
166 FIRST_SHOGI_PROGRAM=$withval)
168 AC_ARG_WITH(second-shogi-program,
169 [ --with-second-shogi-program=PROGNAME
170 Use PROGNAME as the second shogi program in xshogi(default: gnushogi)],
171 SECOND_SHOGI_PROGRAM=$withval)
173 AC_ARG_WITH(first-host,
174 [ --with-first-host=HOSTNAME
175 Use HOSTNAME as the machine on which the first shogi program
176 runs in xshogi (default: localhost)],
179 AC_ARG_WITH(second-host,
180 [ --with-second-host=HOSTNAME
181 Use HOSTNAME as the machine on which the second shogi program
182 runs in xshogi (default: localhost)],
183 SECOND_HOST=$withval)
186 AC_SUBST(FIRST_SHOGI_PROGRAM)
187 AC_SUBST(SECOND_SHOGI_PROGRAM)
189 AC_SUBST(SECOND_HOST)
191 if [[ $with_xshogi = yes ]]
193 XSHOGI=xshogi_compile
194 XSHOGIINSTALL=xshogi_install
195 XSHOGICLEAN=xshogi_clean
203 AC_SUBST(XSHOGIINSTALL)
204 AC_SUBST(XSHOGICLEAN)
208 echo outputting files...
210 AC_CONFIG_FILES([Makefile
212 gnushogi/Makefile.profile