1 | # Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT([advance],[source]) |
---|
3 | AC_CONFIG_HEADERS([advance/lib/config.h:advance/lib/config.hin]) |
---|
4 | AC_CANONICAL_HOST |
---|
5 | AC_PREREQ(2.57) |
---|
6 | AC_COPYRIGHT([Copyright 2005 Andrea Mazzoleni]) |
---|
7 | |
---|
8 | # Checks for system. |
---|
9 | case "$host" in |
---|
10 | *-*-linux*) |
---|
11 | ac_system=unix |
---|
12 | ac_host=linux |
---|
13 | ac_host_cflags= |
---|
14 | ac_host_ldflags= |
---|
15 | AC_SUBST([ASMFLAGS],["-f elf"]) |
---|
16 | AC_SUBST([CFLAGS_FOR_BUILD],["-O0 -DUSE_COMPILER_GNUC -DUSE_OBJ_ELF -DUSE_OS_UNIX"]) |
---|
17 | AC_SUBST([EXE],[]) |
---|
18 | ;; |
---|
19 | *-*-darwin*) |
---|
20 | ac_system=unix |
---|
21 | ac_host=darwin |
---|
22 | ac_host_cflags=-no-cpp-precomp |
---|
23 | ac_host_ldflags= |
---|
24 | AC_SUBST([ASMFLAGS],[""]) |
---|
25 | AC_SUBST([CFLAGS_FOR_BUILD],["-O0"]) |
---|
26 | AC_SUBST([EXE],[]) |
---|
27 | ;; |
---|
28 | *-*-cygwin* | *-*-mingw32*) |
---|
29 | ac_system=windows |
---|
30 | ac_host=windows |
---|
31 | ac_host_cflags= |
---|
32 | ac_host_ldflags= |
---|
33 | AC_SUBST([ASMFLAGS],["-f coff"]) |
---|
34 | AC_SUBST([CFLAGS_FOR_BUILD],["-O0 -DUSE_COMPILER_GNUC -DUSE_OBJ_COFF -DUSE_OS_WINDOWS"]) |
---|
35 | AC_SUBST([EXE],[.exe]) |
---|
36 | ;; |
---|
37 | *-*-msdos*) |
---|
38 | ac_system=dos |
---|
39 | ac_host=dos |
---|
40 | ac_host_cflags= |
---|
41 | ac_host_ldflags= |
---|
42 | AC_SUBST([ASMFLAGS],["-f coff"]) |
---|
43 | AC_SUBST([CFLAGS_FOR_BUILD],["-O0 -DUSE_COMPILER_GNUC -DUSE_OBJ_COFF -DUSE_OS_DOS"]) |
---|
44 | AC_SUBST([EXE],[.exe]) |
---|
45 | ;; |
---|
46 | *) |
---|
47 | ac_system=unix |
---|
48 | ac_host=generic |
---|
49 | ac_host_cflags= |
---|
50 | ac_host_ldflags= |
---|
51 | AC_SUBST([ASMFLAGS],[""]) |
---|
52 | AC_SUBST([CFLAGS_FOR_BUILD],["-O0"]) |
---|
53 | AC_SUBST([EXE],[]) |
---|
54 | ;; |
---|
55 | esac |
---|
56 | AC_SUBST([CONF_SYSTEM],[$ac_system]) |
---|
57 | AC_SUBST([CONF_HOST],[$ac_host]) |
---|
58 | |
---|
59 | case "$build" in |
---|
60 | *-*-linux*) |
---|
61 | ac_build=linux |
---|
62 | AC_SUBST([EXE_FOR_BUILD],[]) |
---|
63 | ;; |
---|
64 | *-*-darwin*) |
---|
65 | ac_build=darwin |
---|
66 | AC_SUBST([EXE_FOR_BUILD],[]) |
---|
67 | ;; |
---|
68 | *-*-cygwin* | *-*-mingw32*) |
---|
69 | ac_build=windows |
---|
70 | AC_SUBST([EXE_FOR_BUILD],[.exe]) |
---|
71 | ;; |
---|
72 | *-*-msdos*) |
---|
73 | ac_build=dos |
---|
74 | AC_SUBST([EXE_FOR_BUILD],[.exe]) |
---|
75 | ;; |
---|
76 | *) |
---|
77 | ac_build=unix |
---|
78 | AC_SUBST([EXE_FOR_BUILD],[]) |
---|
79 | ;; |
---|
80 | esac |
---|
81 | AC_SUBST([CONF_BUILD],[$ac_build]) |
---|
82 | |
---|
83 | if test -z "$CFLAGS" ; then |
---|
84 | ac_auto_cflags=yes |
---|
85 | else |
---|
86 | ac_auto_cflags=no |
---|
87 | fi |
---|
88 | if test -z "$LDFLAGS" ; then |
---|
89 | ac_auto_ldflags=yes |
---|
90 | else |
---|
91 | ac_auto_ldflags=no |
---|
92 | fi |
---|
93 | |
---|
94 | # Checks for programs. |
---|
95 | AC_PROG_CC |
---|
96 | AC_PROG_CXX |
---|
97 | AC_PROG_INSTALL |
---|
98 | AC_PROG_LN_S |
---|
99 | AC_CHECK_TOOLS(AR, ar) |
---|
100 | AC_CHECK_TOOLS(RC, windres) |
---|
101 | AC_CHECK_PROGS(RM, rm) |
---|
102 | AC_CHECK_PROGS(CP, cp) |
---|
103 | AC_CHECK_PROGS(MKDIR, mkdir) |
---|
104 | AC_CHECK_PROGS(ECHO, echo) |
---|
105 | AC_CHECK_PROGS(TAR, tar) |
---|
106 | AC_CHECK_PROGS(GZIP, gzip) |
---|
107 | AC_CHECK_PROGS(ZIP, zip) |
---|
108 | |
---|
109 | if test "x$cross_compiling" = "xyes"; then |
---|
110 | # if cross compiling autodetect the system compilers |
---|
111 | AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) |
---|
112 | AC_CHECK_PROGS(CXX_FOR_BUILD, g++ gxx c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC) |
---|
113 | else |
---|
114 | #if not cross compiling use the already detected compilers |
---|
115 | CC_FOR_BUILD=$CC |
---|
116 | CXX_FOR_BUILD=$CXX |
---|
117 | AC_SUBST(CC_FOR_BUILD) |
---|
118 | AC_SUBST(CXX_FOR_BUILD) |
---|
119 | fi |
---|
120 | |
---|
121 | # Checks for optimizations |
---|
122 | AC_ARG_ENABLE( |
---|
123 | [debug], |
---|
124 | AC_HELP_STRING([--enable-debug],[enable the test compilation without optimization and with debug info. Only for developers. (default no)]), |
---|
125 | [ac_enable_debug=$enableval], |
---|
126 | [ac_enable_debug=no] |
---|
127 | ) |
---|
128 | AC_SUBST([CONF_DEBUG],[$ac_enable_debug]) |
---|
129 | |
---|
130 | AC_ARG_ENABLE( |
---|
131 | [test], |
---|
132 | AC_HELP_STRING([--enable-test],[enable the test compilation without optimization. Only for developers. (default no)]), |
---|
133 | [ac_enable_test=$enableval], |
---|
134 | [ac_enable_test=no] |
---|
135 | ) |
---|
136 | |
---|
137 | AC_ARG_ENABLE( |
---|
138 | [static], |
---|
139 | AC_HELP_STRING([--enable-static],[enable static compilation. (default no)]), |
---|
140 | [ac_enable_static=$enableval], |
---|
141 | [ac_enable_static=no] |
---|
142 | ) |
---|
143 | |
---|
144 | if test $ac_auto_cflags = yes; then |
---|
145 | if test $ac_enable_debug = yes ; then |
---|
146 | CFLAGS="-O0 -g -Wall -Wno-sign-compare -Wno-unused" |
---|
147 | elif test $ac_enable_test = yes ; then |
---|
148 | CFLAGS="-O0 -Wall -Wno-sign-compare -Wno-unused" |
---|
149 | else |
---|
150 | CFLAGS="" |
---|
151 | AC_CHECK_CPU_ARCH |
---|
152 | AC_CHECK_CC_ARCH |
---|
153 | if test ! $ac_cc_arch = blend; then |
---|
154 | CFLAGS="$CFLAGS -march=$ac_cc_arch " |
---|
155 | AC_CHECK_CC_OPT([-fomit-frame-pointer], [CFLAGS="$CFLAGS -fomit-frame-pointer"], []) |
---|
156 | fi |
---|
157 | # -O3 don't seem to be safe on x86 platforms, also on latest gcc 3.3.x |
---|
158 | AC_CHECK_CC_OPT([-O2], [CFLAGS="$CFLAGS -O2"], [CFLAGS="$CFLAGS -O"]) |
---|
159 | # -fno-merge-constants is required to speedup the link time. ld spends a lot of time trying to merge partial strings. |
---|
160 | AC_CHECK_CC_OPT([-fno-merge-constants], [CFLAGS="$CFLAGS -fno-merge-constants"], []) |
---|
161 | AC_CHECK_CC_OPT([-Wall], [CFLAGS="$CFLAGS -Wall"], []) |
---|
162 | AC_CHECK_CC_OPT([-Wno-sign-compare], [CFLAGS="$CFLAGS -Wno-sign-compare"], []) |
---|
163 | AC_CHECK_CC_OPT([-Wno-unused], [CFLAGS="$CFLAGS -Wno-unused"], []) |
---|
164 | fi |
---|
165 | if test ! -z $ac_host_cflags; then |
---|
166 | CFLAGS="$ac_host_cflags $CFLAGS" |
---|
167 | fi |
---|
168 | fi |
---|
169 | if test $ac_auto_ldflags = yes ; then |
---|
170 | if test $ac_enable_debug = yes ; then |
---|
171 | if test $ac_system = unix ; then |
---|
172 | LDFLAGS="-rdynamic" |
---|
173 | else |
---|
174 | LDFLAGS="-g" |
---|
175 | fi |
---|
176 | else |
---|
177 | LDFLAGS="-s" |
---|
178 | fi |
---|
179 | if test $ac_enable_static = yes ; then |
---|
180 | LDFLAGS="-static $LDFLAGS" |
---|
181 | fi |
---|
182 | if test ! -z $ac_host_ldflags; then |
---|
183 | LDFLAGS="$ac_host_ldflags $LDFLAGS" |
---|
184 | fi |
---|
185 | fi |
---|
186 | |
---|
187 | AC_SUBST([CONF_CFLAGS_OPT],[$CFLAGS]) |
---|
188 | AC_SUBST([CONF_LDFLAGS],[$LDFLAGS]) |
---|
189 | |
---|
190 | # Checks for architecture |
---|
191 | AC_C_BIGENDIAN( |
---|
192 | [ac_is_bigendian=yes], |
---|
193 | [ac_is_bigendian=no] |
---|
194 | ) |
---|
195 | if test $ac_is_bigendian = yes; then |
---|
196 | CFLAGS_ARCH="$CFLAGS_ARCH -DUSE_MSB" |
---|
197 | else |
---|
198 | CFLAGS_ARCH="$CFLAGS_ARCH -DUSE_LSB" |
---|
199 | fi |
---|
200 | |
---|
201 | AC_CHECK_SIZEOF(char) |
---|
202 | AC_CHECK_SIZEOF(short) |
---|
203 | AC_CHECK_SIZEOF(int) |
---|
204 | AC_CHECK_SIZEOF(long) |
---|
205 | AC_CHECK_SIZEOF(long long) |
---|
206 | AC_CHECK_SIZEOF(void*) |
---|
207 | |
---|
208 | AC_ARG_ENABLE( |
---|
209 | [backtrace], |
---|
210 | AC_HELP_STRING([--enable-backtrace],[enable the usage of backtrace (default auto)]), |
---|
211 | [ac_enable_backtrace=$enableleval], |
---|
212 | [ac_enable_backtrace=auto] |
---|
213 | ) |
---|
214 | AC_ARG_ENABLE( |
---|
215 | [ucontexth], |
---|
216 | AC_HELP_STRING([--enable-ucontexth],[enable the usage of ucontext.h (default auto)]), |
---|
217 | [ac_enable_ucontexth=$enableleval], |
---|
218 | [ac_enable_ucontexth=auto] |
---|
219 | ) |
---|
220 | AC_ARG_ENABLE( |
---|
221 | [asm], |
---|
222 | AC_HELP_STRING([--enable-asm],[enable the Pentium assembler optimizations (default auto)]), |
---|
223 | [ac_enable_asm=$enableval], |
---|
224 | [ac_enable_asm=auto] |
---|
225 | ) |
---|
226 | if test $ac_enable_asm = auto; then |
---|
227 | AC_MSG_CHECKING([whether ${CC-cc} accepts Pentium assembler]) |
---|
228 | AC_TRY_COMPILE([ |
---|
229 | ], [ |
---|
230 | #if !defined(__GNUC__) || !defined(__i386__) |
---|
231 | choke me |
---|
232 | #endif |
---|
233 | ],[ac_enable_asm=yes],[ac_enable_asm=no]) |
---|
234 | AC_MSG_RESULT([$ac_enable_asm]) |
---|
235 | if test $ac_enable_asm = yes; then |
---|
236 | AC_CHECK_PROGS([ASM], [${ac_tool_prefix}nasm], [none]) |
---|
237 | if test $ASM = none; then |
---|
238 | ac_enable_asm=no |
---|
239 | else |
---|
240 | CFLAGS_ARCH="$CFLAGS_ARCH -DUSE_ASM_INLINE" |
---|
241 | fi |
---|
242 | fi |
---|
243 | elif test $ac_enable_asm = yes; then |
---|
244 | AC_CHECK_PROGS([ASM], [${ac_tool_prefix}nasm], [none]) |
---|
245 | if test $ASM = none; then |
---|
246 | AC_MSG_ERROR([the NASM assembler is required for the "asm" compilation]) |
---|
247 | else |
---|
248 | CFLAGS_ARCH="$CFLAGS_ARCH -DUSE_ASM_INLINE" |
---|
249 | fi |
---|
250 | fi |
---|
251 | |
---|
252 | AC_ARG_ENABLE( |
---|
253 | [asm-mips3], |
---|
254 | AC_HELP_STRING([--enable-asm-mips3],[enable the Pentium assembler MIPS3 emulator (default auto)]), |
---|
255 | [ac_enable_asm_mips3=$enableval], |
---|
256 | [ac_enable_asm_mips3=auto] |
---|
257 | ) |
---|
258 | if test $ac_enable_asm_mips3 = auto; then |
---|
259 | if test $ac_enable_asm = yes; then |
---|
260 | ac_enable_asm_mips3=yes |
---|
261 | else |
---|
262 | ac_enable_asm_mips3=no |
---|
263 | fi |
---|
264 | fi |
---|
265 | if test $ac_enable_asm_mips3 = yes; then |
---|
266 | if test ! $ac_enable_asm = yes; then |
---|
267 | AC_MSG_ERROR([the Pentium assembler is required for the "asm-mips3" compilation]) |
---|
268 | fi |
---|
269 | CFLAGS_ARCH="$CFLAGS_ARCH -DUSE_ASM_EMUMIPS3" |
---|
270 | fi |
---|
271 | |
---|
272 | AC_SUBST([CONF_CFLAGS_ARCH],[$CFLAGS_ARCH]) |
---|
273 | |
---|
274 | # Checks for configuration options. |
---|
275 | AC_ARG_WITH( |
---|
276 | [emu], |
---|
277 | AC_HELP_STRING([--with-emu],[select the emulator to use: mame, mess, none (default auto)]), |
---|
278 | [ac_with_emu=$withval], |
---|
279 | [ac_with_emu=auto] |
---|
280 | ) |
---|
281 | if test $ac_with_emu = auto; then |
---|
282 | if test -f $srcdir/advance/advmame.dif ; then |
---|
283 | ac_with_emu=mame |
---|
284 | elif test -f $srcdir/advance/advmess.dif ; then |
---|
285 | ac_with_emu=mess |
---|
286 | else |
---|
287 | ac_with_emu=none |
---|
288 | fi |
---|
289 | fi |
---|
290 | if test $ac_with_emu = mame; then |
---|
291 | if test ! -f $srcdir/src/mame.mak ; then |
---|
292 | AC_MSG_ERROR([you need the MAME source in the $srcdir/src/ directory. Check the BUILD file for instructions.]) |
---|
293 | fi |
---|
294 | if test ! -f $srcdir/src/advance.pat ; then |
---|
295 | AC_MSG_ERROR([you must patch the MAME source in $srcdir/src/ with the $srcdir/advance/advmame.dif patch. Check the BUILD file for instructions.]) |
---|
296 | fi |
---|
297 | elif test $ac_with_emu = mess; then |
---|
298 | if test ! -f $srcdir/srcmess/core.mak ; then |
---|
299 | AC_MSG_ERROR([you need the MESS source in the $srcdir/srcmess/ directory. Check the BUILD file for instructions.]) |
---|
300 | fi |
---|
301 | if test ! -f $srcdir/mess/mess.mak ; then |
---|
302 | AC_MSG_ERROR([you need the MESS source in the $srcdir/mess/ directory. Check the BUILD file for instructions.]) |
---|
303 | fi |
---|
304 | if test ! -f $srcdir/srcmess/advance.pat ; then |
---|
305 | AC_MSG_ERROR([you must patch the MESS source in $srcdir/srcmess/ with the advance/advmess.dif patch. Check the BUILD file for instructions.]) |
---|
306 | fi |
---|
307 | if test ! -f $srcdir/mess/advance.pat ; then |
---|
308 | AC_MSG_ERROR([you must patch the MESS source in $srcdir/mess/ with the advance/mess.dif patch. Check the BUILD file for instructions.]) |
---|
309 | fi |
---|
310 | elif test ! $ac_with_emu = none; then |
---|
311 | AC_MSG_ERROR([unknown emulator $ac_with_emu]) |
---|
312 | fi |
---|
313 | AC_SUBST(CONF_EMU,$ac_with_emu) |
---|
314 | |
---|
315 | AC_ARG_ENABLE( |
---|
316 | [debugger], |
---|
317 | AC_HELP_STRING([--enable-debugger],[enable the emulator debugger (default no)]), |
---|
318 | [ac_enable_debugger=$enableval], |
---|
319 | [ac_enable_debugger=no] |
---|
320 | ) |
---|
321 | AC_SUBST([CONF_DEBUGGER],[$ac_enable_debugger]) |
---|
322 | |
---|
323 | # Checks for header files. |
---|
324 | # Checks for typedefs, structures, and compiler characteristics. |
---|
325 | # Checks for library functions. |
---|
326 | |
---|
327 | if test $ac_system = unix ; then |
---|
328 | AC_HEADER_STDC |
---|
329 | AC_HEADER_SYS_WAIT |
---|
330 | AC_HEADER_DIRENT |
---|
331 | AC_HEADER_TIME |
---|
332 | AC_HEADER_TIOCGWINSZ |
---|
333 | AC_CHECK_HEADERS([unistd.h sched.h netdb.h termios.h execinfo.h]) |
---|
334 | AC_CHECK_HEADERS([sys/utsname.h sys/types.h sys/stat.h sys/socket.h sys/select.h sys/ioctl.h sys/time.h sys/mman.h sys/io.h sys/kd.h sys/vt.h]) |
---|
335 | AC_CHECK_HEADERS([netinet/in.h]) |
---|
336 | if test $ac_enable_ucontexth = auto; then |
---|
337 | AC_CHECK_HEADERS([ucontext.h]) |
---|
338 | fi |
---|
339 | AC_C_CONST |
---|
340 | AC_C_RESTRICT |
---|
341 | AC_C_INLINE |
---|
342 | AC_FUNC_ALLOCA |
---|
343 | AC_FUNC_MMAP |
---|
344 | AC_FUNC_SELECT_ARGTYPES |
---|
345 | AC_FUNC_VPRINTF |
---|
346 | AC_CHECK_FUNCS([strcasecmp strerror]) |
---|
347 | if test $ac_enable_backtrace = auto; then |
---|
348 | AC_CHECK_FUNCS([backtrace backtrace_symbols]) |
---|
349 | fi |
---|
350 | AC_CHECK_FUNCS([uname sysconf]) |
---|
351 | AC_CHECK_FUNCS([flockfile funlockfile fread_unlocked fwrite_unlocked fgetc_unlocked feof_unlocked]) |
---|
352 | AC_CHECK_FUNCS([iopl mprotect]) |
---|
353 | AC_MSG_CHECKING([for port in/out]) |
---|
354 | AC_TRY_LINK([ |
---|
355 | #include <sys/io.h> |
---|
356 | ], [ |
---|
357 | outb(0x80, inb(0x80)); |
---|
358 | ],[ac_func_inout=yes],[ac_func_inout=no]) |
---|
359 | AC_MSG_RESULT([$ac_func_inout]) |
---|
360 | if test $ac_func_inout = yes; then |
---|
361 | AC_DEFINE([HAVE_INOUT],[1],[Define to 1 if you have the `inb' and `outb' functions.]) |
---|
362 | fi |
---|
363 | fi |
---|
364 | |
---|
365 | # Checks for libraries. |
---|
366 | |
---|
367 | ac_lib_direct_flag=no |
---|
368 | ac_lib_video_flag=no |
---|
369 | ac_lib_text_flag=no |
---|
370 | ac_lib_sound_flag=no |
---|
371 | ac_lib_keyboard_flag=no |
---|
372 | |
---|
373 | if test $ac_system = dos; then |
---|
374 | ac_lib_video="$ac_lib_video svgaline vbeline vgaline vbe" |
---|
375 | ac_lib_sound="$ac_lib_sound seal vsync allegro" |
---|
376 | ac_lib_keyboard="$ac_lib_keyboard allegro" |
---|
377 | ac_lib_joystick="$ac_lib_joystick allegro" |
---|
378 | ac_lib_mouse="$ac_lib_mouse allegro" |
---|
379 | ac_lib_direct_flag=yes |
---|
380 | ac_lib_video_flag=yes |
---|
381 | ac_lib_sound_flag=yes |
---|
382 | ac_lib_keyboard_flag=yes |
---|
383 | ac_lib_text_flag=yes |
---|
384 | fi |
---|
385 | |
---|
386 | if test $ac_system = windows; then |
---|
387 | ac_lib_text_flag=yes |
---|
388 | fi |
---|
389 | |
---|
390 | # Checks for zlib |
---|
391 | AC_ARG_ENABLE( |
---|
392 | [zlib], |
---|
393 | AC_HELP_STRING([--enable-zlib],[enable the use of the zlib library. (default auto)]), |
---|
394 | [ac_lib_zlib=$enableval], |
---|
395 | [ac_lib_zlib=auto] |
---|
396 | ) |
---|
397 | if test $ac_lib_zlib = auto; then |
---|
398 | AC_CHECK_LIB( |
---|
399 | [z], |
---|
400 | [adler32], |
---|
401 | [ac_lib_zlib=yes], |
---|
402 | [ac_lib_zlib=no] |
---|
403 | ) |
---|
404 | fi |
---|
405 | if test $ac_lib_zlib = yes; then |
---|
406 | ac_lib_other="$ac_lib_other zlib" |
---|
407 | else |
---|
408 | ac_lib_other="$ac_lib_other zlib(internal)" |
---|
409 | fi |
---|
410 | AC_SUBST([CONF_LIB_ZLIB],[$ac_lib_zlib]) |
---|
411 | |
---|
412 | # Checks for expat |
---|
413 | AC_ARG_ENABLE( |
---|
414 | [expat], |
---|
415 | AC_HELP_STRING([--enable-expat],[enable the use of the expat library. (default auto)]), |
---|
416 | [ac_lib_expat=$enableval], |
---|
417 | [ac_lib_expat=auto] |
---|
418 | ) |
---|
419 | if test $ac_lib_expat = auto; then |
---|
420 | AC_CHECK_LIB( |
---|
421 | [expat], |
---|
422 | [XML_ParserCreate], |
---|
423 | [ac_lib_expat=yes], |
---|
424 | [ac_lib_expat=no] |
---|
425 | ) |
---|
426 | fi |
---|
427 | if test $ac_lib_expat = yes; then |
---|
428 | ac_lib_other="$ac_lib_other expat" |
---|
429 | else |
---|
430 | ac_lib_other="$ac_lib_other expat(internal)" |
---|
431 | fi |
---|
432 | AC_SUBST([CONF_LIB_EXPAT],[$ac_lib_expat]) |
---|
433 | |
---|
434 | # Checks for svgalib |
---|
435 | AC_ARG_ENABLE( |
---|
436 | [svgalib], |
---|
437 | AC_HELP_STRING([--enable-svgalib],[enable the use of the SVGALIB library. (default auto)]), |
---|
438 | [ac_lib_svgalib=$enableval], |
---|
439 | [ac_lib_svgalib=auto] |
---|
440 | ) |
---|
441 | if test $ac_lib_svgalib = auto; then |
---|
442 | AC_CHECK_LIB( |
---|
443 | [vga], |
---|
444 | [vga_init], |
---|
445 | [ac_lib_svgalib=yes], |
---|
446 | [ac_lib_svgalib=no], |
---|
447 | [-lm] |
---|
448 | ) |
---|
449 | if test $ac_lib_svgalib = yes; then |
---|
450 | AC_MSG_CHECKING([for svgalib version]) |
---|
451 | AC_TRY_COMPILE([ |
---|
452 | #include <vga.h> |
---|
453 | ], [ |
---|
454 | #if !defined(SVGALIB_VER) || (SVGALIB_VER<0x010900) |
---|
455 | choke me |
---|
456 | #endif |
---|
457 | ],[ac_lib_svgalib=yes],[ac_lib_svgalib=no]) |
---|
458 | AC_MSG_RESULT([$ac_lib_svgalib]) |
---|
459 | fi |
---|
460 | elif test $ac_lib_svgalib = yes; then |
---|
461 | AC_CHECK_LIB( |
---|
462 | [vga], |
---|
463 | [vga_init], |
---|
464 | [], |
---|
465 | [AC_MSG_ERROR([the SVGALIB library is missing])], |
---|
466 | [-lm] |
---|
467 | ) |
---|
468 | AC_MSG_CHECKING([for svgalib version]) |
---|
469 | AC_TRY_COMPILE([ |
---|
470 | #include <vga.h> |
---|
471 | ], [ |
---|
472 | #if !defined(SVGALIB_VER) || (SVGALIB_VER<0x010900) |
---|
473 | choke me |
---|
474 | #endif |
---|
475 | ],[],[AC_MSG_ERROR([the SVGALIB library is too old. Please upgrade to the 1.9 or 2.0 version])]) |
---|
476 | AC_MSG_RESULT([yes]) |
---|
477 | fi |
---|
478 | if test $ac_lib_svgalib = yes; then |
---|
479 | ac_lib_video="$ac_lib_video svgalib" |
---|
480 | ac_lib_keyboard="$ac_lib_keyboard svgalib" |
---|
481 | ac_lib_mouse="$ac_lib_mouse svgalib" |
---|
482 | ac_lib_joystick="$ac_lib_joystick svgalib" |
---|
483 | ac_lib_direct_flag=yes |
---|
484 | ac_lib_video_flag=yes |
---|
485 | ac_lib_keyboard_flag=yes |
---|
486 | fi |
---|
487 | AC_SUBST([CONF_LIB_SVGALIB],[$ac_lib_svgalib]) |
---|
488 | |
---|
489 | # Checks for fb |
---|
490 | AC_ARG_ENABLE( |
---|
491 | [fb], |
---|
492 | AC_HELP_STRING([--enable-fb],[enable the use of the Frame Buffer library. (default auto)]), |
---|
493 | [ac_lib_fb=$enableval], |
---|
494 | [ac_lib_fb=auto] |
---|
495 | ) |
---|
496 | if test $ac_lib_fb = auto; then |
---|
497 | AC_MSG_CHECKING([for FrameBuffer]) |
---|
498 | AC_TRY_COMPILE([ |
---|
499 | #include <linux/fb.h> |
---|
500 | ], [ |
---|
501 | struct fb_var_screeninfo dummy; |
---|
502 | ],[ac_lib_fb=yes],[ac_lib_fb=no]) |
---|
503 | AC_MSG_RESULT([$ac_lib_fb]) |
---|
504 | elif test $ac_lib_fb = yes; then |
---|
505 | AC_MSG_CHECKING([for FrameBuffer]) |
---|
506 | AC_TRY_COMPILE([ |
---|
507 | #include <linux/fb.h> |
---|
508 | ], [ |
---|
509 | struct fb_var_screeninfo dummy; |
---|
510 | ],[],[AC_MSG_ERROR([the Frame Buffer library is missing])]) |
---|
511 | AC_MSG_RESULT([yes]) |
---|
512 | fi |
---|
513 | if test $ac_lib_fb = yes; then |
---|
514 | ac_lib_video="$ac_lib_video fb" |
---|
515 | ac_lib_direct_flag=yes |
---|
516 | ac_lib_video_flag=yes |
---|
517 | fi |
---|
518 | AC_SUBST([CONF_LIB_FB],[$ac_lib_fb]) |
---|
519 | |
---|
520 | # Checks for alsa |
---|
521 | AC_ARG_ENABLE( |
---|
522 | [alsa], |
---|
523 | AC_HELP_STRING([--enable-alsa],[enable the use of the ALSA library. (default auto)]), |
---|
524 | [ac_lib_alsa=$enableval], |
---|
525 | [ac_lib_alsa=auto] |
---|
526 | ) |
---|
527 | if test $ac_lib_alsa = auto; then |
---|
528 | AC_CHECK_LIB( |
---|
529 | [asound], |
---|
530 | [snd_pcm_open], |
---|
531 | [ac_lib_alsa=yes], |
---|
532 | [ac_lib_alsa=no], |
---|
533 | [-lm] |
---|
534 | ) |
---|
535 | if test $ac_lib_alsa = yes; then |
---|
536 | AC_MSG_CHECKING([for ALSA]) |
---|
537 | AC_TRY_COMPILE([ |
---|
538 | #include <alsa/asoundlib.h> |
---|
539 | ], [ |
---|
540 | #if SND_LIB_VERSION < ((0<<16)|(9<<8)|0) |
---|
541 | choke me |
---|
542 | #endif |
---|
543 | ],[ac_lib_alsa=yes],[ac_lib_alsa=no]) |
---|
544 | AC_MSG_RESULT([$ac_lib_alsa]) |
---|
545 | fi |
---|
546 | elif test $ac_lib_alsa = yes; then |
---|
547 | AC_CHECK_LIB( |
---|
548 | [asound], |
---|
549 | [snd_pcm_open], |
---|
550 | [], |
---|
551 | [AC_MSG_ERROR([the ALSA library is missing])], |
---|
552 | [-lm] |
---|
553 | ) |
---|
554 | AC_MSG_CHECKING([for ALSA version]) |
---|
555 | AC_TRY_COMPILE([ |
---|
556 | #include <alsa/asoundlib.h> |
---|
557 | ], [ |
---|
558 | #if SND_LIB_VERSION < ((0<<16)|(9<<8)|0) |
---|
559 | choke me |
---|
560 | #endif |
---|
561 | ],[],[AC_MSG_ERROR([the ALSA library is too old])]) |
---|
562 | AC_MSG_RESULT([yes]) |
---|
563 | fi |
---|
564 | if test $ac_lib_alsa = yes; then |
---|
565 | ac_lib_sound="$ac_lib_sound alsa" |
---|
566 | ac_lib_sound_flag=yes |
---|
567 | fi |
---|
568 | AC_SUBST([CONF_LIB_ALSA],[$ac_lib_alsa]) |
---|
569 | |
---|
570 | # Checks for oss |
---|
571 | AC_ARG_ENABLE( |
---|
572 | [oss], |
---|
573 | AC_HELP_STRING([--enable-oss],[enable the use of the OSS library. (default auto)]), |
---|
574 | [ac_lib_oss=$enableval], |
---|
575 | [ac_lib_oss=auto] |
---|
576 | ) |
---|
577 | if test $ac_lib_oss = auto; then |
---|
578 | AC_MSG_CHECKING([for OSS]) |
---|
579 | AC_TRY_COMPILE([ |
---|
580 | #include <sys/soundcard.h> |
---|
581 | ], [ |
---|
582 | int dummy = SNDCTL_DSP_SETFMT; |
---|
583 | ],[ac_lib_oss=yes],[ac_lib_oss=no]) |
---|
584 | AC_MSG_RESULT([$ac_lib_oss]) |
---|
585 | elif test $ac_lib_oss = yes; then |
---|
586 | AC_MSG_CHECKING([for OSS]) |
---|
587 | AC_TRY_COMPILE([ |
---|
588 | #include <sys/soundcard.h> |
---|
589 | ], [ |
---|
590 | int dummy = SNDCTL_DSP_SETFMT; |
---|
591 | ],[],[AC_MSG_ERROR([the OSS library is missing])]) |
---|
592 | AC_MSG_RESULT([yes]) |
---|
593 | fi |
---|
594 | if test $ac_lib_oss = yes; then |
---|
595 | ac_lib_sound="$ac_lib_sound oss" |
---|
596 | ac_lib_sound_flag=yes |
---|
597 | fi |
---|
598 | AC_SUBST([CONF_LIB_OSS],[$ac_lib_oss]) |
---|
599 | |
---|
600 | # Checks for pthread |
---|
601 | AC_ARG_ENABLE( |
---|
602 | [pthread], |
---|
603 | AC_HELP_STRING([--enable-pthread],[enable the use of the pthread library (default auto)]), |
---|
604 | [ac_lib_pthread=$enableval], |
---|
605 | [ac_lib_pthread=auto] |
---|
606 | ) |
---|
607 | if test $ac_lib_pthread = auto; then |
---|
608 | AC_CHECK_LIB( |
---|
609 | [pthread], |
---|
610 | [pthread_create], |
---|
611 | [ac_lib_pthread=yes], |
---|
612 | [ac_lib_pthread=no], |
---|
613 | [] |
---|
614 | ) |
---|
615 | elif test $ac_lib_pthread = yes; then |
---|
616 | AC_CHECK_LIB( |
---|
617 | [pthread], |
---|
618 | [pthread_create], |
---|
619 | [], |
---|
620 | [AC_MSG_ERROR([the pthread library is missing])], |
---|
621 | [] |
---|
622 | ) |
---|
623 | fi |
---|
624 | if test $ac_lib_pthread = yes; then |
---|
625 | ac_lib_other="$ac_lib_other pthread" |
---|
626 | fi |
---|
627 | AC_SUBST([CONF_LIB_PTHREAD],[$ac_lib_pthread]) |
---|
628 | |
---|
629 | # Checks for slang |
---|
630 | AC_ARG_ENABLE( |
---|
631 | [slang], |
---|
632 | AC_HELP_STRING([--enable-slang],[enable the use of the sLang library (default auto)]), |
---|
633 | [ac_lib_slang=$enableval], |
---|
634 | [ac_lib_slang=auto] |
---|
635 | ) |
---|
636 | if test $ac_lib_slang = auto; then |
---|
637 | AC_CHECK_LIB( |
---|
638 | [slang], |
---|
639 | [SLang_init_tty], |
---|
640 | [ac_lib_slang=yes], |
---|
641 | [ac_lib_slang=no], |
---|
642 | [] |
---|
643 | ) |
---|
644 | elif test $ac_lib_slang = yes; then |
---|
645 | AC_CHECK_LIB( |
---|
646 | [slang], |
---|
647 | [SLang_init_tty], |
---|
648 | [], |
---|
649 | [AC_MSG_ERROR([the sLang library is missing])], |
---|
650 | [] |
---|
651 | ) |
---|
652 | fi |
---|
653 | if test $ac_lib_slang = yes; then |
---|
654 | AC_CHECK_HEADERS([slang.h slang/slang.h], [break]) |
---|
655 | ac_lib_video="$ac_lib_video slang" |
---|
656 | ac_lib_text_flag=yes |
---|
657 | fi |
---|
658 | AC_SUBST([CONF_LIB_SLANG],[$ac_lib_slang]) |
---|
659 | |
---|
660 | # Checks for ncurses |
---|
661 | AC_ARG_ENABLE( |
---|
662 | [ncurses], |
---|
663 | AC_HELP_STRING([--enable-ncurses],[enable the use of the ncurses library (default auto)]), |
---|
664 | [ac_lib_ncurses=$enableval], |
---|
665 | [ac_lib_ncurses=auto] |
---|
666 | ) |
---|
667 | if test $ac_lib_ncurses = auto; then |
---|
668 | AC_CHECK_LIB( |
---|
669 | [ncurses], |
---|
670 | [endwin], |
---|
671 | [ac_lib_ncurses=yes], |
---|
672 | [ac_lib_ncurses=no], |
---|
673 | [] |
---|
674 | ) |
---|
675 | elif test $ac_lib_ncurses = yes; then |
---|
676 | AC_CHECK_LIB( |
---|
677 | [ncurses], |
---|
678 | [endwin], |
---|
679 | [], |
---|
680 | [AC_MSG_ERROR([the sLang library is missing])], |
---|
681 | [] |
---|
682 | ) |
---|
683 | fi |
---|
684 | if test $ac_lib_ncurses = yes; then |
---|
685 | ac_lib_video="$ac_lib_video ncurses" |
---|
686 | ac_lib_text_flag=yes |
---|
687 | fi |
---|
688 | AC_SUBST([CONF_LIB_NCURSES],[$ac_lib_ncurses]) |
---|
689 | |
---|
690 | # Checks for freetype |
---|
691 | ac_lib_freetype_args= |
---|
692 | ac_lib_freetype_path="$PATH" |
---|
693 | AC_ARG_WITH( |
---|
694 | [freetype-prefix], |
---|
695 | AC_HELP_STRING([--with-freetype-prefix=DIR],[Prefix where FreeType2 is installed (optional)]), |
---|
696 | [ac_lib_freetype_prefix="$withval"], |
---|
697 | [ac_lib_freetype_prefix=""] |
---|
698 | ) |
---|
699 | if test ! -z $ac_lib_freetype_prefix; then |
---|
700 | ac_lib_freetype_args="--prefix=${ac_lib_freetype_prefix}" |
---|
701 | ac_lib_freetype_path="${ac_lib_freetype_prefix}/bin" |
---|
702 | fi |
---|
703 | AC_ARG_ENABLE( |
---|
704 | [freetype], |
---|
705 | AC_HELP_STRING([--enable-freetype],[enable the use of the FreeType2 library. (default auto)]), |
---|
706 | [ac_lib_freetype=$enableval], |
---|
707 | [ac_lib_freetype=auto] |
---|
708 | ) |
---|
709 | if test $ac_lib_freetype = auto; then |
---|
710 | AC_PATH_PROGS( |
---|
711 | [ac_lib_freetype_config], |
---|
712 | [${ac_tool_prefix}freetype-config], |
---|
713 | [], |
---|
714 | [${ac_lib_freetype_path}] |
---|
715 | ) |
---|
716 | if test -z $ac_lib_freetype_config; then |
---|
717 | ac_lib_freetype=no |
---|
718 | else |
---|
719 | ac_save_CFLAGS="$CFLAGS" |
---|
720 | ac_save_LIBS="$LIBS" |
---|
721 | FREETYPECFLAGS=`$ac_lib_freetype_config $ac_lib_freetype_args --cflags` |
---|
722 | FREETYPELIBS=`$ac_lib_freetype_config $ac_lib_freetype_args --libs` |
---|
723 | CFLAGS="$FREETYPECFLAGS $CFLAGS" |
---|
724 | LIBS="$FREETYPELIBS $LIBS" |
---|
725 | AC_MSG_CHECKING([for FreeType2]) |
---|
726 | AC_TRY_LINK([ |
---|
727 | #include <ft2build.h> |
---|
728 | #include FT_FREETYPE_H |
---|
729 | #include FT_GLYPH_H |
---|
730 | ], [ |
---|
731 | FT_Library library; |
---|
732 | int dummy = FT_RENDER_MODE_NORMAL; |
---|
733 | FT_Init_FreeType(&library); |
---|
734 | FT_Done_FreeType(library); |
---|
735 | ],[ac_lib_freetype=yes],[ac_lib_freetype=no]) |
---|
736 | AC_MSG_RESULT([$ac_lib_freetype]) |
---|
737 | CFLAGS="$ac_save_CFLAGS" |
---|
738 | LIBS="$ac_save_LIBS" |
---|
739 | fi |
---|
740 | elif test $ac_lib_freetype = yes; then |
---|
741 | AC_PATH_PROGS( |
---|
742 | [ac_lib_freetype_config], |
---|
743 | [${ac_tool_prefix}freetype-config], |
---|
744 | [], |
---|
745 | [${ac_lib_freetype_path}] |
---|
746 | ) |
---|
747 | if test -z $ac_lib_freetype_config ; then |
---|
748 | AC_MSG_ERROR([the ${ac_tool_prefix}freetype-config tool is missing]) |
---|
749 | else |
---|
750 | ac_save_CFLAGS="$CFLAGS" |
---|
751 | ac_save_LIBS="$LIBS" |
---|
752 | FREETYPECFLAGS=`$ac_lib_freetype_config $ac_lib_freetype_args --cflags` |
---|
753 | FREETYPELIBS=`$ac_lib_freetype_config $ac_lib_freetype_args --libs` |
---|
754 | CFLAGS="$FREETYPECFLAGS $CFLAGS" |
---|
755 | LIBS="$FREETYPELIBS $LIBS" |
---|
756 | AC_MSG_CHECKING([for FreeType2]) |
---|
757 | AC_TRY_LINK([ |
---|
758 | #include <ft2build.h> |
---|
759 | #include FT_FREETYPE_H |
---|
760 | #include FT_GLYPH_H |
---|
761 | ], [ |
---|
762 | FT_Library library; |
---|
763 | FT_Init_FreeType(&library); |
---|
764 | FT_Done_FreeType(library); |
---|
765 | ],[],[AC_MSG_ERROR([the FreeType2 library is missing])]) |
---|
766 | AC_MSG_RESULT([yes]) |
---|
767 | CFLAGS="$ac_save_CFLAGS" |
---|
768 | LIBS="$ac_save_LIBS" |
---|
769 | fi |
---|
770 | fi |
---|
771 | if test $ac_lib_freetype = yes; then |
---|
772 | ac_lib_other="$ac_lib_other freetype2" |
---|
773 | fi |
---|
774 | AC_SUBST([FREETYPECFLAGS]) |
---|
775 | AC_SUBST([FREETYPELIBS]) |
---|
776 | AC_SUBST([CONF_LIB_FREETYPE],[$ac_lib_freetype]) |
---|
777 | |
---|
778 | # Checks for sdl |
---|
779 | ac_lib_sdl_args= |
---|
780 | ac_lib_sdl_path="$PATH" |
---|
781 | AC_ARG_WITH( |
---|
782 | [sdl-prefix], |
---|
783 | AC_HELP_STRING([--with-sdl-prefix=DIR],[Prefix where SDL is installed (optional)]), |
---|
784 | [ac_lib_sdl_prefix="$withval"], |
---|
785 | [ac_lib_sdl_prefix=""] |
---|
786 | ) |
---|
787 | if test ! -z $ac_lib_sdl_prefix; then |
---|
788 | ac_lib_sdl_args="--prefix=${ac_lib_sdl_prefix}" |
---|
789 | ac_lib_sdl_path="${ac_lib_sdl_prefix}/bin" |
---|
790 | fi |
---|
791 | AC_ARG_ENABLE( |
---|
792 | [sdl], |
---|
793 | AC_HELP_STRING([--enable-sdl],[enable the use of the SDL library. (default auto)]), |
---|
794 | [ac_lib_sdl=$enableval], |
---|
795 | [ac_lib_sdl=auto] |
---|
796 | ) |
---|
797 | if test $ac_lib_sdl = auto; then |
---|
798 | AC_PATH_PROGS( |
---|
799 | [ac_lib_sdl_config], |
---|
800 | [${ac_tool_prefix}sdl-config], |
---|
801 | [], |
---|
802 | [${ac_lib_sdl_path}] |
---|
803 | ) |
---|
804 | if test -z $ac_lib_sdl_config; then |
---|
805 | ac_lib_sdl=no |
---|
806 | else |
---|
807 | ac_save_CFLAGS="$CFLAGS" |
---|
808 | ac_save_LIBS="$LIBS" |
---|
809 | SDLCFLAGS=`$ac_lib_sdl_config $ac_lib_sdl_args --cflags` |
---|
810 | if test $ac_enable_static = yes ; then |
---|
811 | SDLLIBS=`$ac_lib_sdl_config $ac_lib_sdl_args --static-libs` |
---|
812 | else |
---|
813 | SDLLIBS=`$ac_lib_sdl_config $ac_lib_sdl_args --libs` |
---|
814 | fi |
---|
815 | CFLAGS="$SDLCFLAGS $CFLAGS" |
---|
816 | LIBS="$SDLLIBS $LIBS" |
---|
817 | AC_MSG_CHECKING([for SDL]) |
---|
818 | AC_TRY_LINK([ |
---|
819 | #include "SDL.h" |
---|
820 | #undef main |
---|
821 | ], [ |
---|
822 | SDL_Init(SDL_INIT_EVERYTHING); |
---|
823 | ],[ac_lib_sdl=yes],[ac_lib_sdl=no]) |
---|
824 | AC_MSG_RESULT([$ac_lib_sdl]) |
---|
825 | CFLAGS="$ac_save_CFLAGS" |
---|
826 | LIBS="$ac_save_LIBS" |
---|
827 | fi |
---|
828 | elif test $ac_lib_sdl = yes; then |
---|
829 | AC_PATH_PROGS( |
---|
830 | [ac_lib_sdl_config], |
---|
831 | [${ac_tool_prefix}sdl-config], |
---|
832 | [], |
---|
833 | [${ac_lib_sdl_path}] |
---|
834 | ) |
---|
835 | if test -z $ac_lib_sdl_config ; then |
---|
836 | AC_MSG_ERROR([the ${ac_tool_prefix}sdl-config tool is missing]) |
---|
837 | else |
---|
838 | ac_save_CFLAGS="$CFLAGS" |
---|
839 | ac_save_LIBS="$LIBS" |
---|
840 | SDLCFLAGS=`$ac_lib_sdl_config $ac_lib_sdl_args --cflags` |
---|
841 | if test $ac_enable_static = yes ; then |
---|
842 | SDLLIBS=`$ac_lib_sdl_config $ac_lib_sdl_args --static-libs` |
---|
843 | else |
---|
844 | SDLLIBS=`$ac_lib_sdl_config $ac_lib_sdl_args --libs` |
---|
845 | fi |
---|
846 | CFLAGS="$SDLCFLAGS $CFLAGS" |
---|
847 | LIBS="$SDLLIBS $LIBS" |
---|
848 | AC_MSG_CHECKING([for SDL]) |
---|
849 | AC_TRY_LINK([ |
---|
850 | #include "SDL.h" |
---|
851 | #undef main |
---|
852 | ], [ |
---|
853 | SDL_Init(SDL_INIT_EVERYTHING); |
---|
854 | ],[],[AC_MSG_ERROR([the SDL library is missing])]) |
---|
855 | AC_MSG_RESULT([yes]) |
---|
856 | CFLAGS="$ac_save_CFLAGS" |
---|
857 | LIBS="$ac_save_LIBS" |
---|
858 | fi |
---|
859 | fi |
---|
860 | if test $ac_lib_sdl = yes; then |
---|
861 | ac_lib_video="$ac_lib_video sdl" |
---|
862 | ac_lib_sound="$ac_lib_sound sdl" |
---|
863 | ac_lib_keyboard="$ac_lib_keyboard sdl" |
---|
864 | ac_lib_joystick="$ac_lib_joystick sdl" |
---|
865 | ac_lib_mouse="$ac_lib_mouse sdl" |
---|
866 | ac_lib_video_flag=yes |
---|
867 | ac_lib_sound_flag=yes |
---|
868 | ac_lib_keyboard_flag=yes |
---|
869 | fi |
---|
870 | AC_SUBST([SDLCFLAGS]) |
---|
871 | AC_SUBST([SDLLIBS]) |
---|
872 | AC_SUBST([CONF_LIB_SDL],[$ac_lib_sdl]) |
---|
873 | |
---|
874 | # Checks for svgawin |
---|
875 | AC_ARG_ENABLE( |
---|
876 | [svgawin], |
---|
877 | AC_HELP_STRING([--enable-svgawin],[enable the use of the SVGAWIN library. (default auto)]), |
---|
878 | [ac_lib_svgawin=$enableval], |
---|
879 | [ac_lib_svgawin=auto] |
---|
880 | ) |
---|
881 | if test $ac_lib_svgawin = auto; then |
---|
882 | if test $ac_system = windows; then |
---|
883 | if test $ac_lib_sdl = yes; then |
---|
884 | ac_lib_svgawin=yes |
---|
885 | else |
---|
886 | ac_lib_svgawin=no |
---|
887 | fi |
---|
888 | else |
---|
889 | ac_lib_svgawin=no |
---|
890 | fi |
---|
891 | fi |
---|
892 | if test $ac_lib_svgawin = yes; then |
---|
893 | if test ! $ac_system = windows; then |
---|
894 | AC_MSG_ERROR([the SVGAWIN library is not supported in this host]) |
---|
895 | fi |
---|
896 | if test $ac_lib_sdl = no; then |
---|
897 | AC_MSG_ERROR([the SVGAWIN library requires the SDL library]) |
---|
898 | fi |
---|
899 | fi |
---|
900 | if test $ac_lib_svgawin = yes; then |
---|
901 | ac_lib_video="$ac_lib_video svgawin" |
---|
902 | ac_lib_direct_flag=yes |
---|
903 | ac_lib_video_flag=yes |
---|
904 | fi |
---|
905 | AC_SUBST([CONF_LIB_SVGAWIN],[$ac_lib_svgawin]) |
---|
906 | |
---|
907 | # Checks for mrawinput |
---|
908 | AC_ARG_ENABLE( |
---|
909 | [mrawinput], |
---|
910 | AC_HELP_STRING([--enable-mrawinput],[enable the use of the Windows Raw input mouse interface. (default auto)]), |
---|
911 | [ac_lib_mrawinput=$enableval], |
---|
912 | [ac_lib_mrawinput=auto] |
---|
913 | ) |
---|
914 | if test $ac_lib_mrawinput = auto; then |
---|
915 | if test $ac_system = windows; then |
---|
916 | ac_lib_mrawinput=yes |
---|
917 | else |
---|
918 | ac_lib_mrawinput=no |
---|
919 | fi |
---|
920 | fi |
---|
921 | if test $ac_lib_mrawinput = yes; then |
---|
922 | if test ! $ac_system = windows; then |
---|
923 | AC_MSG_ERROR([the rawinput library is not supported in this host]) |
---|
924 | fi |
---|
925 | fi |
---|
926 | if test $ac_lib_mrawinput = yes; then |
---|
927 | ac_lib_mouse="$ac_lib_mouse rawinput" |
---|
928 | fi |
---|
929 | AC_SUBST([CONF_LIB_MRAWINPUT],[$ac_lib_mrawinput]) |
---|
930 | |
---|
931 | # Checks for mcpn |
---|
932 | AC_ARG_ENABLE( |
---|
933 | [mcpn], |
---|
934 | AC_HELP_STRING([--enable-mcpn],[enable the use of the Windows CPN mouse interface. (default auto)]), |
---|
935 | [ac_lib_mcpn=$enableval], |
---|
936 | [ac_lib_mcpn=auto] |
---|
937 | ) |
---|
938 | if test $ac_lib_mcpn = auto; then |
---|
939 | if test $ac_system = windows; then |
---|
940 | ac_lib_mcpn=yes |
---|
941 | else |
---|
942 | ac_lib_mcpn=no |
---|
943 | fi |
---|
944 | fi |
---|
945 | if test $ac_lib_mcpn = yes; then |
---|
946 | if test ! $ac_system = windows; then |
---|
947 | AC_MSG_ERROR([the cpn library is not supported in this host]) |
---|
948 | fi |
---|
949 | fi |
---|
950 | if test $ac_lib_mcpn = yes; then |
---|
951 | ac_lib_mouse="$ac_lib_mouse cpn" |
---|
952 | fi |
---|
953 | AC_SUBST([CONF_LIB_MCPN],[$ac_lib_mcpn]) |
---|
954 | |
---|
955 | # Checks for kraw |
---|
956 | AC_ARG_ENABLE( |
---|
957 | [kraw], |
---|
958 | AC_HELP_STRING([--enable-kraw],[enable the use of the raw keyboard interface. (default auto)]), |
---|
959 | [ac_lib_kraw=$enableval], |
---|
960 | [ac_lib_kraw=auto] |
---|
961 | ) |
---|
962 | if test $ac_lib_kraw = auto; then |
---|
963 | AC_MSG_CHECKING([for raw keyboard interface]) |
---|
964 | AC_TRY_COMPILE([ |
---|
965 | #include <sys/kd.h> |
---|
966 | #include <sys/vt.h> |
---|
967 | #include <sys/ioctl.h> |
---|
968 | #include <termios.h> |
---|
969 | ], [ |
---|
970 | int dummy0 = K_MEDIUMRAW; |
---|
971 | int dummy1 = VT_ACTIVATE; |
---|
972 | struct termios dummy2; |
---|
973 | ],[ac_lib_kraw=yes],[ac_lib_kraw=no]) |
---|
974 | AC_MSG_RESULT([$ac_lib_kraw]) |
---|
975 | elif test $ac_lib_kraw = yes; then |
---|
976 | AC_MSG_CHECKING([for raw keyboard interface]) |
---|
977 | AC_TRY_COMPILE([ |
---|
978 | #include <sys/kd.h> |
---|
979 | #include <sys/vt.h> |
---|
980 | #include <sys/ioctl.h> |
---|
981 | #include <termios.h> |
---|
982 | ], [ |
---|
983 | int dummy0 = K_MEDIUMRAW; |
---|
984 | int dummy1 = VT_ACTIVATE; |
---|
985 | struct termios dummy2; |
---|
986 | ],[],[AC_MSG_ERROR([the KRAW keyboard interface is missing])]) |
---|
987 | AC_MSG_RESULT([yes]) |
---|
988 | fi |
---|
989 | if test $ac_lib_kraw = yes; then |
---|
990 | ac_lib_keyboard="$ac_lib_keyboard raw" |
---|
991 | ac_lib_keyboard_flag=yes |
---|
992 | fi |
---|
993 | AC_SUBST([CONF_LIB_KRAW],[$ac_lib_kraw]) |
---|
994 | |
---|
995 | # Checks for jraw |
---|
996 | AC_ARG_ENABLE( |
---|
997 | [jraw], |
---|
998 | AC_HELP_STRING([--enable-jraw],[enable the use of the raw joystick interface. (default auto)]), |
---|
999 | [ac_lib_jraw=$enableval], |
---|
1000 | [ac_lib_jraw=auto] |
---|
1001 | ) |
---|
1002 | if test $ac_lib_jraw = auto; then |
---|
1003 | AC_MSG_CHECKING([for raw joystick interface]) |
---|
1004 | AC_TRY_COMPILE([ |
---|
1005 | #include <linux/joystick.h> |
---|
1006 | ], [ |
---|
1007 | #ifndef JS_VERSION |
---|
1008 | choke me |
---|
1009 | #endif |
---|
1010 | ],[ac_lib_jraw=yes],[ac_lib_jraw=no]) |
---|
1011 | AC_MSG_RESULT([$ac_lib_jraw]) |
---|
1012 | elif test $ac_lib_jraw = yes; then |
---|
1013 | AC_MSG_CHECKING([for raw joystick interface]) |
---|
1014 | AC_TRY_COMPILE([ |
---|
1015 | #include <linux/joystick.h> |
---|
1016 | ], [ |
---|
1017 | #ifndef JS_VERSION |
---|
1018 | choke me |
---|
1019 | #endif |
---|
1020 | ],[],[AC_MSG_ERROR([the JRAW joystick interface is missing])]) |
---|
1021 | AC_MSG_RESULT([yes]) |
---|
1022 | fi |
---|
1023 | if test $ac_lib_jraw = yes; then |
---|
1024 | ac_lib_joystick="$ac_lib_joystick raw" |
---|
1025 | fi |
---|
1026 | AC_SUBST([CONF_LIB_JRAW],[$ac_lib_jraw]) |
---|
1027 | |
---|
1028 | # Checks for mraw |
---|
1029 | AC_ARG_ENABLE( |
---|
1030 | [mraw], |
---|
1031 | AC_HELP_STRING([--enable-mraw],[enable the use of the raw mouse interface. (default auto)]), |
---|
1032 | [ac_lib_mraw=$enableval], |
---|
1033 | [ac_lib_mraw=auto] |
---|
1034 | ) |
---|
1035 | if test $ac_lib_mraw = auto; then |
---|
1036 | AC_MSG_CHECKING([for raw mouse interface]) |
---|
1037 | AC_TRY_COMPILE([ |
---|
1038 | #include <termios.h> |
---|
1039 | ], [ |
---|
1040 | tcsetattr(0, TCSAFLUSH, 0); |
---|
1041 | ],[ac_lib_mraw=yes],[ac_lib_mraw=no]) |
---|
1042 | AC_MSG_RESULT([$ac_lib_mraw]) |
---|
1043 | elif test $ac_lib_mraw = yes; then |
---|
1044 | AC_MSG_CHECKING([for raw mouse interface]) |
---|
1045 | AC_TRY_COMPILE([ |
---|
1046 | #include <termios.h> |
---|
1047 | ], [ |
---|
1048 | tcsetattr(0, TCSAFLUSH, 0); |
---|
1049 | ],[],[AC_MSG_ERROR([the MRAW mouse interface is missing])]) |
---|
1050 | AC_MSG_RESULT([yes]) |
---|
1051 | fi |
---|
1052 | if test $ac_lib_mraw = yes; then |
---|
1053 | ac_lib_mouse="$ac_lib_mouse raw" |
---|
1054 | fi |
---|
1055 | AC_SUBST([CONF_LIB_MRAW],[$ac_lib_mraw]) |
---|
1056 | |
---|
1057 | # Checks for mevent |
---|
1058 | AC_ARG_ENABLE( |
---|
1059 | [mevent], |
---|
1060 | AC_HELP_STRING([--enable-mevent],[enable the use of the event mouse interface. (default auto)]), |
---|
1061 | [ac_lib_mevent=$enableval], |
---|
1062 | [ac_lib_mevent=auto] |
---|
1063 | ) |
---|
1064 | if test $ac_lib_mevent = auto; then |
---|
1065 | AC_MSG_CHECKING([for event mouse interface]) |
---|
1066 | AC_TRY_COMPILE([ |
---|
1067 | #include <linux/input.h> |
---|
1068 | ], [ |
---|
1069 | int dummy = EVIOCGVERSION; |
---|
1070 | ],[ac_lib_mevent=yes],[ac_lib_mevent=no]) |
---|
1071 | AC_MSG_RESULT([$ac_lib_mevent]) |
---|
1072 | elif test $ac_lib_mevent = yes; then |
---|
1073 | AC_MSG_CHECKING([for event mouse interface]) |
---|
1074 | AC_TRY_COMPILE([ |
---|
1075 | #include <linux/input.h> |
---|
1076 | ], [ |
---|
1077 | int dummy = EVIOCGVERSION; |
---|
1078 | ],[],[AC_MSG_ERROR([the event mouse interface is missing])]) |
---|
1079 | AC_MSG_RESULT([yes]) |
---|
1080 | fi |
---|
1081 | if test $ac_lib_mevent = yes; then |
---|
1082 | ac_lib_mouse="$ac_lib_mouse event" |
---|
1083 | fi |
---|
1084 | AC_SUBST([CONF_LIB_MEVENT],[$ac_lib_mevent]) |
---|
1085 | |
---|
1086 | # Checks for kevent |
---|
1087 | AC_ARG_ENABLE( |
---|
1088 | [kevent], |
---|
1089 | AC_HELP_STRING([--enable-kevent],[enable the use of the event keyboard interface. (default auto)]), |
---|
1090 | [ac_lib_kevent=$enableval], |
---|
1091 | [ac_lib_kevent=auto] |
---|
1092 | ) |
---|
1093 | if test $ac_lib_kevent = auto; then |
---|
1094 | AC_MSG_CHECKING([for event keyboard interface]) |
---|
1095 | AC_TRY_COMPILE([ |
---|
1096 | #include <linux/input.h> |
---|
1097 | ], [ |
---|
1098 | int dummy = EVIOCGVERSION; |
---|
1099 | ],[ac_lib_kevent=yes],[ac_lib_kevent=no]) |
---|
1100 | AC_MSG_RESULT([$ac_lib_kevent]) |
---|
1101 | elif test $ac_lib_kevent = yes; then |
---|
1102 | AC_MSG_CHECKING([for event keyboard interface]) |
---|
1103 | AC_TRY_COMPILE([ |
---|
1104 | #include <linux/input.h> |
---|
1105 | ], [ |
---|
1106 | int dummy = EVIOCGVERSION; |
---|
1107 | ],[],[AC_MSG_ERROR([the event keyboard interface is missing])]) |
---|
1108 | AC_MSG_RESULT([yes]) |
---|
1109 | fi |
---|
1110 | if test $ac_lib_kevent = yes; then |
---|
1111 | ac_lib_keyboard="$ac_lib_keyboard event" |
---|
1112 | ac_lib_keyboard_flag=yes |
---|
1113 | fi |
---|
1114 | AC_SUBST([CONF_LIB_KEVENT],[$ac_lib_kevent]) |
---|
1115 | |
---|
1116 | # Checks for jevent |
---|
1117 | AC_ARG_ENABLE( |
---|
1118 | [jevent], |
---|
1119 | AC_HELP_STRING([--enable-jevent],[enable the use of the event joystick interface. (default auto)]), |
---|
1120 | [ac_lib_jevent=$enableval], |
---|
1121 | [ac_lib_jevent=auto] |
---|
1122 | ) |
---|
1123 | if test $ac_lib_jevent = auto; then |
---|
1124 | AC_MSG_CHECKING([for event joystick interface]) |
---|
1125 | AC_TRY_COMPILE([ |
---|
1126 | #include <linux/input.h> |
---|
1127 | ], [ |
---|
1128 | int dummy = EVIOCGVERSION; |
---|
1129 | ],[ac_lib_jevent=yes],[ac_lib_jevent=no]) |
---|
1130 | AC_MSG_RESULT([$ac_lib_jevent]) |
---|
1131 | elif test $ac_lib_jevent = yes; then |
---|
1132 | AC_MSG_CHECKING([for event joystick interface]) |
---|
1133 | AC_TRY_COMPILE([ |
---|
1134 | #include <linux/input.h> |
---|
1135 | ], [ |
---|
1136 | int dummy = EVIOCGVERSION; |
---|
1137 | ],[],[AC_MSG_ERROR([the event joystick interface is missing])]) |
---|
1138 | AC_MSG_RESULT([yes]) |
---|
1139 | fi |
---|
1140 | if test $ac_lib_jevent = yes; then |
---|
1141 | ac_lib_joystick="$ac_lib_joystick event" |
---|
1142 | fi |
---|
1143 | AC_SUBST([CONF_LIB_JEVENT],[$ac_lib_jevent]) |
---|
1144 | |
---|
1145 | # Final |
---|
1146 | AC_SUBST([CONF_LIB_DIRECT],[$ac_lib_direct_flag]) |
---|
1147 | AC_CONFIG_FILES([Makefile]) |
---|
1148 | AC_OUTPUT |
---|
1149 | |
---|
1150 | # Print user information |
---|
1151 | echo "" |
---|
1152 | echo "== Host ==" |
---|
1153 | echo "Environment :" $host |
---|
1154 | if test $ac_is_bigendian = yes; then |
---|
1155 | echo "Endianess : big" |
---|
1156 | else |
---|
1157 | echo "Endianess : little" |
---|
1158 | fi |
---|
1159 | echo "Bits :" $((8 * $ac_cv_sizeof_voidp)) |
---|
1160 | if test $ac_enable_asm = yes; then |
---|
1161 | echo "Assembler for Pentium : yes" |
---|
1162 | else |
---|
1163 | echo "Assembler for Pentium : no" |
---|
1164 | fi |
---|
1165 | if test $ac_enable_asm_mips3 = yes; then |
---|
1166 | echo "Assembler MIPS3 emulator for Pentium : yes" |
---|
1167 | else |
---|
1168 | echo "Assembler MIPS3 emulator for Pentium : no" |
---|
1169 | fi |
---|
1170 | |
---|
1171 | echo "" |
---|
1172 | echo "== Drivers/Libraries ==" |
---|
1173 | if test $ac_lib_direct_flag = no ; then |
---|
1174 | echo "Video :" $ac_lib_video |
---|
1175 | echo "(No video driver is capable to program directly your video board." |
---|
1176 | echo "You will not be able to use not standard video modes.)" |
---|
1177 | else |
---|
1178 | echo "Video :" $ac_lib_video |
---|
1179 | fi |
---|
1180 | echo "Sound :" $ac_lib_sound |
---|
1181 | echo "Keyboard :" $ac_lib_keyboard |
---|
1182 | echo "Joystick :" $ac_lib_joystick |
---|
1183 | echo "Mouse :" $ac_lib_mouse |
---|
1184 | echo "Misc :" $ac_lib_other |
---|
1185 | |
---|
1186 | if test $ac_enable_debug = no ; then |
---|
1187 | if test $ac_lib_video_flag = no; then |
---|
1188 | AC_MSG_ERROR([no video library found. If you have the SDL library installed somewhere try using the --with-sdl-prefix option.]) |
---|
1189 | fi |
---|
1190 | if test $ac_lib_sound_flag = no; then |
---|
1191 | AC_MSG_ERROR([no sound library found]) |
---|
1192 | fi |
---|
1193 | if test $ac_lib_text_flag = no; then |
---|
1194 | AC_MSG_WARN([no text video mode library found. The advv/advcfg utilities will not work!]) |
---|
1195 | fi |
---|
1196 | fi |
---|
1197 | |
---|
1198 | echo "" |
---|
1199 | echo "== Compiler ==" |
---|
1200 | echo "CC :" $CC |
---|
1201 | echo "CXX :" $CXX |
---|
1202 | echo "CFLAGS :" $CFLAGS $CFLAGS_OPTOPT |
---|
1203 | echo "LDFLAGS :" $LDFLAGS |
---|
1204 | |
---|
1205 | if test ! $ac_with_emu = none ; then |
---|
1206 | echo "" |
---|
1207 | echo "== Configuration ==" |
---|
1208 | echo "Emulator :" $ac_with_emu |
---|
1209 | echo "Debugger :" $ac_enable_debugger |
---|
1210 | fi |
---|
1211 | |
---|