Clarify configure options that only relate to xshogi
[gnushogi.git] / configure.ac
blob00a824b6f2fdf51c03061e26acdd9ca0b027a2ef
1 # ------------------------------------------------------------
2 # GNU shogi and xshogi configuration script.
3 # ------------------------------------------------------------
5 dnl Process this file with autoconf to produce a configure script.
7 AC_PREREQ(2.57)
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.
17 echo
18 AC_MSG_CHECKING(for C compiler)
19 echo
21 AC_PROG_CC
25 # Check for parser generators.
28 echo
29 AC_MSG_CHECKING([for yacc/bison, lex/flex, and install])
30 echo
32 AC_PROG_YACC
33 AC_PROG_LEX
34 AC_PROG_INSTALL
38 # Check for X windows.
41 echo
42 AC_PATH_XTRA
46 # Check for other libraries.
49 AC_CHECK_LIB(curses, clrtoeol)
50 AC_CHECK_LIB(m, pow)
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 ]]
60 then
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)"
65 else
66 # Who knows what warnings your compiler uses?
67 WARNINGS=
68 CEXTRAFLAGS="\$(HASH)"
71 AC_SUBST(WARNINGS)
72 AC_SUBST(CEXTRAFLAGS)
73 AC_SUBST(CEXTRAFLAGS2)
77 # Check for header files.
80 echo
81 AC_MSG_CHECKING(for header files)
82 echo
84 AC_HEADER_STDC
85 AC_HEADER_SYS_WAIT
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)
89 AC_HEADER_TIME
93 # Check for typedefs, structures, and compiler characteristics.
96 echo 
97 AC_MSG_CHECKING(for typedefs)
98 echo
100 AC_C_CONST
101 AC_HEADER_STDBOOL
102 AC_C_INLINE
103 AC_TYPE_PID_T
104 AC_TYPE_SIZE_T
105 AC_HEADER_TIME
106 AC_STRUCT_TM
108 echo 
109 AC_MSG_CHECKING(for compiler characteristics)
110 echo
112 AC_CHECK_SIZEOF(long)
116 # Check for library functions.
119 echo
120 AC_MSG_CHECKING(for library functions)
121 echo
123 AC_FUNC_FORK
124 AC_PROG_GCC_TRADITIONAL
125 AC_FUNC_MALLOC
126 AC_FUNC_SETVBUF_REVERSED
127 AC_TYPE_SIGNAL
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
140 # Other settings:
141 # --with-first-shogi-program=PROGNAME
142 # --with-second-shogi-program=PROGNAME
143 # --with-first-host=HOSTNAME
144 # --with-second-host=HOSTNAME
147 OPT=
148 FIRST_SHOGI_PROGRAM=gnushogi
149 SECOND_SHOGI_PROGRAM=gnushogi
150 FIRST_HOST=localhost
151 SECOND_HOST=localhost
153 AC_ARG_WITH(xshogi,
154 [  --with-xshogi
155         Compile the xshogi graphical interface to GNU shogi (default: no)],
156 with_xshogi=$withval,
157 with_xshogi=no)
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)],
177 FIRST_HOST=$withval)
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)
185 AC_SUBST(OPT)
186 AC_SUBST(FIRST_SHOGI_PROGRAM)
187 AC_SUBST(SECOND_SHOGI_PROGRAM)
188 AC_SUBST(FIRST_HOST)
189 AC_SUBST(SECOND_HOST)
191 if [[ $with_xshogi = yes ]]
192 then
193 XSHOGI=xshogi_compile
194 XSHOGIINSTALL=xshogi_install
195 XSHOGICLEAN=xshogi_clean
196 else
197 XSHOGI=
198 XSHOGIINSTALL=
199 XSHOGICLEAN=
202 AC_SUBST(XSHOGI)
203 AC_SUBST(XSHOGIINSTALL)
204 AC_SUBST(XSHOGICLEAN)
207 echo
208 echo outputting files...
210 AC_CONFIG_FILES([Makefile
211                  gnushogi/Makefile
212                                  gnushogi/Makefile.profile
213                  xshogi/Makefile])
214 AC_OUTPUT