Version:
~
[ 2.3.5 ] ~
[ 2.3 ] ~
1 dnl // Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.50)
4 AC_INIT(bochs.h)
5 AC_REVISION([[$Id: configure.in,v 1.340 2007/09/16 07:53:00 vruppert Exp $]])
6 AC_CONFIG_HEADER(config.h)
7 AC_CONFIG_HEADER(ltdlconf.h)
8
9 dnl // Put Bochs version information right here so that it gets substituted
10 dnl // into all the right places.
11 VERSION="2.3.5"
12 VER_STRING="2.3.5"
13 REL_STRING="Build from CVS snapshot, on September 16, 2007"
14
15 changequote(<<, >>)
16 changequote([, ])
17
18 dnl Detect host and target
19 AC_CANONICAL_HOST
20 AC_CANONICAL_TARGET
21
22 AC_MSG_CHECKING(if you are configuring for another platform)
23 if test "$cross_compiling" = yes -o "$target_os" = "windows"; then
24 AC_MSG_RESULT(yes)
25 cross_configure=1
26 else
27 AC_MSG_RESULT(no)
28 cross_configure=0
29 fi
30
31 # this case statement defines the compile flags which are needed to
32 # compile bochs on a platform. Don't put things like optimization settings
33 # into the configure.in file, since people will want to be able to change
34 # those settings by defining CFLAGS and CXXFLAGS before running configure.
35 NO_LT=0
36 need_dlcompat_for_plugins=0
37 case "$target" in
38 *-pc-windows* | *-pc-winnt*)
39 DEFAULT_GUI=win32 # default to win32 gui
40 ;;
41 *-pc-cygwin* | *-pc-mingw32*)
42 NO_LT=1 # do not use libtool at all on cygwin
43 if test "$with_term" = yes; then
44 # ncurses won't compile with -mno-cygwin or -DWIN32
45 # also, I can't get it to link without this -DBROKEN_LINKER=1 hack.
46 # see /usr/include/curses.h for details.
47 ADD_FLAGS="-DBROKEN_LINKER=1"
48 else
49 # default case
50 ADD_FLAGS="-mno-cygwin -DWIN32" # required for cygwin compile+win32 gui
51 DEFAULT_GUI=win32 # default to win32 gui
52 fi
53 ;;
54 *-macosx* | *-darwin*)
55 ADD_FLAGS="-fpascal-strings -fno-common -arch ppc -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh" # required for macosx compile
56 DEFAULT_GUI=carbon # default to carbon
57 need_dlcompat_for_plugins=1
58 ;;
59 *-macos*)
60 DEFAULT_GUI=macos # macos defaults to macos
61 ;;
62 *-beos*)
63 ADD_FLAGS="-Wno-multichar"
64 DEFAULT_GUI=beos # beos defaults to beos
65 ;;
66 *-amigaos* | *-morphos*)
67 DEFAULT_GUI=amigaos # amigaos or morphos defaults to amigaos gui
68 ;;
69 *-solaris*)
70 ADD_FLAGS="-D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__" # required for correct function prototypes
71 LIBS="$LIBS -lsocket -lnsl"
72 DEFAULT_GUI=x11
73 ;;
74 *)
75 DEFAULT_GUI=x11
76 ;;
77 esac
78 if test "${ADD_FLAGS:+set}" = set; then
79 CFLAGS="$CFLAGS $ADD_FLAGS"
80 CXXFLAGS="$CXXFLAGS $ADD_FLAGS"
81 CPPFLAGS="$CPPFLAGS $ADD_FLAGS"
82 fi
83
84 AC_MSG_CHECKING(for standard CFLAGS on this platform)
85 AC_MSG_RESULT($ADD_FLAGS)
86
87 dnl // make sure X Windows is default if no other chosen
88 if (test "$with_sdl" != yes) && \
89 (test "$with_svga" != yes) && \
90 (test "$with_x11" != yes) && \
91 (test "$with_beos" != yes) && \
92 (test "$with_win32" != yes) && \
93 (test "$with_nogui" != yes) && \
94 (test "$with_term" != yes) && \
95 (test "$with_rfb" != yes) && \
96 (test "$with_amigaos" != yes) && \
97 (test "$with_carbon" != yes) && \
98 (test "$with_wx" != yes) && \
99 (test "$with_macos" != yes); then
100 # use DEFAULT_GUI. Set the appropriate variable.
101 # DEFAULT_GUI must be set to one of the names above. Otherwise, no
102 # valid $with_* variable will be set and who knows what will happen?
103 eval "with_${DEFAULT_GUI}=yes"
104 fi
105
106 AC_PROG_CC
107 AC_PROG_CXX
108 AC_PROG_MAKE_SET
109
110 dnl------------ libtool configuration
111 dnl Configure libtool, and default to shared libraries. Libtool will only be
112 dnl used for compiling and linking plugins.
113 AC_DISABLE_STATIC
114 dnl Check for dlopen support
115 AC_LIBTOOL_DLOPEN
116 dnl Configure libtool
117 AC_PROG_LIBTOOL
118 dnl Configure the ltdl library. This must go after AC_PROG_LIBTOOL or
119 dnl else it disables shared libraries somehow. The values from this macro
120 dnl are written to ltdlconf.h.
121 AC_LIB_LTDL
122
123 AC_PATH_XTRA
124
125 AC_C_BIGENDIAN
126 AC_C_INLINE
127 AC_CHECK_SIZEOF(unsigned char)
128 AC_CHECK_SIZEOF(unsigned short)
129 AC_CHECK_SIZEOF(unsigned int)
130 AC_CHECK_SIZEOF(unsigned long)
131 AC_CHECK_SIZEOF(unsigned long long)
132 AC_CHECK_SIZEOF(int *)
133 AC_CHECK_FUNCS(getenv, AC_DEFINE(BX_HAVE_GETENV))
134 AC_CHECK_FUNCS(setenv, AC_DEFINE(BX_HAVE_SETENV))
135 AC_CHECK_FUNCS(select, AC_DEFINE(BX_HAVE_SELECT))
136 AC_CHECK_FUNCS(snprintf, AC_DEFINE(BX_HAVE_SNPRINTF))
137 AC_CHECK_FUNCS(vsnprintf, AC_DEFINE(BX_HAVE_VSNPRINTF))
138 AC_CHECK_FUNCS(strtoull, AC_DEFINE(BX_HAVE_STRTOULL))
139 AC_CHECK_FUNCS(strtouq, AC_DEFINE(BX_HAVE_STRTOUQ))
140 AC_CHECK_FUNCS(strdup, AC_DEFINE(BX_HAVE_STRDUP))
141 AC_CHECK_FUNCS(strrev, AC_DEFINE(BX_HAVE_STRREV))
142 AC_CHECK_FUNCS(sleep, AC_DEFINE(BX_HAVE_SLEEP))
143 AC_CHECK_FUNCS(usleep, AC_DEFINE(BX_HAVE_USLEEP))
144 AC_CHECK_FUNCS(nanosleep, AC_DEFINE(BX_HAVE_NANOSLEEP))
145 AC_CHECK_FUNCS(abort, AC_DEFINE(BX_HAVE_ABORT))
146 AC_CHECK_FUNCS(gettimeofday, AC_DEFINE(BX_HAVE_GETTIMEOFDAY))
147 AC_CHECK_TYPE(socklen_t, AC_DEFINE(BX_HAVE_SOCKLEN_T), , [#include <sys/types.h>
148 #include <sys/socket.h>])
149 AC_CHECK_MEMBER(struct sockaddr_in.sin_len, AC_DEFINE(BX_HAVE_SOCKADDR_IN_SIN_LEN), , [#include <sys/socket.h>
150 #include <netinet/in.h> ])
151 AC_CHECK_FUNCS(mkstemp, AC_DEFINE(BX_HAVE_MKSTEMP))
152 AC_CHECK_HEADER(sys/mman.h, AC_DEFINE(BX_HAVE_SYS_MMAN_H))
153 AC_CHECK_FUNCS(timelocal, AC_DEFINE(BX_HAVE_TIMELOCAL))
154 AC_CHECK_FUNCS(gmtime, AC_DEFINE(BX_HAVE_GMTIME))
155 AC_CHECK_FUNCS(mktime, AC_DEFINE(BX_HAVE_MKTIME))
156
157 dnl As of autoconf 2.53, the standard largefile test fails for Linux/gcc.
158 dnl It does not put the largefiles arguments into CFLAGS, even though Linux/gcc
159 dnl does need them. Since wxWidgets had already solved this exact problem,
160 dnl Bryce asked Vadim Zeitlin of the wxWidgets project if Bochs could grab
161 dnl their largefile test, and he said it was fine. The re-implemented
162 dnl AC_SYS_LARGEFILE test can be found in aclocal.m4.
163 AC_SYS_LARGEFILE
164
165 dnl This logic came from wxWidgets as well. Bryce added the CFLAGS and
166 dnl CXXFLAGS lines, since Bochs makefiles don't use CPPFLAGS at all.
167 dnl
168 dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command
169 dnl line because otherwise the system headers risk being included before
170 dnl config.h which defines these constants leading to inconsistent
171 dnl sizeof(off_t) in different source files of the same program and linking
172 dnl problems
173 if test "x$wx_largefile" = "xyes"; then
174 if test "x$ac_cv_sys_file_offset_bits" = "x64"; then
175 BX_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
176 else
177 BX_LARGEFILE_FLAGS="-D_LARGE_FILES"
178 fi
179 CPPFLAGS="$CPPFLAGS $BX_LARGEFILE_FLAGS"
180 CFLAGS="$CFLAGS $BX_LARGEFILE_FLAGS"
181 CXXFLAGS="$CXXFLAGS $BX_LARGEFILE_FLAGS"
182 fi
183 dnl ---end of largefile tests
184
185 dnl Add the -lm library if math functions cannot be used without it.
186 dnl This check is important on cygwin because of the bizarre way that they
187 dnl have organized functions into libraries. On cygwin, both libc.a and
188 dnl libm.a are symbolic links to a single lib libcygwin.a. This means that
189 dnl 1) linking with -lm is not necessary, and
190 dnl 2) linking with -lm is dangerous if the order of libraries is wrong
191 dnl In particular, if you compile any program with -mno-cygwin and link with
192 dnl -lm, it will crash instantly when it is run. This happens because the
193 dnl linker incorrectly links the Cygwin libm.a (==libcygwin.a), which replaces
194 dnl the ___main function instead of allowing it to be defined by
195 dnl /usr/lib/mingw/libmingw32.a as it should be.
196 dnl
197 dnl On MacOS X, this test will find that -lm is unnecessary and leave it out.
198 dnl
199 dnl Just check a few math functions. If they are all found without
200 dnl -lm, then we must not need -lm.
201 have_cos=0
202 have_floor=0
203 AC_CHECK_FUNCS(cos, have_cos=1)
204 AC_CHECK_FUNCS(floor, have_floor=1)
205 AC_MSG_CHECKING(if math functions link without -lm)
206 if test "$have_cos" = 1 -a "$have_floor" = 1; then
207 AC_MSG_RESULT(yes)
208 else
209 AC_MSG_RESULT(no)
210 LIBS="$LIBS -lm"
211 # use different functions to bypass configure caching
212 have_sin=0
213 have_ceil=0
214 AC_CHECK_FUNCS(sin, have_sin=1)
215 AC_CHECK_FUNCS(ceil, have_ceil=1)
216 AC_MSG_CHECKING(if math functions link with -lm)
217 if test "$have_sin" = 1 -a "$have_ceil" = 1; then
218 AC_MSG_RESULT(yes)
219 else
220 AC_MSG_RESULT(no)
221 # not sure we should warn the user, crash, etc.
222 # expect link failure
223 fi
224 fi
225
226 AC_MSG_CHECKING(for struct timeval)
227 AC_TRY_COMPILE([#include <sys/time.h>],
228 [struct timeval x;],
229 [
230 AC_MSG_RESULT(yes)
231 AC_DEFINE(BX_HAVE_STRUCT_TIMEVAL, 1)
232 ],
233 AC_MSG_RESULT(no))
234
235 AC_MSG_CHECKING(if compiler allows empty structs)
236 AC_TRY_COMPILE([], [typedef struct { } junk;],
237 AC_MSG_RESULT(yes),
238 [
239 AC_DEFINE(BX_NO_EMPTY_STRUCTS)
240 AC_MSG_RESULT(no)
241 ])
242
243 AC_MSG_CHECKING(if compiler allows __attribute__)
244 AC_TRY_COMPILE([], [typedef struct { } __attribute__ ((packed)) junk;],
245 AC_MSG_RESULT(yes),
246 [
247 AC_MSG_RESULT(no)
248 AC_DEFINE(BX_NO_ATTRIBUTES)
249 ])
250
251 AC_LANG_SAVE
252 AC_LANG_CPLUSPLUS
253 AC_MSG_CHECKING(for hash_map)
254 AC_TRY_COMPILE([#include <hash_map>], [],
255 [
256 AC_MSG_RESULT(yes)
257 AC_DEFINE(BX_HAVE_HASH_MAP)
258 ], AC_MSG_RESULT(no))
259 AC_MSG_CHECKING(for hash_map.h)
260 AC_TRY_COMPILE([#include <hash_map.h>], [],
261 [
262 AC_MSG_RESULT(yes)
263 AC_DEFINE(BX_HAVE_HASH_MAP_H)
264 ], AC_MSG_RESULT(no))
265 AC_MSG_CHECKING(for set)
266 AC_TRY_COMPILE([#include <set>], [],
267 [
268 AC_MSG_RESULT(yes)
269 AC_DEFINE(BX_HAVE_SET)
270 ], AC_MSG_RESULT(no))
271 AC_MSG_CHECKING(for set.h)
272 AC_TRY_COMPILE([#include <set.h>], [],
273 [
274 AC_MSG_RESULT(yes)
275 AC_DEFINE(BX_HAVE_SET_H)
276 ], AC_MSG_RESULT(no))
277 AC_LANG_RESTORE
278
279 dnl Implement a check for each gui library to see if has a chance of compiling.
280 if test "$with_all_libs" = yes; then
281 if test "$cross_configure" = 1; then
282 AC_MSG_WARN([[Using --with-all-libs while cross configuring is very unlikely to be what you want. You should specify the --with-* args yourself.]])
283 fi
284 if test "$with_beos" != yes; then
285 can_compile_beos=1
286 AC_CHECK_HEADER([app/Application.h], [], [ can_compile_beos=0 ])
287 AC_CHECK_HEADER([interface/Window.h], [], [ can_compile_beos=0 ])
288 AC_CHECK_HEADER([interface/View.h], [], [ can_compile_beos=0 ])
289 if test $can_compile_beos = 1; then
290 with_beos=yes
291 fi
292 fi
293
294 if test "$with_amigaos" != yes; then
295 can_compile_amigaos=1
296 AC_CHECK_HEADER([proto/intuition.h], [], [ can_compile_amigaos=0 ])
297 AC_CHECK_HEADER([intuition/intuitionbase.h], [], [ can_compile_amigaos=0 ])
298 AC_CHECK_HEADER([cybergraphx/cybergraphics.h], [], [ can_compile_amigaos=0 ])
299 AC_CHECK_HEADER([devices/trackdisk.h], [], [ can_compile_amigaos=0 ])
300 if test $can_compile_amigaos = 1; then
301 with_amigaos=yes
302 fi
303 fi
304
305 if test "$with_macos" != yes; then
306 can_compile_macos=1
307 AC_CHECK_HEADER([Quickdraw.h], [], [ can_compile_macos=0 ])
308 AC_CHECK_HEADER([Dialogs.h], [], [ can_compile_macos=0 ])
309 if test $can_compile_macos = 1; then
310 with_macos=yes
311 fi
312 fi
313
314 if test "$with_carbon" != yes; then
315 can_compile_carbon=1
316 AC_CHECK_HEADER([Carbon.h], [], [ can_compile_carbon=0 ])
317 AC_CHECK_HEADER([ApplicationServices/ApplicationServices.h], [], [ can_compile_carbon=0 ])
318 if test $can_compile_carbon = 1; then
319 with_carbon=yes
320 fi
321 fi
322
323 if test "$with_win32" != yes; then
324 can_compile_win32=1
325 AC_CHECK_HEADER([windows.h], [], [ can_compile_win32=0 ])
326 AC_CHECK_HEADER([commctrl.h], [], [ can_compile_win32=0 ])
327 if test $can_compile_win32 = 1; then
328 with_win32=yes
329 fi
330 fi
331
332 if test "$with_sdl" != yes; then
333 can_compile_sdl=1
334 AC_CHECK_HEADER([SDL/SDL.h], [], [ can_compile_sdl=0 ])
335 AC_CHECK_HEADER([SDL/SDL_main.h], [], [ can_compile_sdl=0 ])
336 if test $can_compile_sdl = 1; then
337 with_sdl=yes
338 fi
339 fi
340
341 if test "$with_svga" != yes; then
342 can_compile_svga=1
343 AC_CHECK_HEADER([vga.h], [], [ can_compile_svga=0 ])
344 AC_CHECK_HEADER([vgagl.h], [], [ can_compile_svga=0 ])
345 if test $can_compile_svga = 1; then
346 with_svga=yes
347 fi
348 fi
349
350 if test "$with_x11" != yes; then
351 can_compile_x11=1
352 AC_CHECK_HEADER([X11/Xlib.h], [], [ can_compile_x11=0 ])
353 AC_CHECK_HEADER([X11/Xutil.h], [], [ can_compile_x11=0 ])
354 if test $can_compile_x11 = 1; then
355 with_x11=yes
356 fi
357 fi
358
359 if test "$with_rfb" != yes; then
360 can_compile_rfb=1
361 case $target in
362 *-pc-windows* | *-pc-winnt* | *-pc-cygwin* | *-pc-mingw32*)
363 AC_CHECK_HEADER([winsock.h], [], [ can_compile_rfb=0 ])
364 AC_CHECK_HEADER([process.h], [], [ can_compile_rfb=0 ])
365 ;;
366 *)
367 AC_CHECK_HEADER([sys/socket.h], [], [ can_compile_rfb=0 ])
368 AC_CHECK_HEADER([netinet/tcp.h], [], [ can_compile_rfb=0 ])
369 AC_CHECK_HEADER([pthread.h], [], [ can_compile_rfb=0 ])
370 ;;
371 esac
372 if test $can_compile_rfb = 1; then
373 with_rfb=yes
374 fi
375 fi
376
377 if test "$with_term" != yes; then
378 can_compile_term=1
379 AC_CHECK_HEADER([curses.h], [], [ can_compile_term=0 ])
380 AC_CHECK_HEADER([signal.h], [], [ can_compile_term=0 ])
381 if test $can_compile_term = 1; then
382 with_term=yes
383 fi
384 fi
385
386 if test "$with_nogui" != yes; then
387 with_nogui=yes
388 fi
389 fi # end of if $with_all_libs = yes
390
391 AC_MSG_CHECKING(for idle hack)
392 AC_ARG_ENABLE(idle-hack,
393 [ --enable-idle-hack use Roland Mainz's idle hack],
394 [if test "$enableval" = yes; then
395 AC_MSG_RESULT(yes)
396 AC_DEFINE(BX_USE_IDLE_HACK, 1)
397 else
398 AC_MSG_RESULT(no)
399 AC_DEFINE(BX_USE_IDLE_HACK, 0)
400 fi],
401 [
402 AC_MSG_RESULT(no)
403 AC_DEFINE(BX_USE_IDLE_HACK, 0)
404 ]
405 )
406 AC_SUBST(BX_USE_IDLE_HACK)
407
408 AC_CHECK_HEADER(dlfcn.h, AC_DEFINE(BX_HAVE_DLFCN_H, 1))
409 AC_CHECK_HEADER(assert.h, AC_DEFINE(HAVE_ASSERT_H, 1))
410
411 AC_MSG_CHECKING(for plugins support)
412 AC_ARG_ENABLE(plugins,
413 [ --enable-plugins enable plugins],
414 [if test "$enableval" = yes; then
415 bx_plugins=1
416 else
417 bx_plugins=0
418 fi],
419 [
420 bx_plugins=0
421 ]
422 )
423
424 if test "$bx_plugins" = 1; then
425 AC_MSG_RESULT(yes)
426 AC_DEFINE(BX_PLUGINS, 1)
427 GUI_NON_PLUGIN_OBJS='$(OBJS_THAT_CANNOT_BE_PLUGINS)'
428 GUI_PLUGIN_OBJS='$(OBJS_THAT_CAN_BE_PLUGINS)'
429 DEFINE_PLUGIN_PATH='-DBX_PLUGIN_PATH="\"${plugdir}\""'
430 # and the $(OBJS_THAT_SUPPORT_OTHER_PLUGINS) will be built and linked
431 # by special link rules for the plugins that they support.
432 LIBS="$LIBS $LIBADD_DL"
433 PLUGIN_VAR='ltdl.o'
434 PLUGIN_TARGET=bochs_plugins
435 INSTALL_PLUGINS_VAR=install_libtool_plugins
436 NONPLUGIN_GUI_LINK_OPTS=''
437 else
438 AC_MSG_RESULT(no)
439 bx_plugins=0
440 AC_DEFINE(BX_PLUGINS, 0)
441 GUI_NON_PLUGIN_OBJS='$(OBJS_THAT_CANNOT_BE_PLUGINS) $(OBJS_THAT_CAN_BE_PLUGINS) $(OBJS_THAT_SUPPORT_OTHER_PLUGINS)'
442 GUI_PLUGIN_OBJS=''
443 NONPLUGIN_GUI_LINK_OPTS='$(GUI_LINK_OPTS)'
444 fi
445 AC_SUBST(DEFINE_PLUGIN_PATH)
446 AC_SUBST(NONPLUGIN_GUI_LINK_OPTS)
447
448 # copy gui variables into iodev variables. Later, we will add to the gui
449 # objs list, according to which display libraries are enabled.
450 IODEV_NON_PLUGIN_OBJS=$GUI_NON_PLUGIN_OBJS
451 IODEV_PLUGIN_OBJS=$GUI_PLUGIN_OBJS
452
453 # on MacOSX if they enabled plugins, make sure that dlopen() was found.
454 # It is provided by a library called dlcompat.
455 if test "$bx_plugins" = 1 -a "$need_dlcompat_for_plugins" = 1; then
456 have_dlopen=0
457 AC_CHECK_LIB(dl, dlopen, [have_dlopen=1])
458 AC_MSG_CHECKING(if you have dlcompat, required for MacOSX plugins)
459 if test "$have_dlopen" = 0; then
460 AC_MSG_RESULT(no)
461 AC_MSG_ERROR([To use plugins on MacOSX you must use a library called dlcompat. The configure script was not able to find dlcompat. If it is already installed then you must set up your environment variables to point to it, as is done in .conf.macosx. If you cannot resolve this, you should turn off plugins.])
462 else
463 AC_MSG_RESULT(yes)
464 fi
465 fi
466
467 AC_MSG_CHECKING(if compiler allows blank labels)
468 AC_TRY_COMPILE([], [ { label1: } ],
469 AC_MSG_RESULT(yes),
470 [
471 AC_MSG_RESULT(no)
472 AC_DEFINE(BX_NO_BLANK_LABELS)
473 ])
474
475 AC_MSG_CHECKING(if compiler allows LL for 64-bit constants)
476 AC_TRY_COMPILE([], [ { 42LL; } ],
477 AC_MSG_RESULT(yes),
478 [
479 AC_MSG_RESULT(no)
480 AC_DEFINE(BX_64BIT_CONSTANTS_USE_LL, 0)
481 ])
482
483 use_x86_64=0
484 AC_MSG_CHECKING(for x86-64 support)
485 AC_ARG_ENABLE(x86-64,
486 [ --enable-x86-64 compile in support for x86-64 instructions],
487 [if test "$enableval" = yes; then
488 AC_MSG_RESULT(yes)
489 OBJS64='$(OBJS64)'
490 AC_DEFINE(BX_SUPPORT_X86_64, 1)
491 use_x86_64=1
492 else
493 AC_MSG_RESULT(no)
494 OBJS64=''
495 AC_DEFINE(BX_SUPPORT_X86_64, 0)
496 fi
497 ],
498 [
499 AC_MSG_RESULT(no)
500 OBJS64=''
501 AC_DEFINE(BX_SUPPORT_X86_64, 0)
502 ]
503 )
504 AC_SUBST(OBJS64)
505
506 use_smp=0
507 AC_MSG_CHECKING(for SMP support)
508 AC_ARG_ENABLE(smp,
509 [ --enable-smp compile in support for SMP configurations],
510 [if test "$enableval" = yes; then
511 AC_MSG_RESULT(yes)
512 AC_DEFINE(BX_SUPPORT_SMP, 1)
513 AC_DEFINE(BX_USE_CPU_SMF, 0)
514 use_smp=1
515 else
516 AC_MSG_RESULT(no)
517 AC_DEFINE(BX_SUPPORT_SMP, 0)
518 fi
519 ],
520 [
521 AC_MSG_RESULT(no)
522 AC_DEFINE(BX_SUPPORT_SMP, 0)
523 ]
524 )
525
526 AC_MSG_CHECKING(for cpu level)
527 AC_ARG_ENABLE(cpu-level,
528 [ --enable-cpu-level select cpu level (3,4,5,6)],
529 [case "$enableval" in
530 3)
531 AC_MSG_RESULT(3)
532 AC_DEFINE(BX_CPU_LEVEL, 3)
533 AC_DEFINE(BX_CPU_LEVEL_HACKED, 3)
534 ;;
535 4)
536 AC_MSG_RESULT(4)
537 AC_DEFINE(BX_CPU_LEVEL, 4)
538 AC_DEFINE(BX_CPU_LEVEL_HACKED, 4)
539 ;;
540 5)
541 AC_MSG_RESULT(5)
542 AC_DEFINE(BX_CPU_LEVEL, 5)
543 AC_DEFINE(BX_CPU_LEVEL_HACKED, 5)
544 ;;
545 6)
546 AC_MSG_RESULT(6)
547 AC_DEFINE(BX_CPU_LEVEL, 6)
548 AC_DEFINE(BX_CPU_LEVEL_HACKED, 6)
549 ;;
550 *)
551 echo " "
552 echo "ERROR: you must supply a valid CPU level to --enable-cpu-level"
553 exit 1
554 ;;
555 esac
556 bx_cpu_level=$enableval
557 if test "$use_smp" = 1 -a "$enableval" -lt 6; then
558 echo "ERROR: with >1 processor, use --enable-cpu-level=6"
559 exit 1
560 fi
561 ],
562 [
563 # for multiprocessors or x86-64, cpu level must be 6
564 if test "$use_smp" = 1 -o "$use_x86_64" = 1; then
565 AC_MSG_RESULT(6)
566 AC_DEFINE(BX_CPU_LEVEL, 6)
567 AC_DEFINE(BX_CPU_LEVEL_HACKED, 6)
568 bx_cpu_level=6
569 else
570 AC_MSG_RESULT(5)
571 AC_DEFINE(BX_CPU_LEVEL, 5)
572 AC_DEFINE(BX_CPU_LEVEL_HACKED, 5)
573 bx_cpu_level=5
574 fi
575 ]
576 )
577
578
579 AC_MSG_CHECKING(for APIC support)
580 AC_ARG_ENABLE(apic,
581 [ --enable-apic enable APIC support],
582 [if test "$enableval" = yes; then
583 AC_MSG_RESULT(yes)
584 AC_DEFINE(BX_SUPPORT_APIC, 1)
585 IOAPIC_OBJS='ioapic.o'
586 APIC_OBJS='apic.o'
587 else
588 AC_MSG_RESULT(no)
589 if test "$use_smp" = 1; then
590 echo "ERROR: With SMP configuration you must use --enable-apic"
591 exit 1
592 fi
593 AC_DEFINE(BX_SUPPORT_APIC, 0)
594 IOAPIC_OBJS=''
595 APIC_OBJS=''
596 fi
597 ],
598 [
599 if test "$use_smp" = 1 -o "$bx_cpu_level" -gt 5; then
600 # enable APIC by default, if SMP configuration or if cpulevel>5
601 AC_MSG_RESULT(yes)
602 AC_DEFINE(BX_SUPPORT_APIC, 1)
603 IOAPIC_OBJS='ioapic.o'
604 APIC_OBJS='apic.o'
605 else
606 AC_MSG_RESULT(no)
607 AC_DEFINE(BX_SUPPORT_APIC, 0)
608 IOAPIC_OBJS=''
609 APIC_OBJS=''
610 fi
611 ]
612 )
613 AC_SUBST(IOAPIC_OBJS)
614 AC_SUBST(APIC_OBJS)
615
616 AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, gzopen, AC_DEFINE(BX_HAVE_ZLIB,1))] )
617
618 AC_MSG_CHECKING(for compressed hard disk image support)
619 AC_ARG_ENABLE(compressed-hd,
620 [ --enable-compressed-hd allows compressed (zlib) hard disk image (not implemented yet)],
621 [if test "$enableval" = yes; then
622 AC_MSG_RESULT(yes)
623 AC_DEFINE(BX_COMPRESSED_HD_SUPPORT, 1)
624 LIBS="$LIBS -lz"
625 else
626 AC_MSG_RESULT(no)
627 AC_DEFINE(BX_COMPRESSED_HD_SUPPORT, 0)
628 fi],
629 [
630 AC_MSG_RESULT(no)
631 AC_DEFINE(BX_COMPRESSED_HD_SUPPORT, 0)
632 ]
633 )
634 AC_SUBST(BX_COMPRESSED_HD_SUPPORT)
635
636 AC_MSG_CHECKING(for NE2000 support)
637 AC_ARG_ENABLE(ne2000,
638 [ --enable-ne2000 enable limited ne2000 support],
639 [if test "$enableval" = yes; then
640 AC_MSG_RESULT(yes)
641 AC_DEFINE(BX_SUPPORT_NE2K, 1)
642 NE2K_OBJS='ne2k.o'
643 networking=yes
644 else
645 AC_MSG_RESULT(no)
646 AC_DEFINE(BX_SUPPORT_NE2K, 0)
647 NE2K_OBJS=''
648 networking=no
649 fi],
650 [
651 AC_MSG_RESULT(no)
652 AC_DEFINE(BX_SUPPORT_NE2K, 0)
653 NE2K_OBJS=''
654 networking=no
655 ]
656 )
657 AC_SUBST(NE2K_OBJS)
658
659 AC_MSG_CHECKING(for ACPI support)
660 AC_ARG_ENABLE(acpi,
661 [ --enable-acpi enable ACPI support],
662 [if test "$enableval" = yes; then
663 AC_MSG_RESULT(yes)
664 AC_DEFINE(BX_SUPPORT_ACPI, 1)
665 else
666 AC_MSG_RESULT(no)
667 AC_DEFINE(BX_SUPPORT_ACPI, 0)
668 fi],
669 [
670 AC_MSG_RESULT(no)
671 AC_DEFINE(BX_SUPPORT_ACPI, 0)
672 ]
673 )
674 AC_SUBST(BX_SUPPORT_ACPI)
675
676 AC_MSG_CHECKING(for i440FX PCI support)
677 AC_ARG_ENABLE(pci,
678 [ --enable-pci enable limited i440FX PCI support],
679 [if test "$enableval" = yes; then
680 AC_MSG_RESULT(yes)
681 AC_DEFINE(BX_SUPPORT_PCI, 1)
682 pci=1
683 PCI_OBJ='pci.o pci2isa.o pci_ide.o pcivga.o acpi.o'
684 else
685 AC_MSG_RESULT(no)
686 AC_DEFINE(BX_SUPPORT_PCI, 0)
687 pci=0
688 PCI_OBJ=''
689 fi],
690 [
691 AC_MSG_RESULT(no)
692 AC_DEFINE(BX_SUPPORT_PCI, 0)
693 pci=0
694 PCI_OBJ=''
695 ]
696 )
697 AC_SUBST(PCI_OBJ)
698
699 #
700 # PCI host device support
701 #
702 AC_MSG_CHECKING(for PCI host device mapping support)
703 AC_ARG_ENABLE(pcidev,
704 [ --enable-pcidev enable PCI host device mapping support (linux host only)],
705 [
706 if test "$enableval" = "yes"; then
707 AC_MSG_RESULT(yes)
708 if test "$pci" != "1"; then
709 AC_MSG_ERROR([PCI host device mapping requires PCI support])
710 fi
711 case "$target" in
712 *-linux*)
713 AC_MSG_NOTICE([Linux detected as host for PCI host device mapping])
714 linux_version=`uname -r`
715 case "$linux_version" in
716 2.4*)
717 PCIDEV_MODULE_MAKE_ALL="all-kernel24"
718 KERNEL_MODULE_SUFFIX="o"
719 ;;
720 2.6*)
721 PCIDEV_MODULE_MAKE_ALL="all-kernel26"
722 KERNEL_MODULE_SUFFIX="ko"
723 ;;
724 *)
725 AC_MSG_ERROR([Linux kernel 2.4 or 2.6 is required])
726 ;;
727 esac
728 KERNELDIR="/lib/modules/$linux_version/build"
729 LSMOD="lsmod"
730 INSMOD="insmod"
731 RMMOD="rmmod"
732 DEPMOD="depmod"
733 AC_SUBST(KERNELDIR)
734 AC_SUBST(LSMOD)
735 AC_SUBST(INSMOD)
736 AC_SUBST(RMMOD)
737 AC_SUBST(DEPMOD)
738 AC_SUBST(PCIDEV_MODULE_MAKE_ALL)
739 AC_SUBST(KERNEL_MODULE_SUFFIX)
740 ;;
741 *)
742 AC_MSG_ERROR([PCI host device mapping requires Linux as host])
743 ;;
744 esac
745 AC_DEFINE(BX_SUPPORT_PCIDEV, 1)
746 PCI_OBJ="$PCI_OBJ pcidev.o"
747 else
748 AC_MSG_RESULT(no)
749 AC_DEFINE(BX_SUPPORT_PCIDEV, 0)
750 fi
751 ],
752 [
753 AC_MSG_RESULT(no)
754 AC_DEFINE(BX_SUPPORT_PCIDEV, 0)
755 ]
756 )
757
758 USBDEV_OBJS=''
759 SCSI_OBJS=''
760 AC_MSG_CHECKING(for limited USB support)
761 AC_ARG_ENABLE(usb,
762 [ --enable-usb enable limited USB support],
763 [if test "$enableval" = yes; then
764 AC_MSG_RESULT(yes)
765 AC_DEFINE(BX_SUPPORT_PCIUSB, 1)
766 PCI_OBJ="$PCI_OBJ pciusb.o"
767 USBDEV_OBJS="usb_hid.o usb_msd.o"
768 SCSI_OBJS="scsi_device.o"
769 else
770 AC_MSG_RESULT(no)
771 AC_DEFINE(BX_SUPPORT_PCIUSB, 0)
772 fi],
773 [
774 AC_MSG_RESULT(no)
775 AC_DEFINE(BX_SUPPORT_PCIUSB, 0)
776 ]
777 )
778
779 AC_SUBST(USBDEV_OBJS)
780 AC_SUBST(SCSI_OBJS)
781
782 AC_MSG_CHECKING(for PCI pseudo NIC support)
783 AC_ARG_ENABLE(pnic,
784 [ --enable-pnic enable PCI pseudo NIC support],
785 [if test "$enableval" = yes; then
786 AC_MSG_RESULT(yes)
787 AC_DEFINE(BX_SUPPORT_PCIPNIC, 1)
788 PCI_OBJ="$PCI_OBJ pcipnic.o"
789 networking=yes
790 else
791 AC_MSG_RESULT(no)
792 AC_DEFINE(BX_SUPPORT_PCIPNIC, 0)
793 fi],
794 [
795 AC_MSG_RESULT(no)
796 AC_DEFINE(BX_SUPPORT_PCIPNIC, 0)
797 ]
798 )
799
800 NETLOW_OBJS=''
801 if test "$networking" = yes; then
802 NETLOW_OBJS='eth.o eth_null.o eth_vnet.o'
803 AC_CHECK_HEADER(net/bpf.h, NETLOW_OBJS="$NETLOW_OBJS eth_fbsd.o")
804 AC_CHECK_HEADER(netpacket/packet.h, NETLOW_OBJS="$NETLOW_OBJS eth_linux.o")
805 case "$target" in
806 *-pc-windows* | *-pc-winnt* | *-pc-cygwin* | *-pc-mingw32*)
807 NETLOW_OBJS="$NETLOW_OBJS eth_win32.o"
808 ;;
809 *-macosx* | *-darwin*)
810 NETLOW_OBJS="$NETLOW_OBJS eth_tuntap.o"
811 AC_DEFINE(HAVE_TUNTAP, 1)
812 ;;
813 *)
814 AC_CHECK_HEADER(net/if.h, [
815 use_ethertap=yes
816 AC_DEFINE(BX_HAVE_NET_IF_H, 1)
817 ], [],
818 [
819 #include <sys/types.h>
820 #include <sys/socket.h>
821 ])
822 AC_CHECK_HEADER(linux/netlink.h, [
823 use_ethertap=yes
824 ], [],
825 [
826 #include <asm/types.h>
827 #include <sys/socket.h>
828 ])
829
830 if test "$use_ethertap" = yes; then
831 NETLOW_OBJS="$NETLOW_OBJS eth_tap.o eth_vde.o"
832 AC_DEFINE(HAVE_ETHERTAP, 1)
833 AC_DEFINE(HAVE_VDE, 1)
834 fi
835
836 AC_CHECK_HEADER(net/if_tun.h, [
837 use_tuntap=yes
838 ], [],
839 [
840 #include <sys/types.h>
841 #include <sys/socket.h>
842 #include <net/if.h>
843 ])
844 AC_CHECK_HEADER(linux/if_tun.h, [
845 use_tuntap=yes
846 ], [],
847 [
848 #include <asm/types.h>
849 #include <sys/socket.h>
850 ])
851 if test "$use_tuntap" = yes; then
852 NETLOW_OBJS="$NETLOW_OBJS eth_tuntap.o"
853 AC_DEFINE(HAVE_TUNTAP, 1)
854 fi
855
856 ;;
857 esac
858 AC_DEFINE(BX_NETWORKING, 1)
859 else
860 AC_DEFINE(BX_NETWORKING, 0)
861 fi
862
863 AC_SUBST(NETLOW_OBJS)
864
865
866 AC_MSG_CHECKING(for 4Meg pages support)
867 AC_ARG_ENABLE(4meg-pages,
868 [ --enable-4meg-pages support 4Megabyte pages extensions],
869 [if test "$enableval" = yes; then
870 AC_MSG_RESULT(yes)
871 AC_DEFINE(BX_SUPPORT_4MEG_PAGES, 1)
872 support_4M_pages=1
873 else
874 AC_MSG_RESULT(no)
875 AC_DEFINE(BX_SUPPORT_4MEG_PAGES, 0)
876 support_4M_pages=0
877 fi],
878 [
879 if test "$bx_cpu_level" -gt 4; then
880 AC_MSG_RESULT(yes)
881 AC_DEFINE(BX_SUPPORT_4MEG_PAGES, 1)
882 support_4M_pages=1
883 else
884 AC_MSG_RESULT(no)
885 AC_DEFINE(BX_SUPPORT_4MEG_PAGES, 0)
886 support_4M_pages=0
887 fi
888 ]
889 )
890
891
892 AC_MSG_CHECKING(for PAE support)
893 AC_ARG_ENABLE(pae,
894 [ --enable-pae support Physical Address Extensions],
895 [if test "$enableval" = yes; then
896 AC_MSG_RESULT(yes)
897 AC_DEFINE(BX_SUPPORT_PAE, 1)
898 support_pae=1
899 else
900 AC_MSG_RESULT(no)
901 AC_DEFINE(BX_SUPPORT_PAE, 0)
902 support_pae=0
903 fi],
904 [
905 if test "$bx_cpu_level" -gt 5; then
906 AC_MSG_RESULT(yes)
907 AC_DEFINE(BX_SUPPORT_PAE, 1)
908 support_pae=1
909 else
910 AC_MSG_RESULT(no)
911 AC_DEFINE(BX_SUPPORT_PAE, 0)
912 support_pae=0
913 fi
914 ]
915 )
916
917 AC_MSG_CHECKING(for global pages support)
918 AC_ARG_ENABLE(global-pages,
919 [ --enable-global-pages support for global pages in PDE/PTE],
920 [if test "$enableval" = yes; then
921 AC_MSG_RESULT(yes)
922 AC_DEFINE(BX_SUPPORT_GLOBAL_PAGES, 1)
923 support_global_pages=1
924 else
925 AC_MSG_RESULT(no)
926 AC_DEFINE(BX_SUPPORT_GLOBAL_PAGES, 0)
927 support_global_pages=0
928 fi],
929 [
930 if test "$bx_cpu_level" -gt 5; then
931 # enable by default
932 AC_MSG_RESULT(yes)
933 AC_DEFINE(BX_SUPPORT_GLOBAL_PAGES, 1)
934 support_global_pages=1
935 else
936 AC_MSG_RESULT(no)
937 AC_DEFINE(BX_SUPPORT_GLOBAL_PAGES, 0)
938 support_global_pages=0
939 fi
940 ]
941 )
942
943 if test "$bx_cpu_level" -lt 4 -a "$support_4M_pages" = 1; then
944 AC_MSG_ERROR([for 4M paging support the CPU level must be >= 4])
945 fi
946
947 if test "$bx_cpu_level" -lt 5 -a "$support_pae" = 1; then
948 AC_MSG_ERROR([for PAE support the CPU level must be >= 5])
949 fi
950
951 if test "$bx_cpu_level" -lt 5 -a "$support_global_pages" = 1; then
952 AC_MSG_ERROR([for Global Pages support the CPU level must be >= 5])
953 fi
954
955 AC_MSG_CHECKING(for guest to host TLB support)
956 AC_ARG_ENABLE(guest2host-tlb,
957 [ --enable-guest2host-tlb support guest to host addr TLB for speed],
958 [if test "$enableval" = yes; then
959 AC_MSG_RESULT(yes)
960 speedup_guest2host_tlb=1
961 else
962 AC_MSG_RESULT(no)
963 speedup_guest2host_tlb=0
964 fi],
965 [
966 AC_MSG_RESULT(no)
967 speedup_guest2host_tlb=0
968 ]
969 )
970
971 AC_MSG_CHECKING(for repeated IO and mem copy speedups)
972 AC_ARG_ENABLE(repeat-speedups,
973 [ --enable-repeat-speedups support repeated IO and mem copy speedups],
974 [if test "$enableval" = yes; then
975 AC_MSG_RESULT(yes)
976 speedup_repeat=1
977 else
978 AC_MSG_RESULT(no)
979 speedup_repeat=0
980 fi],
981 [
982 AC_MSG_RESULT(no)
983 speedup_repeat=0
984 ]
985 )
986
987 AC_MSG_CHECKING(for instruction cache support)
988 AC_ARG_ENABLE(icache,
989 [ --enable-icache support instruction cache],
990 [if test "$enableval" = yes; then
991 AC_MSG_RESULT(yes)
992 speedup_iCache=1
993 else
994 AC_MSG_RESULT(no)
995 speedup_iCache=0
996 fi],
997 [
998 AC_MSG_RESULT(no)
999 speedup_iCache=0
1000 ]
1001 )
1002
1003 AC_MSG_CHECKING(for gcc fast function calls optimization)
1004 AC_ARG_ENABLE(fast-function-calls,
1005 [ --enable-fast-function-calls support for fast function calls (gcc on x86 only)],
1006 [if test "$enableval" = yes; then
1007 AC_MSG_RESULT(yes)
1008 speedup_fastcall=1
1009 else
1010 AC_MSG_RESULT(no)
1011 speedup_fastcall=0
1012 fi],
1013 [
1014 AC_MSG_RESULT(no)
1015 speedup_fastcall=0
1016 ]
1017 )
1018
1019 AC_MSG_CHECKING(for host specific inline assembly accelerations)
1020 AC_ARG_ENABLE(host-specific-asms,
1021 [ --enable-host-specific-asms support for host specific inline assembly],
1022 [if test "$enableval" = yes; then
1023 AC_MSG_RESULT(yes)
1024 speedup_host_specific_asms=1
1025 else
1026 AC_MSG_RESULT(no)
1027 speedup_host_specific_asms=0
1028 fi],
1029 [
1030 AC_MSG_RESULT(yes)
1031 speedup_host_specific_asms=1
1032 ]
1033 )
1034
1035 AC_MSG_CHECKING(whether to ignore bad MSR references)
1036 AC_ARG_ENABLE(ignore-bad-msr,
1037 [ --enable-ignore-bad-msr ignore bad MSR references ],
1038 [if test "$enableval" = yes; then
1039 AC_MSG_RESULT(yes)
1040 AC_DEFINE(BX_IGNORE_BAD_MSR, 1)
1041 else
1042 AC_MSG_RESULT(no)
1043 AC_DEFINE(BX_IGNORE_BAD_MSR, 0)
1044 fi],
1045 [
1046 AC_MSG_RESULT(yes)
1047 AC_DEFINE(BX_IGNORE_BAD_MSR, 1)
1048 ]
1049 )
1050
1051 AC_MSG_CHECKING(for port e9 hack)
1052 AC_ARG_ENABLE(port-e9-hack,
1053 [ --enable-port-e9-hack writes to port e9 go to console],
1054 [if test "$enableval" = yes; then
1055 AC_MSG_RESULT(yes)
1056 AC_DEFINE(BX_PORT_E9_HACK, 1)
1057 else
1058 AC_MSG_RESULT(no)
1059 AC_DEFINE(BX_PORT_E9_HACK, 0)
1060 fi],
1061 [
1062 AC_MSG_RESULT(yes)
1063 AC_DEFINE(BX_PORT_E9_HACK, 1)
1064 ]
1065 )
1066
1067 AC_MSG_CHECKING(show IPS)
1068 AC_ARG_ENABLE(show-ips,
1069 [ --enable-show-ips show IPS in Bochs log file],
1070 [if test "$enableval" = yes; then
1071 AC_MSG_RESULT(yes)
1072 AC_DEFINE(BX_SHOW_IPS, 1)
1073 else
1074 AC_MSG_RESULT(no)
1075 AC_DEFINE(BX_SHOW_IPS, 0)
1076 fi],
1077 [
1078 AC_MSG_RESULT(no)
1079 AC_DEFINE(BX_SHOW_IPS, 0)
1080 ]
1081 )
1082
1083 AC_MSG_CHECKING(save/restore support)
1084 AC_ARG_ENABLE(save-restore,
1085 [ --enable-save-restore support for simulation save and restore],
1086 [if test "$enableval" = yes; then
1087 AC_MSG_RESULT(yes)
1088 AC_DEFINE(BX_SUPPORT_SAVE_RESTORE, 1)
1089 else
1090 AC_MSG_RESULT(no)
1091 AC_DEFINE(BX_SUPPORT_SAVE_RESTORE, 0)
1092 fi],
1093 [
1094 AC_MSG_RESULT(yes)
1095 AC_DEFINE(BX_SUPPORT_SAVE_RESTORE, 1)
1096 ]
1097 )
1098
1099 AC_MSG_CHECKING(for use of .cpp as suffix)
1100 AC_ARG_ENABLE(cpp,
1101 [ --enable-cpp use .cpp as C++ suffix],
1102 [if test "$enableval" = yes; then
1103 AC_MSG_RESULT(yes)
1104 SUFFIX_LINE='.SUFFIXES: .cpp'
1105 CPP_SUFFIX='cpp'
1106 else
1107 AC_MSG_RESULT(no)
1108 SUFFIX_LINE='.SUFFIXES: .cc'
1109 CPP_SUFFIX='cc'
1110 fi],
1111 [
1112 AC_MSG_RESULT(no)
1113 SUFFIX_LINE='.SUFFIXES: .cc'
1114 CPP_SUFFIX='cc'
1115 ]
1116 )
1117 AC_SUBST(SUFFIX_LINE)
1118 AC_SUBST(CPP_SUFFIX)
1119
1120 if test "$enable_cpp" = yes; then
1121 echo "moving .cc source files to .cpp"
1122 sourcefiles=`find . -name "*.cc" -print`
1123 if test "$sourcefiles" != ""; then
1124 for ccname in $sourcefiles
1125 do
1126 cppname=`echo $ccname | sed -e "s/\.cc$/.cpp/"`
1127 echo "mv $ccname $cppname"
1128 mv $ccname $cppname
1129 done
1130 else
1131 echo "no more .cc source files to rename"
1132 fi
1133 fi
1134
1135
1136
1137 AC_MSG_CHECKING(for Bochs internal debugger support)
1138 AC_ARG_ENABLE(debugger,
1139 [ --enable-debugger compile in support for Bochs internal debugger],
1140 [if test "$enableval" = yes; then
1141 AC_MSG_RESULT(yes)
1142 AC_DEFINE(BX_DEBUGGER, 1)
1143 DEBUGGER_VAR='$(DEBUGGER_LIB)'
1144 bx_debugger=1
1145 else
1146 AC_MSG_RESULT(no)
1147 AC_DEFINE(BX_DEBUGGER, 0)
1148 DEBUGGER_VAR=''
1149 bx_debugger=0
1150 fi
1151 ],
1152 [
1153 AC_MSG_RESULT(no)
1154 AC_DEFINE(BX_DEBUGGER, 0)
1155 DEBUGGER_VAR=''
1156 bx_debugger=0
1157 ]
1158 )
1159 AC_SUBST(DEBUGGER_VAR)
1160
1161 AC_MSG_CHECKING(for external debugger)
1162 EXT_DEBUG_OBJS=''
1163 AC_ARG_ENABLE(external-debugger,
1164 [ --enable-external-debugger enable external debugger support (win32 only)],
1165 [if test "$enableval" = yes; then
1166 case $target in
1167 *-pc-windows* | *-cygwin* | *-mingw32*)
1168 AC_MSG_RESULT(yes)
1169 AC_DEFINE(BX_EXTERNAL_DEBUGGER, 1)
1170 EXT_DEBUG_OBJS=extdb.o
1171 ;;
1172 *)
1173 echo "ERROR: external debugger is currently supported on win32 only"
1174 exit 1
1175 ;;
1176 esac
1177 else
1178 AC_MSG_RESULT(no)
1179 fi],
1180 [
1181 AC_MSG_RESULT(no)
1182 ])
1183 AC_SUBST(BX_EXTERNAL_DEBUGGER)
1184
1185 AC_MSG_CHECKING(for magic breakpoints)
1186 AC_ARG_ENABLE(magic-breakpoints,
1187 [ --enable-magic-breakpoints enable magic debugger breakpoints],
1188 [if test "$enableval" = yes; then
1189 AC_MSG_RESULT(yes)
1190 AC_DEFINE(BX_MAGIC_BREAKPOINT, 1)
1191 else
1192 AC_MSG_RESULT(no)
1193 AC_DEFINE(BX_MAGIC_BREAKPOINT, 0)
1194 fi],
1195 [
1196 if test "$bx_debugger" = 1; then
1197 AC_MSG_RESULT(yes)
1198 AC_DEFINE(BX_MAGIC_BREAKPOINT, 1)
1199 else
1200 AC_MSG_RESULT(no)
1201 AC_DEFINE(BX_MAGIC_BREAKPOINT, 0)
1202 fi
1203 ])
1204 AC_SUBST(BX_MAGIC_BREAKPOINT)
1205
1206 AC_MSG_CHECKING(for disassembler support)
1207 AC_ARG_ENABLE(disasm,
1208 [ --enable-disasm compile in support for disassembler],
1209 [if test "$enableval" = yes; then
1210 AC_MSG_RESULT(yes)
1211 AC_DEFINE(BX_DISASM, 1)
1212 DISASM_VAR='$(DISASM_LIB)'
1213 else
1214 AC_MSG_RESULT(no)
1215 if test "$bx_debugger" = 1; then
1216 echo "ERROR: debugger is enabled, so --enable-disasm is required"
1217 exit 1
1218 fi
1219 AC_DEFINE(BX_DISASM, 0)
1220 DISASM_VAR=''
1221 fi],
1222 [
1223 AC_MSG_RESULT(yes)
1224 AC_DEFINE(BX_DISASM, 1)
1225 DISASM_VAR='$(DISASM_LIB)'
1226 ])
1227 AC_SUBST(DISASM_VAR)
1228
1229 AC_MSG_CHECKING(for ALL optimizations enabled)
1230 AC_ARG_ENABLE(all-optimizations,
1231 [ --enable-all-optimizations compile in all possible optimizations],
1232 [if test "$enableval" = yes; then
1233 AC_MSG_RESULT(yes)
1234 speedups_all=1
1235 else
1236 AC_MSG_RESULT(no)
1237 speedups_all=0
1238 fi
1239 ],
1240 [
1241 AC_MSG_RESULT(no)
1242 speedups_all=0
1243 ]
1244 )
1245
1246 #
1247 # Optimizations section. Decide what the status of various optimizations
1248 # should be based on configure choices and other factors.
1249 #
1250
1251 if test "$speedups_all" = 1; then
1252 # Configure requested to force all options enabled.
1253 speedup_guest2host_tlb=1
1254 speedup_repeat=1
1255 speedup_iCache=1
1256 speedup_host_specific_asms=1
1257 speedup_fastcall=1
1258 fi
1259
1260 if test "$speedup_guest2host_tlb" = 1; then
1261 AC_DEFINE(BX_SupportGuest2HostTLB, 1)
1262 else
1263 AC_DEFINE(BX_SupportGuest2HostTLB, 0)
1264 fi
1265
1266 if test "$speedup_repeat" = 1; then
1267 AC_DEFINE(BX_SupportRepeatSpeedups, 1)
1268 else
1269 AC_DEFINE(BX_SupportRepeatSpeedups, 0)
1270 fi
1271
1272 if test "$speedup_iCache" = 1; then
1273 AC_DEFINE(BX_SUPPORT_ICACHE, 1)
1274 else
1275 AC_DEFINE(BX_SUPPORT_ICACHE, 0)
1276 fi
1277
1278 if test "$speedup_host_specific_asms" = 1; then
1279 AC_DEFINE(BX_SupportHostAsms, 1)
1280 else
1281 AC_DEFINE(BX_SupportHostAsms, 0)
1282 fi
1283
1284 if test "$speedup_fastcall" = 1; then
1285 AC_DEFINE(BX_FAST_FUNC_CALL, 1)
1286 else
1287 AC_DEFINE(BX_FAST_FUNC_CALL, 0)
1288 fi
1289
1290
1291 READLINE_LIB=""
1292 rl_without_curses_ok=no
1293 rl_with_curses_ok=no
1294
1295 AC_MSG_CHECKING(whether user wants readline)
1296 AC_ARG_ENABLE(readline,
1297 [ --enable-readline use readline library, if available],
1298 [if test "$enableval" = yes; then
1299 AC_MSG_RESULT(yes)
1300 want_readline=yes
1301 else
1302 AC_MSG_RESULT(no)
1303 want_readline=no
1304 fi],
1305 [
1306 AC_MSG_RESULT(yes)
1307 want_readline=yes
1308 ]
1309 )
1310
1311 use_readline=0
1312 AC_MSG_CHECKING(whether to use readline)
1313 if test "$want_readline" = yes; then
1314 if test "$bx_debugger" = 1; then
1315
1316 AC_MSG_CHECKING(if readline works without -lcurses)
1317 OLD_LIBS=$LIBS
1318 LIBS="$LIBS -lreadline"
1319 AC_TRY_RUN([
1320 #include <stdio.h>
1321 #include <readline/readline.h>
1322 int main() { rl_initialize(); exit(0); }
1323 ],
1324 [ AC_MSG_RESULT(yes)
1325 rl_without_curses_ok=yes ],
1326 [ AC_MSG_RESULT(no) ]
1327 )
1328 AC_MSG_CHECKING(if readline works with -lcurses)
1329 LIBS="$LIBS -lcurses"
1330 AC_TRY_RUN([
1331 #include <stdio.h>
1332 #include <readline/readline.h>
1333 int main() { rl_initialize(); exit(0); }
1334 ],
1335 [AC_MSG_RESULT(yes)
1336 rl_with_curses_ok=yes ],
1337 [ AC_MSG_RESULT(no) ]
1338 )
1339 LIBS=$OLD_LIBS
1340
1341 if test "$rl_without_curses_ok" = yes; then
1342 AC_MSG_RESULT(yes)
1343 AC_DEFINE(HAVE_LIBREADLINE, 1)
1344 READLINE_LIB="-lreadline"
1345 use_readline=1
1346 elif test "$rl_with_curses_ok" = yes; then
1347 AC_MSG_RESULT(yes)
1348 AC_DEFINE(HAVE_LIBREADLINE, 1)
1349 READLINE_LIB="-lreadline -lcurses"
1350 use_readline=1
1351 else
1352 AC_MSG_RESULT(no)
1353 echo WARNING: The readline library was disabled because it was not found.
1354 fi
1355 else
1356 AC_MSG_RESULT(no)
1357 fi
1358 else
1359 AC_MSG_RESULT(no)
1360 fi
1361 AC_SUBST(READLINE_LIB)
1362
1363 AC_CHECK_HEADER(readline/history.h,
1364 AC_DEFINE(HAVE_READLINE_HISTORY_H)
1365 )
1366
1367 INSTRUMENT_DIR='instrument/stubs'
1368
1369 AC_MSG_CHECKING(for instrumentation support)
1370 AC_ARG_ENABLE(instrumentation,
1371 [ --enable-instrumentation compile in support for instrumentation],
1372 [if test "$enableval" = yes; then
1373 AC_MSG_RESULT(yes)
1374 AC_DEFINE(BX_INSTRUMENTATION, 1)
1375 INSTRUMENT_VAR='$(INSTRUMENT_LIB)'
1376 elif test "$enableval" = no; then
1377 AC_MSG_RESULT(no)
1378 AC_DEFINE(BX_INSTRUMENTATION, 0)
1379 INSTRUMENT_VAR=''
1380 else
1381 AC_MSG_RESULT(yes)
1382 AC_DEFINE(BX_INSTRUMENTATION, 1)
1383 INSTRUMENT_DIR=$enableval
1384 INSTRUMENT_VAR='$(INSTRUMENT_LIB)'
1385 fi],
1386 [
1387 AC_MSG_RESULT(no)
1388 AC_DEFINE(BX_INSTRUMENTATION, 0)
1389 INSTRUMENT_VAR=''
1390 ]
1391 )
1392 AC_SUBST(INSTRUMENT_DIR)
1393 AC_SUBST(INSTRUMENT_VAR)
1394
1395 dnl // serial mode 'socket' needs wsock32.dll in non-plugin mode
1396 if test "$bx_plugins" = 0; then
1397 case $target in
1398 *-pc-windows*)
1399 DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS wsock32.lib"
1400 ;;
1401 *-cygwin* | *-mingw32*)
1402 DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS -lwsock32"
1403 ;;
1404 esac
1405 fi
1406
1407 AC_MSG_CHECKING(for raw serial support)
1408 AC_ARG_ENABLE(raw-serial,
1409 [ --enable-raw-serial use raw serial port access],
1410 [if test "$enableval" = yes; then
1411 AC_MSG_RESULT(yes)
1412 AC_DEFINE(USE_RAW_SERIAL, 1)
1413 else
1414 AC_MSG_RESULT(no)
1415 AC_DEFINE(USE_RAW_SERIAL, 0)
1416 fi],
1417 [
1418 AC_MSG_RESULT(no)
1419 AC_DEFINE(USE_RAW_SERIAL, 0)
1420 ]
1421 )
1422
1423 AC_MSG_CHECKING(for VESA BIOS extensions)
1424 AC_ARG_ENABLE(vbe,
1425 [ --enable-vbe use VESA BIOS extensions],
1426 [if test "$enableval" = yes; then
1427 AC_MSG_RESULT(yes)
1428 AC_DEFINE(BX_SUPPORT_VBE, 1)
1429 if test "$pci" = 1; then
1430 AC_DEFINE(BX_SUPPORT_PCIVGA, 1)
1431 fi
1432 else
1433 AC_MSG_RESULT(no)
1434 AC_DEFINE(BX_SUPPORT_VBE, 0)
1435 fi],
1436 [
1437 AC_MSG_RESULT(yes)
1438 AC_DEFINE(BX_SUPPORT_VBE, 1)
1439 if test "$pci" = 1; then
1440 AC_DEFINE(BX_SUPPORT_PCIVGA, 1)
1441 fi
1442 ]
1443 )
1444
1445 AC_MSG_CHECKING(for CLGD54XX emulation)
1446 AC_ARG_ENABLE(clgd54xx,
1447 [ --enable-clgd54xx enable CLGD54XX emulation],
1448 [if test "$enableval" = yes; then
1449 AC_MSG_RESULT(yes)
1450 AC_DEFINE(BX_SUPPORT_CLGD54XX, 1)
1451 if test "$pci" = 1; then
1452 AC_DEFINE(BX_SUPPORT_CLGD54XX_PCI, 1)
1453 fi
1454 else
1455 AC_MSG_RESULT(no)
1456 AC_DEFINE(BX_SUPPORT_CLGD54XX, 0)
1457 fi],
1458 [
1459 AC_MSG_RESULT(no)
1460 AC_DEFINE(BX_SUPPORT_CLGD54XX, 0)
1461 ]
1462 )
1463
1464 support_fpu=1
1465 AC_MSG_CHECKING(for FPU emulation)
1466 FPU_VAR=''
1467 AC_ARG_ENABLE(fpu,
1468 [ --enable-fpu compile in FPU emulation],
1469 [if test "$enableval" = yes; then
1470 AC_MSG_RESULT(yes)
1471 AC_DEFINE(BX_SUPPORT_FPU, 1)
1472 FPU_VAR='$(FPU_LIB)'
1473 elif test "$enableval" = no; then
1474 AC_MSG_RESULT(no)
1475 AC_DEFINE(BX_SUPPORT_FPU, 0)
1476 support_fpu=0
1477 else
1478 echo " "
1479 echo "ERROR: --enable-fpu does not accept a path"
1480 exit 1
1481 fi
1482 ],
1483 [
1484 AC_MSG_RESULT(yes)
1485 AC_DEFINE(BX_SUPPORT_FPU, 1)
1486 FPU_VAR='$(FPU_LIB)'
1487 ]
1488 )
1489 AC_SUBST(FPU_VAR)
1490
1491 AC_MSG_CHECKING(for VME support)
1492 AC_ARG_ENABLE(vme,
1493 [ --enable-vme virtual 8086 mode extensions],
1494 [if test "$enableval" = yes; then
1495 AC_MSG_RESULT(yes)
1496 AC_DEFINE(BX_SUPPORT_VME, 1)
1497 elif test "$enableval" = no; then
1498 AC_MSG_RESULT(no)
1499 AC_DEFINE(BX_SUPPORT_VME, 0)
1500 fi
1501 ],
1502 [
1503 if test "$bx_cpu_level" -ge 5; then
1504 AC_MSG_RESULT(yes)
1505 AC_DEFINE(BX_SUPPORT_VME, 1)
1506 fi
1507 ]
1508 )
1509
1510 support_mmx=1
1511 AC_MSG_CHECKING(for MMX support)
1512 AC_ARG_ENABLE(mmx,
1513 [ --enable-mmx MMX support],
1514 [if test "$enableval" = yes; then
1515 AC_MSG_RESULT(yes)
1516 AC_DEFINE(BX_SUPPORT_MMX, 1)
1517 elif test "$enableval" = no; then
1518 AC_MSG_RESULT(no)
1519 AC_DEFINE(BX_SUPPORT_MMX, 0)
1520 support_mmx=0
1521 fi
1522 ],
1523 [
1524 if test "$bx_cpu_level" -ge 5; then
1525 AC_MSG_RESULT(yes)
1526 AC_DEFINE(BX_SUPPORT_MMX, 1)
1527 fi
1528 ]
1529 )
1530
1531 AC_MSG_CHECKING(for 3DNow! support)
1532 AC_ARG_ENABLE(3dnow,
1533 [ --enable-3dnow 3DNow! support],
1534 [if test "$enableval" = yes; then
1535 AC_MSG_RESULT(yes)
1536 AC_DEFINE(BX_SUPPORT_3DNOW, 1)
1537 elif test "$enableval" = no; then
1538 AC_MSG_RESULT(no)
1539 AC_DEFINE(BX_SUPPORT_3DNOW, 0)
1540 fi
1541 ],
1542 [
1543 AC_MSG_RESULT(no)
1544 AC_DEFINE(BX_SUPPORT_3DNOW, 0)
1545 ]
1546 )
1547
1548 support_sse=0
1549 AC_MSG_CHECKING(for SSE support)
1550 AC_ARG_ENABLE(sse,
1551 [ --enable-sse SSE support (--enable-sse=[no|1|2|3|4])],
1552 [case "$enableval" in
1553 no | 0)
1554 support_sse=0
1555 AC_MSG_RESULT(no)
1556 ;;
1557 yes | 1)
1558 support_sse=1
1559 AC_MSG_RESULT(SSE1)
1560 ;;
1561 2)
1562 support_sse=2
1563 AC_MSG_RESULT(SSE2)
1564 ;;
1565 3)
1566 support_sse=3
1567 AC_MSG_RESULT(SSE3)
1568 ;;
1569 4)
1570 support_sse=4
1571 AC_MSG_RESULT(SSE4)
1572 ;;
1573 *)
1574 echo "ERROR: --enable-sse=$enableval not understood. Use --enable-sse=[no|1|2|3|4]"
1575 exit 1
1576 ;;
1577 esac
1578 ],
1579 [
1580 if test "$use_x86_64" = 1; then
1581 support_sse=2
1582 AC_MSG_RESULT(SSE2)
1583 else
1584 AC_MSG_RESULT(no)
1585 fi
1586 ]
1587 )
1588
1589 if test "$support_sse" -gt 0 -a "$bx_cpu_level" -lt 6; then
1590 AC_MSG_ERROR([for SSE support the CPU level must be set to 6])
1591 fi
1592
1593 if test "$support_sse" -lt 2 -a "$use_x86_64" = 1; then
1594 AC_MSG_ERROR([x86-64 needs SSE2 support])
1595 fi
1596
1597 if test "$support_sse" = 4; then
1598 AC_DEFINE(BX_SUPPORT_SSE, 4)
1599 elif test "$support_sse" = 3; then
1600 AC_DEFINE(BX_SUPPORT_SSE, 3)
1601 elif test "$support_sse" = 2; then
1602 AC_DEFINE(BX_SUPPORT_SSE, 2)
1603 elif test "$support_sse" = 1; then
1604 AC_DEFINE(BX_SUPPORT_SSE, 1)
1605 else
1606 AC_DEFINE(BX_SUPPORT_SSE, 0)
1607 fi
1608
1609 AC_MSG_CHECKING(for SSE extensions support)
1610 AC_ARG_ENABLE(sse-extension,
1611 [ --enable-sse-extension support for SSE extensions],
1612 [if test "$enableval" = yes; then
1613 AC_MSG_RESULT(yes)
1614 AC_DEFINE(BX_SUPPORT_SSE_EXTENSION, 1)
1615 elif test "$enableval" = no; then
1616 AC_MSG_RESULT(no)
1617 AC_DEFINE(BX_SUPPORT_SSE_EXTENSION, 0)
1618 fi
1619 ],
1620 [
1621 AC_MSG_RESULT(no)
1622 AC_DEFINE(BX_SUPPORT_SSE_EXTENSION, 0)
1623 ]
1624 )
1625
1626 AC_MSG_CHECKING(for DAZ support)
1627 AC_ARG_ENABLE(daz,
1628 [ --enable-daz denormals-are-zeroes support],
1629 [if test "$enableval" = yes; then
1630 AC_MSG_RESULT(yes)
1631 AC_DEFINE(BX_SUPPORT_DAZ, 1)
1632 elif test "$enableval" = no; then
1633 AC_MSG_RESULT(no)
1634 AC_DEFINE(BX_SUPPORT_DAZ, 0)
1635 fi
1636 ],
1637 [
1638 if test "$support_sse" -ge 2; then
1639 AC_MSG_RESULT(yes)
1640 AC_DEFINE(BX_SUPPORT_DAZ, 1)
1641 else
1642 AC_MSG_RESULT(no)
1643 AC_DEFINE(BX_SUPPORT_DAZ, 0)
1644 fi
1645 ]
1646 )
1647
1648 AC_MSG_CHECKING(for alignment check support)
1649 AC_ARG_ENABLE(alignment-check,
1650 [ --enable-alignment-check alignment check (#AC) support],
1651 [if test "$enableval" = yes; then
1652 AC_MSG_RESULT(yes)
1653 AC_DEFINE(BX_SUPPORT_ALIGNMENT_CHECK, 1)
1654 elif test "$enableval" = no; then
1655 AC_MSG_RESULT(no)
1656 AC_DEFINE(BX_SUPPORT_ALIGNMENT_CHECK, 0)
1657 fi
1658 ],
1659 [
1660 AC_MSG_RESULT(no)
1661 AC_DEFINE(BX_SUPPORT_ALIGNMENT_CHECK, 0)
1662 ]
1663 )
1664
1665 AC_MSG_CHECKING(for misaligned SSE support)
1666 AC_ARG_ENABLE(misaligned-sse,
1667 [ --enable-misaligned-sse misaligned SSE support],
1668 [if test "$enableval" = yes; then
1669 AC_MSG_RESULT(yes)
1670 AC_DEFINE(BX_SUPPORT_MISALIGNED_SSE, 1)
1671 elif test "$enableval" = no; then
1672 AC_MSG_RESULT(no)
1673 AC_DEFINE(BX_SUPPORT_MISALIGNED_SSE, 0)
1674 fi
1675 ],
1676 [
1677 AC_MSG_RESULT(no)
1678 AC_DEFINE(BX_SUPPORT_MISALIGNED_SSE, 0)
1679 ]
1680 )
1681
1682 AC_MSG_CHECKING(for SEP support)
1683 AC_ARG_ENABLE(sep,
1684 [ --enable-sep SYSENTER/SYSEXIT support],
1685 [if test "$enableval" = yes; then
1686 AC_MSG_RESULT(yes)
1687 AC_DEFINE(BX_SUPPORT_SEP, 1)
1688 elif test "$enableval" = no; then
1689 AC_MSG_RESULT(no)
1690 AC_DEFINE(BX_SUPPORT_SEP, 0)
1691 fi
1692 ],
1693 [
1694 if test "$bx_cpu_level" -ge 6 -a "$support_mmx" = 1; then
1695 AC_MSG_RESULT(yes)
1696 AC_DEFINE(BX_SUPPORT_SEP, 1)
1697 else
1698 AC_MSG_RESULT(no)
1699 AC_DEFINE(BX_SUPPORT_SEP, 0)
1700 fi
1701 ]
1702 )
1703
1704 AC_MSG_CHECKING(for x86 debugger support)
1705 AC_ARG_ENABLE(x86-debugger,
1706 [ --enable-x86-debugger x86 debugger support],
1707 [if test "$enableval" = yes; then
1708 AC_MSG_RESULT(yes)
1709 AC_DEFINE(BX_X86_DEBUGGER, 1)
1710 elif test "$enableval" = no; then
1711 AC_MSG_RESULT(no)
1712 AC_DEFINE(BX_X86_DEBUGGER, 0)
1713 else
1714 AC_MSG_RESULT(yes)
1715 AC_DEFINE(BX_X86_DEBUGGER, 1)
1716 fi],
1717 [
1718 AC_MSG_RESULT(no)
1719 AC_DEFINE(BX_X86_DEBUGGER, 0)
1720 ]
1721 )
1722
1723 AC_CHECK_HEADER(IOKit/storage/IOCDMedia.h,
1724 can_use_osx_cdrom=yes
1725 )
1726
1727 AC_MSG_CHECKING(for CDROM support)
1728 AC_ARG_ENABLE(cdrom,
1729 [ --enable-cdrom CDROM support],
1730 [if test "$enableval" = no; then
1731 bx_cdrom=0
1732 else
1733 bx_cdrom=1
1734 fi],
1735 [ bx_cdrom=1 ]
1736 )
1737
1738 if test "$bx_cdrom" = 1; then
1739 AC_MSG_RESULT(yes)
1740 CDROM_OBJS='cdrom.o'
1741 if test "$with_amigaos" = yes; then
1742 # use the amiga cdrom file instead.
1743 CDROM_OBJS="cdrom_amigaos.o"
1744 elif test "$can_use_osx_cdrom" = yes; then
1745 # use cdrom_osx
1746 AC_MSG_RESULT(Using OSX IOKit CD Interface)
1747 CDROM_OBJS="cdrom.o"
1748 EXTRA_LINK_OPTS="${EXTRA_LINK_OPTS} -framework IOKit -framework CoreFoundation "'$(GUI_LINK_OPTS)'
1749 fi
1750 case $target in
1751 *-beos*)
1752 # use the beos cdrom file instead
1753 CDROM_OBJS="$CDROM_OBJS cdrom_beos.o"
1754 esac
1755 AC_DEFINE(BX_SUPPORT_CDROM, 1)
1756 else
1757 AC_MSG_RESULT(no)
1758 CDROM_OBJS=''
1759 AC_DEFINE(BX_SUPPORT_CDROM, 0)
1760 fi
1761
1762 AC_SUBST(CDROM_OBJS)
1763
1764
1765 AC_MSG_CHECKING(for Sound Blaster 16 support)
1766 SB16_OBJS=''
1767 SOUNDLOW_OBJS=''
1768 GAME_OBJS=''
1769 gameport_present=0
1770 AC_ARG_ENABLE(sb16,
1771 [ --enable-sb16=xxx Sound Blaster 16 Support (xxx=dummy|win|linux|freebsd|osx)],
1772 [if test "$enableval" = no; then
1773 AC_MSG_RESULT(no)
1774 AC_DEFINE(BX_SUPPORT_SB16, 0)
1775 else
1776 case "$enableval" in
1777 dummy)
1778 SOUNDLOW_OBJS=''
1779 AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_output_c)
1780 AC_MSG_RESULT(dummy)
1781 ;;
1782 freebsd|linux)
1783 SOUNDLOW_OBJS='soundlnx.o'
1784 AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_linux_c)
1785 AC_MSG_RESULT(linux)
1786 ;;
1787 win)
1788 SOUNDLOW_OBJS='soundwin.o'
1789 AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_windows_c)
1790 AC_MSG_RESULT(win)
1791 case $target in
1792 *-pc-windows*)
1793 DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS winmm.lib"
1794 ;;
1795 *)
1796 DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS -lwinmm"
1797 ;;
1798 esac
1799 ;;
1800 osx)
1801 SOUNDLOW_OBJS='soundosx.o'
1802 AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_osx_c)
1803 AC_MSG_RESULT(osx)
1804 DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS -framework AudioUnit -framework AudioToolbox"
1805 ;;
1806 yes)
1807 case "$target" in
1808 *-linux* | *-freebsd*)
1809 SOUNDLOW_OBJS='soundlnx.o'
1810 AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_linux_c)
1811 AC_MSG_RESULT(linux)
1812 ;;
1813 *-pc-windows*)
1814 SOUNDLOW_OBJS='soundwin.o'
1815 AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_windows_c)
1816 AC_MSG_RESULT(win)
1817 DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS winmm.lib"
1818 ;;
1819 *-cygwin* | *-mingw32*)
1820 SOUNDLOW_OBJS='soundwin.o'
1821 AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_windows_c)
1822 AC_MSG_RESULT(win)
1823 DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS -lwinmm"
1824 ;;
1825 *-macosx* | *-macos*)
1826 SOUNDLOW_OBJS='soundosx.o'
1827 AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_osx_c)
1828 AC_MSG_RESULT(osx)
1829 DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS -framework AudioUnit -framework AudioToolbox"
1830 ;;
1831 *)
1832 SOUNDLOW_OBJS=''
1833 AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_output_c)
1834 AC_MSG_RESULT(dummy)
1835 ;;
1836 esac
1837 ;;
1838 *)
1839 echo " "
1840 echo \!\!\!Error\!\!\!
1841 echo "You must pass one of dummy, linux, win, freebsd, osx to --enable-sb16"
1842 exit 1 ;;
1843 esac
1844 SB16_OBJS='sb16.o'
1845 AC_DEFINE(BX_SUPPORT_SB16, 1)
1846 GAME_OBJS='gameport.o'
1847 gameport_present=1
1848 fi],
1849
1850 [
1851 AC_MSG_RESULT(no)
1852 AC_DEFINE(BX_SUPPORT_SB16, 0)
1853 ]
1854 )
1855 AC_SUBST(SB16_OBJS)
1856 AC_SUBST(SOUNDLOW_OBJS)
1857
1858
1859 AC_MSG_CHECKING(for standard PC gameport support)
1860 AC_ARG_ENABLE(gameport,
1861 [ --enable-gameport enable standard PC gameport support],
1862 [if test "$enableval" = yes; then
1863 AC_MSG_RESULT(yes)
1864 AC_DEFINE(BX_SUPPORT_GAMEPORT, 1)
1865 if test "$gameport_present" = 0; then
1866 GAME_OBJS='gameport.o'
1867 case $target in
1868 *-cygwin* | *-mingw32*)
1869 DEVICE_LINK_OPTS="$DEVICE_LINK_OPTS -lwinmm"
1870 ;;
1871 esac
1872 fi
1873 else
1874 AC_MSG_RESULT(no)
1875 GAME_OBJS=''
1876 AC_DEFINE(BX_SUPPORT_GAMEPORT, 0)
1877 fi],
1878 [
1879 if test "$gameport_present" = 1; then
1880 AC_DEFINE(BX_SUPPORT_GAMEPORT, 1)
1881 AC_MSG_RESULT(yes)
1882 else
1883 AC_DEFINE(BX_SUPPORT_GAMEPORT, 0)
1884 AC_MSG_RESULT(no)
1885 fi]
1886 )
1887 AC_SUBST(GAME_OBJS)
1888
1889
1890 AC_MSG_CHECKING(for gdb stub enable)
1891 AC_ARG_ENABLE(gdb-stub,
1892 [ --enable-gdb-stub enable gdb stub support],
1893 [if test "$enableval" = yes; then
1894 AC_MSG_RESULT(yes)
1895 AC_DEFINE(BX_GDBSTUB, 1)
1896 GDBSTUB_VAR='$(GDBSTUB_OBJS)'
1897 if test "$bx_debugger" = 1; then
1898 AC_MSG_ERROR([[--enable-debugger and --enable-gdb-stub are mutually exclusive]])
1899 fi
1900 else
1901 AC_MSG_RESULT(no)
1902 AC_DEFINE(BX_GDBSTUB, 0)
1903 GDBSTUB_VAR=''
1904 fi],
1905 [
1906 AC_MSG_RESULT(no)
1907 AC_DEFINE(BX_GDBSTUB, 0)
1908 GDBSTUB_VAR=''
1909 ]
1910 )
1911 AC_SUBST(GDBSTUB_VAR)
1912
1913
1914 AC_MSG_CHECKING(for I/O Interface to the debugger)
1915 IODEBUG_OBJS=''
1916 AC_ARG_ENABLE(iodebug,
1917 [ --enable-iodebug enable I/O interface to debugger],
1918 [if test "$enableval" = yes; then
1919 AC_MSG_RESULT(yes)
1920 AC_DEFINE(BX_SUPPORT_IODEBUG, 1)
1921 IODEBUG_OBJS='iodebug.o'
1922 else
1923 AC_MSG_RESULT(no)
1924 AC_DEFINE(BX_SUPPORT_IODEBUG, 0)
1925 fi
1926 ],
1927 [
1928 if test "" = 1; then
1929 # enable by default if debugger is on
1930 AC_MSG_RESULT(yes)
1931 AC_DEFINE(BX_SUPPORT_IODEBUG, 1)
1932 IODEBUG_OBJS='iodebug.o'
1933 else
1934 AC_MSG_RESULT(no)
1935 fi
1936 ]
1937 )
1938 AC_SUBST(IODEBUG_OBJS)
1939
1940
1941 AC_PATH_PROG(DOCBOOK2HTML, docbook2html, not_found)
1942 AC_MSG_CHECKING(whether to build docbook documentation)
1943 build_docbook=0
1944 AC_ARG_ENABLE(docbook,
1945 [ --enable-docbook build the Docbook documentation],
1946 [
1947 if test "$enableval" = yes; then build_docbook=1; fi
1948 ],
1949 [
1950 dnl Not specified. If they have docbook2html, then yes.
1951 if test "$DOCBOOK2HTML" != not_found; then build_docbook=1; fi
1952 ]
1953 )
1954
1955 if test $build_docbook = 1; then
1956 AC_MSG_RESULT(yes)
1957 BUILD_DOCBOOK_VAR=build_docbook
1958 INSTALL_DOCBOOK_VAR=install_docbook
1959 if test "$DOCBOOK2HTML" = not_found; then
1960 echo "ERROR: docbook2html must be installed to build the documentation"
1961 exit 1
1962 fi
1963 else
1964 AC_MSG_RESULT(no)
1965 fi
1966 AC_SUBST(BUILD_DOCBOOK_VAR)
1967 AC_SUBST(INSTALL_DOCBOOK_VAR)
1968 AC_SUBST(DOCBOOK2HTML)
1969
1970 PRIMARY_TARGET='bochs'
1971 PLUGIN_LIBNAME_TRANSFORMATION='%.o=libbx_%.la'
1972
1973 AC_DEFINE(BX_PROVIDE_DEVICE_MODELS, 1)
1974 IODEV_LIB_VAR='iodev/libiodev.a'
1975 AC_DEFINE(BX_PROVIDE_CPU_MEMORY, 1)
1976 NONINLINE_VAR='$(NONINLINE_OBJS)'
1977
1978 AC_SUBST(IODEV_LIB_VAR)
1979 AC_SUBST(EXTRA_BX_OBJS)
1980 AC_SUBST(NONINLINE_VAR)
1981 AC_SUBST(INLINE_VAR)
1982 AC_SUBST(EXTERNAL_DEPENDENCY)
1983 AC_SUBST(EXT_DEBUG_OBJS)
1984 AC_SUBST(RC_CMD)
1985
1986
1987 AC_ARG_WITH(x11,
1988 [ --with-x11 use X11 GUI],
1989 )
1990
1991 AC_ARG_WITH(beos,
1992 [ --with-beos use BeOS GUI],
1993 )
1994
1995 AC_ARG_WITH(win32,
1996 [ --with-win32 use Win32 GUI],
1997 )
1998
1999 AC_ARG_WITH(macos,
2000 [ --with-macos use Macintosh/CodeWarrior environment],
2001 )
2002
2003 AC_ARG_WITH(carbon,
2004 [ --with-carbon compile for MacOS X with Carbon GUI],
2005 )
2006
2007 AC_ARG_WITH(nogui,
2008 [ --with-nogui no native GUI, just use blank stubs],
2009 )
2010
2011 AC_ARG_WITH(term,
2012 [ --with-term textmode terminal environment],
2013 )
2014
2015 AC_ARG_WITH(rfb,
2016 [ --with-rfb use RFB protocol, works with VNC viewer],
2017 )
2018
2019 AC_ARG_WITH(amigaos,
2020 [ --with-amigaos use AmigaOS (or MorphOS) GUI],
2021 )
2022
2023 AC_ARG_WITH(sdl,
2024 [ --with-sdl use SDL libraries],
2025 )
2026
2027 AC_ARG_WITH(svga,
2028 [ --with-svga use SVGALib libraries],
2029 )
2030
2031 AC_ARG_WITH(wx,
2032 [ --with-wx use wxWidgets libraries],
2033 )
2034
2035 AC_ARG_WITH(all-libs,
2036 [ --with-all-libs compile all guis that Bochs supports],
2037 )
2038
2039 dnl // DASH is option prefix for your platform
2040 dnl // SLASH is directory for your platform
2041 dnl // CXXFP is C++ File Prefix; the flag that tells the compiler
2042 dnl // this is a C++ source file
2043 dnl // CFP is C File Prefix; the flag that tells the compiler
2044 dnl // this is a C source file
2045 dnl // OFP is Object File Prefix; the flag that tells the compiler
2046 dnl // generate an object file with this name
2047 DASH="-"
2048 SLASH="/"
2049 CXXFP=""
2050 CFP=""
2051 OFP="-o "
2052 MAKELIB="ar rv \$@"
2053 RMCOMMAND="rm -f "
2054 # first define link variables without libtool
2055 LINK="\$(CXX) -o \$@ \$(CXXFLAGS) \$(LDFLAGS)"
2056 LINK_CONSOLE="\$(CXX) -o \$@ \$(CXXFLAGS_CONSOLE) \$(LDFLAGS)"
2057 # unless NO_LT is set, add libtool to the front of the link command
2058 if test "$NO_LT" != 1; then
2059 LINK="\$(LIBTOOL) --mode=link $LINK"
2060 LINK_CONSOLE="\$(LIBTOOL) --mode=link $LINK_CONSOLE"
2061 fi
2062 EXE=""
2063 COMMAND_SEPARATOR="&& \\"
2064 CD_UP_ONE="echo done"
2065 CD_UP_TWO="echo done"
2066 CD_UP_THREE="echo done"
2067
2068 INSTALL_TARGET=install_unix
2069 INSTALL_LIST_FOR_PLATFORM=
2070
2071 # check for existence of and usable version of wxWidgets. This comes
2072 # early so that it could affect which one gets chosen.
2073 if test x$WX_CONFIG = x; then
2074 AC_CHECK_PROG(WX_CONFIG, [ wx-config --version ], wx-config, not_found)
2075 fi
2076 AC_MSG_CHECKING(for wxWidgets configuration script)
2077 AC_MSG_RESULT($WX_CONFIG)
2078
2079 ok_wx_version=0
2080 wx_multi_lib=0
2081 wx_needs_gtk2=0
2082 AC_MSG_CHECKING(for wxWidgets library version)
2083 if test x$WX_CONFIG != xnot_found; then
2084 WX_VERSION=`$WX_CONFIG --version`
2085 WX_BASENAME=`$WX_CONFIG --basename`
2086 [
2087 # test that version >= 2.3.2. Anybody have a better way to do this? Yuck.
2088 case x$WX_VERSION in
2089 x2.[012]*) ;; # less than version 2.3.x
2090 x2.3.[01]) ;; # less than version 2.3.2
2091 x2.3.[2-4]*) ok_wx_version=1 ;; # 2.3.2 or greater
2092 x2.[4-5]*) ok_wx_version=1 ;; # version 2.4 / 2.5
2093 x2.[6-9]*) # version 2.6 or greater
2094 ok_wx_version=1
2095 wx_multi_lib=1
2096 case x$WX_BASENAME in
2097 xwx_gtk2|xwx_gtk2u) wx_needs_gtk2=1 ;;
2098 *) ;;
2099 esac
2100 ;;
2101 x[3-9]*) ok_wx_version=1 ;; # version 3 or greater
2102 *) ;; # who knows?
2103 esac
2104 ]
2105 fi
2106 AC_MSG_RESULT($WX_VERSION)
2107 if test "$cross_configure" = 0; then
2108 if test "$ok_wx_version" = 1; then
2109 # detected a usable version
2110 if test "$with_all_libs" = yes; then
2111 with_wx=yes
2112 fi
2113 else
2114 if test "$with_wx" = yes; then
2115 AC_MSG_WARN([Bochs for wxWidgets cannot be compiled here, disabling it])
2116 fi
2117 with_wx=no
2118 fi
2119 fi
2120
2121 AC_MSG_CHECKING(for default gui on this platform)
2122 AC_MSG_RESULT($DEFAULT_GUI)
2123
2124 display_libs=""
2125
2126 # the $with_* variable tells the gui library to use, but does NOT necessarily
2127 # indicate the platform. Settings that depend on the platform should be
2128 # handled later.
2129
2130 XPM_LIB=''
2131 if test "$with_x11" = yes; then
2132 display_libs="$display_libs X11"
2133 if test "$no_x" = yes; then
2134 echo ERROR: X windows gui was selected, but X windows libraries were not found.
2135 exit 1
2136 fi
2137 AC_DEFINE(BX_WITH_X11, 1)
2138 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_X11)"
2139 GUI_CFLAGS="$GUI_CFLAGS \$(X_CFLAGS)"
2140 GUI_CXXFLAGS="$GUI_CXXFLAGS \$(X_CFLAGS)"
2141 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_X)"
2142 check_xpm=0
2143 AC_MSG_CHECKING(whether user wants XPM support)
2144 AC_ARG_ENABLE(xpm,
2145 [ --enable-xpm enable the check for XPM support],
2146 [if test "$enableval" = yes; then
2147 check_xpm=0
2148 AC_MSG_RESULT(yes)
2149 check_xpm=1
2150 else
2151 AC_MSG_RESULT(no)
2152 check_xpm=0
2153 fi],
2154 [
2155 AC_MSG_RESULT(yes)
2156 check_xpm=1
2157 ]
2158 )
2159 if test $check_xpm = 1; then
2160 AC_CHECK_HEADER(X11/xpm.h, [
2161 AC_DEFINE(BX_HAVE_XPM_H)
2162 XPM_LIB='-lXpm'
2163 ])
2164 fi
2165 fi
2166 AC_SUBST(XPM_LIB)
2167
2168 if test "$with_beos" = yes; then
2169 display_libs="$display_libs beos"
2170 AC_DEFINE(BX_WITH_BEOS, 1)
2171 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_BEOS)"
2172 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_BEOS)"
2173 fi
2174
2175 if test "$with_sdl" = yes; then
2176 display_libs="$display_libs sdl"
2177 AC_DEFINE(BX_WITH_SDL, 1)
2178 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_SDL)"
2179 # GUI_*FLAGS are added to the compilation of every bochs file, not just
2180 # the files in gui/*.cc.
2181 SDL_CFLAGS=`sdl-config --cflags`
2182 GUI_CFLAGS="$GUI_CFLAGS $SDL_CFLAGS"
2183 GUI_CXXFLAGS="$GUI_CXXFLAGS $SDL_CFLAGS"
2184 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_SDL)"
2185 if test "$with_win32" != yes -a "$with_wx" != yes; then
2186 case $target in
2187 *-pc-windows*)
2188 RC_CMD="rc /fo"
2189 EXTRA_BX_OBJS="$EXTRA_BX_OBJS win32res.o"
2190 ;;
2191 *-cygwin* | *-mingw32*)
2192 RC_CMD="windres -o "
2193 EXTRA_BX_OBJS="$EXTRA_BX_OBJS win32res.o"
2194 ;;
2195 esac
2196 fi
2197 fi
2198
2199 if test "$with_svga" = yes; then
2200 display_libs="$display_libs svga"
2201 AC_DEFINE(BX_WITH_SVGA, 1)
2202 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_SVGA)"
2203 # GUI_*FLAGS are added to the compilation of every bochs file, not just
2204 # the files in gui/*.cc.
2205 GUI_CFLAGS="$GUI_CFLAGS"
2206 GUI_CXXFLAGS="$GUI_CXXFLAGS"
2207 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_SVGA)"
2208 fi
2209
2210 if test "$with_rfb" = yes; then
2211 display_libs="$display_libs rfb"
2212 AC_DEFINE(BX_WITH_RFB, 1)
2213 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_RFB)"
2214 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_RFB)"
2215 fi
2216
2217 if test "$with_amigaos" = yes; then
2218 display_libs="$display_libs amigaos"
2219 AC_DEFINE(BX_WITH_AMIGAOS, 1)
2220 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_AMIGAOS)"
2221 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_AMIGAOS)"
2222 fi
2223
2224 if test "$with_win32" = yes; then
2225 display_libs="$display_libs win32"
2226 AC_DEFINE(BX_WITH_WIN32, 1)
2227 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_WIN32)"
2228 case $target in
2229 *-pc-windows*)
2230 if test "$with_wx" != yes; then
2231 RC_CMD="rc /fo"
2232 EXTRA_BX_OBJS="$EXTRA_BX_OBJS win32res.o"
2233 fi
2234 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_WIN32_VCPP)"
2235 ;;
2236 *-cygwin* | *-mingw32*)
2237 if test "$with_wx" != yes; then
2238 RC_CMD="windres -o "
2239 EXTRA_BX_OBJS="$EXTRA_BX_OBJS win32res.o"
2240 fi
2241 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_WIN32)"
2242 ;;
2243 *) echo Unsupported compile setup: GUI library is win32, but target is neither windows nor cygwin.
2244 ;;
2245 esac
2246 fi
2247
2248 if test "$with_macos" = yes; then
2249 display_libs="$display_libs macos"
2250 AC_DEFINE(BX_WITH_MACOS, 1)
2251 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_MACOS)"
2252 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_MACOS)"
2253 fi
2254
2255 if test "$with_carbon" = yes; then
2256 display_libs="$display_libs carbon"
2257 AC_DEFINE(BX_WITH_CARBON, 1)
2258 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_CARBON)"
2259 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_CARBON)"
2260 if test "$bx_plugins" = 1; then
2261 PRIMARY_TARGET=bochs.app/.build_plugins # only for carbon application
2262 else
2263 PRIMARY_TARGET=bochs.app/.build # only for carbon application
2264 fi
2265 INSTALL_TARGET='install_macosx'
2266 fi
2267
2268 if test "$with_term" = yes; then
2269 display_libs="$display_libs term"
2270 AC_DEFINE(BX_WITH_TERM, 1)
2271 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_TERM)"
2272 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_TERM)"
2273 use_curses=yes
2274 fi
2275
2276 if test "$with_wx" = yes; then
2277 display_libs="$display_libs wxWidgets"
2278 if test "$cross_configure" = 1; then
2279 true # do not insist, if configuring for another machine
2280 else
2281 if test x$ok_wx_version != x1; then
2282 echo ERROR: A usable version of wxWidgets was not found.
2283 echo Upgrade the library or choose another gui.
2284 exit 1
2285 fi
2286 fi
2287 AC_DEFINE(BX_WITH_WX, 1)
2288 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_WX)"
2289 SPECIFIC_GUI_SUPPORT_OBJS="$SPECIFIC_GUI_SUPPORT_OBJS \$(GUI_OBJS_WX_SUPPORT)"
2290 WX_CFLAGS="`$WX_CONFIG --cflags`"
2291 WX_CXXFLAGS="`$WX_CONFIG --cxxflags`"
2292 if test "$wx_multi_lib" = 1; then
2293 GUI_LINK_OPTS_WX="`$WX_CONFIG --libs core,base`"
2294 else
2295 GUI_LINK_OPTS_WX="`$WX_CONFIG --libs`"
2296 fi
2297 if test "$wx_needs_gtk2" = 1; then
2298 PKG_CHECK_MODULES([GTK], [gtk+-2.0], [
2299 WX_CFLAGS="$WX_CFLAGS $GTK_CFLAGS"
2300 WX_CXXFLAGS="$WX_CXXFLAGS $GTK_CFLAGS"
2301 ])
2302 else
2303 # if gtk-config exists, then add it to the cflags.
2304 gtkconf=`gtk-config --cflags`
2305 if test $? = 0; then
2306 # gtk-config was found and returned 0, so it must return valid output
2307 WX_CFLAGS="$WX_CFLAGS $gtkconf"
2308 WX_CXXFLAGS="$WX_CXXFLAGS $gtkconf"
2309 fi
2310 fi
2311 # GUI_C*FLAGS are added to the compilation of every bochs file, not just
2312 # the files in gui/*.cc. They are not used when building other things
2313 # such as bximage.
2314 GUI_CFLAGS="$GUI_CFLAGS $WX_CFLAGS"
2315 GUI_CXXFLAGS="$GUI_CXXFLAGS $WX_CXXFLAGS"
2316 GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_WX)"
2317 # using debugger with readline is failing due to thread/signal handler
2318 # problems.
2319 case $target in
2320 *-pc-windows* | *-cygwin* | *-mingw32*)
2321 EXTRA_BX_OBJS="$EXTRA_BX_OBJS wxbochs_resources.o"
2322 GUI_LINK_OPTS_WX="$GUI_LINK_OPTS_WX --subsystem,windows -mwindows"
2323 ;;
2324 esac
2325 fi
2326
2327 if test "$with_nogui" = yes; then
2328 display_libs="$display_libs nogui"
2329 AC_DEFINE(BX_WITH_NOGUI, 1)
2330 SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_NOGUI)"
2331 fi
2332
2333 AC_MSG_CHECKING(for display libraries)
2334 AC_MSG_RESULT($display_libs)
2335
2336 if test "$display_libs" = ""; then
2337 echo "No display libraries were selected. Use --with-* options to enable"
2338 echo "individual display libraries, or --with-all-libs to detect the ones"
2339 echo "that Bochs supports."
2340 exit 1
2341 fi
2342
2343 dnl To use wxWidgets you must select it as both the configuration interface
2344 dnl and the display library. In the simplest case where the user has
2345 dnl only configured with --with-wx, set both defaults to wxWidgets.
2346 dnl Without this setting, the config interface would default to the text
2347 dnl mode config interface, and then the wxWidgets display library would not
2348 dnl be usable.
2349 if test "$display_libs" = " wxWidgets"; then
2350 AC_MSG_CHECKING(for default configuration interface)
2351 AC_MSG_RESULT(wxWidgets)
2352 AC_MSG_CHECKING(for default display library)
2353 AC_MSG_RESULT(wxWidgets)
2354 AC_DEFINE(BX_DEFAULT_CONFIG_INTERFACE, "wx")
2355 AC_DEFINE(BX_DEFAULT_DISPLAY_LIBRARY, "wx")
2356 AC_DEFINE(BX_USE_TEXTCONFIG, 0)
2357 else
2358 AC_DEFINE(BX_USE_TEXTCONFIG, 1)
2359 fi
2360
2361 if test "$bx_plugins" = 1; then
2362 # every item in this list will be compiled as a plugin. Do not include
2363 # support objs; they will be mentioned in plugin-specific makefile rules.
2364 GUI_PLUGIN_OBJS="$GUI_PLUGIN_OBJS $SPECIFIC_GUI_OBJS"
2365 else
2366 # include support objs
2367 GUI_NON_PLUGIN_OBJS="$GUI_NON_PLUGIN_OBJS $SPECIFIC_GUI_OBJS $SPECIFIC_GUI_SUPPORT_OBJS"
2368 fi
2369
2370 AC_SUBST(GUI_CFLAGS)
2371 AC_SUBST(GUI_CXXFLAGS)
2372 AC_SUBST(WX_CONFIG)
2373 AC_SUBST(WX_CFLAGS)
2374 AC_SUBST(WX_CXXFLAGS)
2375
2376 AC_CHECK_PROGS(WGET, wget curl fetch, not_found)
2377 if test "$WGET" = not_found; then
2378 AC_MSG_WARN([cannot find wget (or equivalent) command])
2379 fi
2380 # everybody has to re-invent the wheel. differently.
2381 test "${WGET}" = "curl" && WGET="curl -O"
2382
2383 # modify settings based on target platform
2384 case "$target" in
2385 *-macosx*)
2386 AC_DEFINE(BX_HAVE_STRDUP, 0)
2387 ;;
2388 *-macos*)
2389 AC_DEFINE(BX_HAVE_STRDUP, 0)
2390 AC_DEFINE(BX_PLUGINS, 0)
2391 AC_DEFINE(BX_HAVE_DLFCN_H, 0)
2392 AC_DEFINE(BX_HAVE_SOCKLEN_T, 0)
2393 AC_DEFINE(BX_HAVE_SELECT, 0)
2394 AC_DEFINE(BX_HAVE_GETTIMEOFDAY, 0)
2395 AC_DEFINE(BX_NO_ATTRIBUTES, 1)
2396 AC_DEFINE(HAVE_TUNTAP, 0)
2397 AC_DEFINE(HAVE_ETHERTAP, 0)
2398 AC_DEFINE(BX_HAVE_HASH_MAP, 0)
2399 ;;
2400 *-pc-windows*)
2401 INSTALL_TARGET='install_win32'
2402 CC="cl"
2403 CXX="$CC"
2404 #C_OPT="/Zi" # for debugging
2405 C_OPT="/Ox" # optimize for speed
2406 CFLAGS="/nologo /G6 /MT /W3 /GX- /DNDEBUG /DWIN32 /D_WINDOWS $C_OPT"
2407 CXXFLAGS="$CFLAGS"
2408 DASH="/"
2409 SLASH="\\"
2410 CXXFP="/Tp"
2411 CFP="/Tc"
2412 OFP="/Fo"
2413 MAKE=nmake
2414 MAKELIB="lib /nologo /subsystem:console /machine:I386 /verbose /out:\$@"
2415 RMCOMMAND="-del"
2416 RANLIB="echo"
2417 #L_OPT="/debug" # for debugging
2418 L_OPT="" # no debug info
2419 LINK="link $L_OPT /nologo /subsystem:console /incremental:no /machine:I386 /out:\$@ "
2420 LINK_CONSOLE=$LINK
2421 EXE=".exe"
2422 PRIMARY_TARGET="bochs.exe"
2423 BXIMAGE_LINK_OPTS="user32.lib"
2424 # also compile niclist if networking is on
2425 if test "$networking" = yes; then
2426 PRIMARY_TARGET="$PRIMARY_TARGET niclist.exe"
2427 fi
2428 COMMAND_SEPARATOR=""
2429 CD_UP_ONE="cd .."
2430 CD_UP_TWO="cd ..\.."
2431 CD_UP_THREE="cd ..\..\.."
2432 have_gettimeofday=0 # even though it may exist in build environment
2433 AC_DEFINE(BX_64BIT_CONSTANTS_USE_LL, 0)
2434 AC_DEFINE(inline, __inline)
2435 AC_DEFINE(BX_NO_EMPTY_STRUCTS, 1)
2436 AC_DEFINE(BX_NO_ATTRIBUTES, 1)
2437 AC_DEFINE(BX_HAVE_HASH_MAP, 0)
2438 AC_DEFINE(BX_HAVE_HASH_MAP_H, 0)
2439 AC_DEFINE(BX_HAVE_STRTOULL, 0)
2440 AC_DEFINE(BX_HAVE_STRTOUQ, 0)
2441 AC_DEFINE(HAVE_LIBREADLINE, 0)
2442 AC_DEFINE(BX_HAVE_GETTIMEOFDAY, 0)
2443 AC_DEFINE(BX_HAVE_DLFCN_H, 0)
2444 AC_DEFINE(BX_HAVE_MKSTEMP, 0)
2445 AC_DEFINE(BX_HAVE_SYS_MMAN_H, 0)
2446 AC_DEFINE(BX_HAVE_USLEEP, 0)
2447 AC_DEFINE(HAVE_ETHERTAP, 0)
2448 AC_DEFINE(BX_HAVE_SELECT, 1)
2449 AC_DEFINE(BX_HAVE_SOCKLEN_T, 0)
2450 ;;
2451 *-pc-cygwin*)
2452 EXE=".exe"
2453 PRIMARY_TARGET="bochs.exe"
2454 BXIMAGE_LINK_OPTS="-luser32"
2455 if test "$networking" = yes; then
2456 PRIMARY_TARGET="$PRIMARY_TARGET niclist.exe"
2457 fi
2458 AC_DEFINE(BX_HAVE_SELECT, 1)
2459 ;;
2460 *-pc-mingw*)
2461 BXIMAGE_LINK_OPTS="-luser32"
2462 if test "$networking" = yes; then
2463 PRIMARY_TARGET="$PRIMARY_TARGET niclist"
2464 fi
2465 AC_DEFINE(BX_HAVE_SELECT, 1)
2466 ;;
2467 *-beos*)
2468 PRIMARY_TARGET=.bochs_beos_target
2469 ;;
2470 esac
2471
2472 DIALOG_OBJS=""
2473 EXPORT_DYNAMIC="-export-dynamic"
2474 case $target in
2475 *-pc-windows* | *-pc-winnt* | *-cygwin* | *-mingw*)
2476 if test "$bx_plugins" = 1; then
2477 AC_CHECK_LIB(mingwex, opendir, LIBS="$LIBS -lmingwex")
2478 # set variables for building DLL plugins
2479 PRIMARY_TARGET=".win32_dll_plugin_target"
2480 PLUGIN_LIBNAME_TRANSFORMATION='%.o=bx_%.dll'
2481 INSTALL_PLUGINS_VAR=install_dll_plugins
2482 else
2483 if test "$with_win32" != yes; then
2484 LIBS="$LIBS -lcomctl32"
2485 fi
2486 fi
2487 DIALOG_OBJS="win32dialog.o"
2488 EXPORT_DYNAMIC=""
2489 ;;
2490 esac
2491 AC_SUBST(DIALOG_OBJS)
2492 AC_SUBST(EXPORT_DYNAMIC)
2493
2494 if test "$use_curses" = yes -a "$cross_configure" = 0; then
2495 AC_CHECK_LIB(curses, mvaddch, GUI_LINK_OPTS_TERM='-lcurses')
2496 AC_CHECK_LIB(ncurses, mvaddch, GUI_LINK_OPTS_TERM='-lncurses')
2497 AC_CHECK_LIB(termlib, mvaddch, GUI_LINK_OPTS_TERM='-ltermlib')
2498 AC_CHECK_LIB(pdcurses, mvaddch, GUI_LINK_OPTS_TERM='-lpdcurses')
2499 if test "$GUI_LINK_OPTS_TERM" = ""; then
2500 echo Curses library not found: tried curses, ncurses, termlib and pdcurses.
2501 exit 1
2502 fi
2503 fi
2504
2505 if test "$with_term" = yes; then
2506 old_LIBS="$LIBS"
2507 LIBS="$LIBS $GUI_LINK_OPTS_TERM"
2508 AC_CHECK_FUNCS(color_set, AC_DEFINE(BX_HAVE_COLOR_SET, 1))
2509 AC_CHECK_FUNCS(mvhline, AC_DEFINE(BX_HAVE_MVHLINE, 1))
2510 AC_CHECK_FUNCS(mvvline, AC_DEFINE(BX_HAVE_MVVLINE, 1))
2511 LIBS="$old_LIBS"
2512 fi
2513
2514 if test "$with_rfb" = yes; then
2515 # we need the socket function
2516 case $target in
2517 *-pc-windows*)
2518 # is this okay without a check ?
2519 RFB_LIBS="$RFB_LIBS wsock32.lib"
2520 have_socket=yes
2521 ;;
2522 *-pc-winnt* | *-pc-cygwin* | *-pc-mingw32*)
2523 # is this okay without a check ?
2524 RFB_LIBS="$RFB_LIBS -lwsock32"
2525 have_socket=yes
2526 ;;
2527 *)
2528 AC_CHECK_FUNCS(socket, have_socket=yes)
2529 if test "$have_socket" != yes; then
2530 AC_CHECK_LIB(socket, socket,
2531 [
2532 RFB_LIBS="$RFB_LIBS -lsocket"
2533 have_socket=yes
2534 ])
2535 fi
2536 ;;
2537 esac
2538 if test "$have_socket" != yes; then
2539 echo 'ERROR: socket function required for RFB compile'
2540 exit 1
2541 fi
2542 fi
2543
2544 # The ACX_PTHREAD function was written by
2545 # Steven G. Johnson <stevenj@alum.mit.edu> and
2546 # Alejandro Forero Cuervo <bachue@bachue.com>
2547 # I found it in the ac-archive project on Source Forge.
2548
2549 AC_DEFUN([ACX_PTHREAD], [
2550 AC_REQUIRE([AC_CANONICAL_HOST])
2551 acx_pthread_ok=no
2552
2553 # First, check if the POSIX threads header, pthread.h, is available.
2554 # If it isn't, don't bother looking for the threads libraries.
2555 AC_CHECK_HEADER(pthread.h, , acx_pthread_ok=noheader)
2556
2557 # We must check for the threads library under a number of different
2558 # names; the ordering is very important because some systems
2559 # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
2560 # libraries is broken (non-POSIX).
2561
2562 # First of all, check if the user has set any of the PTHREAD_LIBS,
2563 # etcetera environment variables, and if threads linking works using
2564 # them:
2565 if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
2566 save_CFLAGS="$CFLAGS"
2567 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
2568 CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
2569 save_LIBS="$LIBS"
2570 LIBS="$PTHREAD_LIBS $LIBS"
2571 AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
2572 AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
2573 AC_MSG_RESULT($acx_pthread_ok)
2574 if test x"$acx_pthread_ok" = xno; then
2575 PTHREAD_LIBS=""
2576 PTHREAD_CFLAGS=""
2577 fi
2578 LIBS="$save_LIBS"
2579 CFLAGS="$save_CFLAGS"
2580 fi
2581
2582 # Create a list of thread flags to try. Items starting with a "-" are
2583 # C compiler flags, and other items are library names, except for "none"
2584 # which indicates that we try without any flags at all.
2585
2586 acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
2587
2588 # The ordering *is* (sometimes) important. Some notes on the
2589 # individual items follow:
2590
2591 # pthreads: AIX (must check this before -lpthread)
2592 # none: in case threads are in libc; should be tried before -Kthread and
2593 # other compiler flags to prevent continual compiler warnings
2594 # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
2595 # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
2596 # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
2597 # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
2598 # -pthreads: Solaris/gcc
2599 # -mthreads: Mingw32/gcc, Lynx/gcc
2600 # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
2601 # doesn't hurt to check since this sometimes defines pthreads too;
2602 # also defines -D_REENTRANT)
2603 # pthread: Linux, etcetera
2604 # --thread-safe: KAI C++
2605
2606 case "${host_cpu}-${host_os}" in
2607 *solaris*)
2608
2609 # On Solaris (at least, for some versions), libc contains stubbed
2610 # (non-functional) versions of the pthreads routines, so link-based
2611 # tests will erroneously succeed. (We need to link with -pthread or
2612 # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
2613 # a function called by this macro, so we could check for that, but
2614 # who knows whether they'll stub that too in a future libc.) So,
2615 # we'll just look for -pthreads and -lpthread first:
2616
2617 acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
2618 ;;
2619 esac
2620
2621 if test x"$acx_pthread_ok" = xno; then
2622 for flag in $acx_pthread_flags; do
2623
2624 case $flag in
2625 none)
2626 AC_MSG_CHECKING([whether pthreads work without any flags])
2627 ;;
2628
2629 -*)
2630 AC_MSG_CHECKING([whether pthreads work with $flag])
2631 PTHREAD_CFLAGS="$flag"
2632 ;;
2633
2634 *)
2635 AC_MSG_CHECKING([for the pthreads library -l$flag])
2636 PTHREAD_LIBS="-l$flag"
2637 ;;
2638 esac
2639
2640 save_LIBS="$LIBS"
2641 save_CFLAGS="$CFLAGS"
2642 LIBS="$PTHREAD_LIBS $LIBS"
2643 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
2644
2645 # Check for various functions. We must include pthread.h,
2646 # since some functions may be macros. (On the Sequent, we
2647 # need a special flag -Kthread to make this header compile.)
2648 # We check for pthread_join because it is in -lpthread on IRIX
2649 # while pthread_create is in libc. We check for pthread_attr_init
2650 # due to DEC craziness with -lpthreads. We check for
2651 # pthread_cleanup_push because it is one of the few pthread
2652 # functions on Solaris that doesn't have a non-functional libc stub.
2653 # We try pthread_create on general principles.
2654 AC_TRY_LINK([#include <pthread.h>],
2655 [pthread_t th; pthread_join(th, 0);
2656 pthread_attr_init(0); pthread_cleanup_push(0, 0);
2657 pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
2658 [acx_pthread_ok=yes])
2659
2660 LIBS="$save_LIBS"
2661 CFLAGS="$save_CFLAGS"
2662
2663 AC_MSG_RESULT($acx_pthread_ok)
2664 if test "x$acx_pthread_ok" = xyes; then
2665 break;
2666 fi
2667
2668 PTHREAD_LIBS=""
2669 PTHREAD_CFLAGS=""
2670 done
2671 fi
2672
2673 # Various other checks:
2674 if test "x$acx_pthread_ok" = xyes; then
2675 save_LIBS="$LIBS"
2676 LIBS="$PTHREAD_LIBS $LIBS"
2677 save_CFLAGS="$CFLAGS"
2678 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
2679
2680 # Detect AIX lossage: threads are created detached by default
2681 # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
2682 AC_MSG_CHECKING([for joinable pthread attribute])
2683 AC_TRY_LINK([#include <pthread.h>],
2684 [int attr=PTHREAD_CREATE_JOINABLE;],
2685 ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
2686 if test x"$ok" = xunknown; then
2687 AC_TRY_LINK([#include <pthread.h>],
2688 [int attr=PTHREAD_CREATE_UNDETACHED;],
2689 ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
2690 fi
2691 if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
2692 AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
2693 [Define to the necessary symbol if this constant
2694 uses a non-standard name on your system.])
2695 fi
2696 AC_MSG_RESULT(${ok})
2697 if test x"$ok" = xunknown; then
2698 AC_MSG_WARN([we do not know how to create joinable pthreads])
2699 fi
2700
2701 AC_MSG_CHECKING([if more special flags are required for pthreads])
2702 flag=no
2703 case "${host_cpu}-${host_os}" in
2704 *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
2705 *solaris* | alpha*-osf*) flag="-D_REENTRANT";;
2706 esac
2707 AC_MSG_RESULT(${flag})
2708 if test "x$flag" != xno; then
2709 PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
2710 fi
2711
2712 LIBS="$save_LIBS"
2713 CFLAGS="$save_CFLAGS"
2714
2715 # More AIX lossage: must compile with cc_r
2716 AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
2717 else
2718 PTHREAD_CC="$CC"
2719 fi
2720
2721 AC_SUBST(PTHREAD_LIBS)
2722 AC_SUBST(PTHREAD_CFLAGS)
2723 AC_SUBST(PTHREAD_CC)
2724
2725 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
2726 if test x"$acx_pthread_ok" = xyes; then
2727 ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
2728 :
2729 else
2730 acx_pthread_ok=no
2731 $2
2732 fi
2733
2734 ])dnl ACX_PTHREAD
2735
2736 pthread_ok=no
2737 ACX_PTHREAD([
2738 pthread_ok=yes
2739 #echo Using PTHREAD_LIBS=$PTHREAD_LIBS
2740 #echo Using PTHREAD_CFLAGS=$PTHREAD_CFLAGS
2741 #echo Using PTHREAD_CC=$PTHREAD_CC
2742 ])
2743
2744
2745 # since RFB (usually) needs pthread library, check that it was found.
2746 # But on win32 platforms, the pthread library is not needed.
2747 if test "$with_rfb" = yes -a "$cross_configure" = 0; then
2748 if test "$pthread_ok" = yes; then
2749 RFB_LIBS="$RFB_LIBS $PTHREAD_LIBS"
2750 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
2751 CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
2752 CC="$PTHREAD_CC"
2753 else
2754 case "$target" in
2755 *-pc-windows* | *-pc-winnt* | *-cygwin* | *-mingw*)
2756 # pthread not needed for win32 platform
2757 ;;
2758 *)
2759 echo ERROR: --with-rfb requires the pthread library, which could not be found.; exit 1
2760 esac
2761 fi
2762 fi
2763
2764 dnl // DEPRECATED configure options - force users to remove them
2765
2766 AC_MSG_CHECKING(for specified CMOS start time (deprecated))
2767 AC_ARG_ENABLE(time0,
2768 [ --enable-time0=n start at n (deprecated)],
2769 [AC_MSG_RESULT($enableval)
2770 AC_MSG_ERROR([DEPRECATED - use runtime option 'clock' instead])
2771 ],
2772 [
2773 AC_MSG_RESULT(no)
2774 ])
2775
2776 AC_MSG_CHECKING(for configuration interface (deprecated))
2777 AC_ARG_ENABLE(config-interface,
2778 [ --enable-config-interface turns on/off configuration interface (deprecated)],
2779 [AC_MSG_RESULT($enableval)
2780 AC_MSG_ERROR([DEPRECATED - configuration interface is always enabled])
2781 ],
2782 [
2783 AC_MSG_RESULT(no)
2784 ])
2785
2786 AC_MSG_CHECKING(for control panel (deprecated))
2787 AC_ARG_ENABLE(control-panel,
2788 [ --enable-control-panel turns on/off contol panel (deprecated)],
2789 [AC_MSG_RESULT($enableval)
2790 AC_MSG_ERROR([DEPRECATED - configuration interface is always enabled])
2791 ],
2792 [
2793 AC_MSG_RESULT(no)
2794 ])
2795
2796 AC_MSG_CHECKING(for VGA emulation (deprecated))
2797 AC_ARG_ENABLE(vga,
2798 [ --enable-vga use VGA emulation (deprecated)],
2799 [AC_MSG_RESULT($enableval)
2800 AC_MSG_ERROR([DEPRECATED - standard VGA emulation is always enabled])
2801 ],
2802 [
2803 AC_MSG_RESULT(no)
2804 ])
2805
2806 AC_MSG_CHECKING(for number of processors (deprecated))
2807 AC_ARG_ENABLE(processors,
2808 [ --enable-processors select number of processors (deprecated)],
2809 [AC_MSG_RESULT($enableval)
2810 AC_MSG_ERROR([DEPRECATED - use option --enable-smp instead])
2811 ],
2812 [
2813 AC_MSG_RESULT(no)
2814 ])
2815
2816 AC_MSG_CHECKING(whether to reset on triple fault (deprecated))
2817 AC_ARG_ENABLE(reset-on-triple-fault,
2818 [ --enable-reset-on-triple-fault reset when cpu detects a triple fault (deprecated)],
2819 [AC_MSG_RESULT($enableval)
2820 AC_MSG_ERROR([DEPRECATED - could be configured directly from .bochsrc instead])
2821 ],
2822 [
2823 AC_MSG_RESULT(no)
2824 ])
2825
2826 AC_MSG_CHECKING(PNI support (deprecated))
2827 AC_ARG_ENABLE(--enable-pni,
2828 [ --enable-pni PNI support (deprecated)],
2829 [AC_MSG_RESULT($enableval)
2830 AC_MSG_ERROR([DEPRECATED - use --enable-sse=3 instead])
2831 ],
2832 [
2833 AC_MSG_RESULT(no)
2834 ])
2835
2836 AC_MSG_CHECKING(for new PIT model (deprecated))
2837 AC_ARG_ENABLE(new-pit,
2838 [ --enable-new-pit use Greg Alexander's new PIT model (deprecated)],
2839 [AC_MSG_RESULT($enableval)
2840 AC_MSG_ERROR([DEPRECATED - the new PIT model is always present and the old one has been removed])
2841 ],
2842 [
2843 AC_MSG_RESULT(no)
2844 ])
2845
2846 # Create some subdirectories for when you run configure from some other
2847 # directory.
2848 if test ! -d instrument; then mkdir instrument; fi
2849 if test ! -d build; then mkdir build; fi
2850 if test ! -d build/linux; then mkdir build/linux; fi
2851 if test ! -d build/win32; then mkdir build/win32; fi
2852 if test ! -d build/win32/nsis; then mkdir build/win32/nsis; fi
2853
2854 AC_SUBST(INSTALL_TARGET)
2855 AC_SUBST(INSTALL_LIST_FOR_PLATFORM)
2856 AC_SUBST(RFB_LIBS)
2857 AC_SUBST(GUI_OBJS)
2858 AC_SUBST(DEVICE_LINK_OPTS)
2859 AC_SUBST(GUI_LINK_OPTS)
2860 AC_SUBST(GUI_LINK_OPTS_TERM)
2861 AC_SUBST(GUI_LINK_OPTS_WX)
2862 AC_SUBST(BXIMAGE_LINK_OPTS)
2863 AC_SUBST(DASH)
2864 AC_SUBST(SLASH)
2865 AC_SUBST(CXXFP)
2866 AC_SUBST(CFP)
2867 AC_SUBST(OFP)
2868 AC_SUBST(MAKELIB)
2869 AC_SUBST(RMCOMMAND)
2870 AC_SUBST(LINK)
2871 AC_SUBST(LINK_CONSOLE)
2872 AC_SUBST(EXE)
2873 AC_SUBST(PRIMARY_TARGET)
2874 AC_SUBST(PLUGIN_LIBNAME_TRANSFORMATION)
2875 AC_SUBST(COMMAND_SEPARATOR)
2876 AC_SUBST(CD_UP_ONE)
2877 AC_SUBST(CD_UP_TWO)
2878 AC_SUBST(CD_UP_THREE)
2879 AC_SUBST(VERSION)
2880 AC_SUBST(VER_STRING)
2881 AC_SUBST(REL_STRING)
2882 AC_SUBST(EXTRA_LINK_OPTS)
2883 AC_SUBST(GUI_NON_PLUGIN_OBJS)
2884 AC_SUBST(GUI_PLUGIN_OBJS)
2885 AC_SUBST(IODEV_NON_PLUGIN_OBJS)
2886 AC_SUBST(IODEV_PLUGIN_OBJS)
2887 AC_SUBST(PLUGIN_VAR)
2888 AC_SUBST(PLUGIN_TARGET)
2889 AC_SUBST(INSTALL_PLUGINS_VAR)
2890
2891 AC_PATH_PROG(GZIP, gzip)
2892 AC_PATH_PROG(TAR, tar)
2893
2894 AC_OUTPUT(Makefile iodev/Makefile bx_debug/Makefile bios/Makefile \
2895 cpu/Makefile memory/Makefile gui/Makefile \
2896 disasm/Makefile ${INSTRUMENT_DIR}/Makefile misc/Makefile \
2897 fpu/Makefile doc/docbook/Makefile \
2898 build/linux/bochs-dlx \
2899 bxversion.h build/macosx/Info.plist \
2900 build/win32/nsis/Makefile build/win32/nsis/bochs.nsi \
2901 host/linux/pcidev/Makefile)
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.