6 |
|
AC_PREREQ(2.52) |
7 |
|
AC_CONFIG_HEADER(config.h) |
8 |
|
|
9 |
+ |
dnl Aliases for PACKAGE and VERSION macros. |
10 |
+ |
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.]) |
11 |
+ |
AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.]) |
12 |
+ |
|
13 |
+ |
dnl Some systems do not put corefiles in the currect directory, avoid saving |
14 |
+ |
dnl cores for the configure tests since some are intended to dump core. |
15 |
+ |
ulimit -c 0 |
16 |
+ |
|
17 |
+ |
AC_ARG_ENABLE(standalone-gui,[ --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no]) |
18 |
+ |
|
19 |
|
dnl Video options. |
20 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
21 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
22 |
|
AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes]) |
23 |
|
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
24 |
|
|
25 |
+ |
dnl SDL options. |
26 |
+ |
AC_ARG_ENABLE(sdl-static, [ --enable-sdl-static use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no]) |
27 |
+ |
AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no]) |
28 |
+ |
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no]) |
29 |
+ |
AC_ARG_ENABLE(sdl-framework, [ --enable-sdl-framework use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no]) |
30 |
+ |
AC_ARG_ENABLE(sdl-framework-prefix, [ --enable-sdl-framework-prefix=PFX default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks]) |
31 |
+ |
|
32 |
|
dnl JIT compiler options. |
33 |
|
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no]) |
34 |
|
AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no]) |
64 |
|
|
65 |
|
dnl External packages. |
66 |
|
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
67 |
< |
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) |
67 |
> |
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], |
68 |
> |
[case "$withval" in |
69 |
> |
gtk1) WANT_GTK="gtk";; |
70 |
> |
gtk|gtk2) WANT_GTK="$withval";; |
71 |
> |
yes) WANT_GTK="gtk2 gtk";; |
72 |
> |
*) WANT_GTK="no";; |
73 |
> |
esac], |
74 |
> |
[WANT_GTK="gtk2 gtk"]) |
75 |
|
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes]) |
76 |
|
|
77 |
|
dnl Canonical system information. |
110 |
|
AC_PROG_CXX |
111 |
|
AC_PROG_MAKE_SET |
112 |
|
AC_PROG_INSTALL |
113 |
+ |
AC_PROG_EGREP |
114 |
|
|
115 |
|
dnl We use mon if possible. |
116 |
|
MONSRCS= |
120 |
|
if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then |
121 |
|
AC_MSG_RESULT(yes) |
122 |
|
AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".]) |
123 |
< |
MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c" |
123 |
> |
MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c $mon_srcdir/disass/mips-dis.c $mon_srcdir/disass/mips-opc.c $mon_srcdir/disass/mips16-opc.c" |
124 |
|
CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass" |
125 |
|
AC_CHECK_LIB(ncurses, tgetent, , |
126 |
< |
AC_CHECK_LIB(termcap, tgetent, , |
127 |
< |
AC_CHECK_LIB(termlib, tgetent, , |
128 |
< |
AC_CHECK_LIB(terminfo, tgetent, , |
129 |
< |
AC_CHECK_LIB(Hcurses, tgetent, , |
130 |
< |
AC_CHECK_LIB(curses, tgetent)))))) |
126 |
> |
[AC_CHECK_LIB(termcap, tgetent, , |
127 |
> |
[AC_CHECK_LIB(termlib, tgetent, , |
128 |
> |
[AC_CHECK_LIB(terminfo, tgetent, , |
129 |
> |
[AC_CHECK_LIB(Hcurses, tgetent, , |
130 |
> |
[AC_CHECK_LIB(curses, tgetent)])])])])]) |
131 |
|
AC_CHECK_LIB(readline, readline) |
107 |
– |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
132 |
|
else |
133 |
|
AC_MSG_RESULT(no) |
134 |
|
AC_MSG_WARN([Could not find mon, ignoring --with-mon.]) |
139 |
|
dnl Checks for libraries. |
140 |
|
AC_CHECK_LIB(posix4, sem_init) |
141 |
|
AC_CHECK_LIB(rt, timer_create) |
142 |
+ |
AC_CHECK_LIB(rt, shm_open) |
143 |
+ |
AC_CHECK_LIB(m, cos) |
144 |
+ |
|
145 |
+ |
dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES) |
146 |
+ |
dnl AC_TRY_LINK uses main() but SDL needs main to take args, |
147 |
+ |
dnl therefore main is undefined with #undef. |
148 |
+ |
dnl Framework can be in an custom location. |
149 |
+ |
AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [ |
150 |
+ |
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1]) |
151 |
+ |
AC_CACHE_CHECK([whether compiler supports framework $1], |
152 |
+ |
ac_Framework, [ |
153 |
+ |
saved_LIBS="$LIBS" |
154 |
+ |
LIBS="$LIBS -framework $1" |
155 |
+ |
if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then |
156 |
+ |
if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then |
157 |
+ |
LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1" |
158 |
+ |
fi |
159 |
+ |
fi |
160 |
+ |
saved_CPPFLAGS="$CPPFLAGS" |
161 |
+ |
CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers" |
162 |
+ |
AC_TRY_LINK( |
163 |
+ |
[$2 |
164 |
+ |
#undef main], [], |
165 |
+ |
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); |
166 |
+ |
LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"] |
167 |
+ |
) |
168 |
+ |
]) |
169 |
+ |
AS_IF([test AS_VAR_GET(ac_Framework) = yes], |
170 |
+ |
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])] |
171 |
+ |
) |
172 |
+ |
AS_VAR_POPDEF([ac_Framework]) |
173 |
+ |
]) |
174 |
|
|
175 |
< |
dnl We need X11. |
176 |
< |
AC_PATH_XTRA |
177 |
< |
if [[ "x$no_x" = "xyes" ]]; then |
178 |
< |
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
179 |
< |
fi |
180 |
< |
CFLAGS="$CFLAGS $X_CFLAGS" |
181 |
< |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
182 |
< |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
175 |
> |
dnl Do we need SDL? |
176 |
> |
WANT_SDL=no |
177 |
> |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
178 |
> |
WANT_SDL=yes |
179 |
> |
WANT_XF86_DGA=no |
180 |
> |
WANT_XF86_VIDMODE=no |
181 |
> |
WANT_FBDEV_DGA=no |
182 |
> |
SDL_SUPPORT="$SDL_SUPPORT video" |
183 |
> |
fi |
184 |
> |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
185 |
> |
WANT_SDL=yes |
186 |
> |
SDL_SUPPORT="$SDL_SUPPORT audio" |
187 |
> |
fi |
188 |
> |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
189 |
> |
if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then |
190 |
> |
AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>]) |
191 |
> |
else |
192 |
> |
ac_cv_framework_SDL=no |
193 |
> |
fi |
194 |
> |
if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then |
195 |
> |
AC_PATH_PROG(sdl_config, "sdl-config") |
196 |
> |
if [[ -n "$sdl_config" ]]; then |
197 |
> |
case $target_os in |
198 |
> |
# Special treatment for Cygwin so that we can still use the POSIX layer |
199 |
> |
*cygwin*) |
200 |
> |
sdl_cflags="-I`$sdl_config --prefix`/include/SDL" |
201 |
> |
sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" |
202 |
> |
;; |
203 |
> |
*) |
204 |
> |
sdl_cflags=`$sdl_config --cflags` |
205 |
> |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
206 |
> |
sdl_libs=`$sdl_config --static-libs` |
207 |
> |
else |
208 |
> |
sdl_libs=`$sdl_config --libs` |
209 |
> |
fi |
210 |
> |
;; |
211 |
> |
esac |
212 |
> |
CFLAGS="$CFLAGS $sdl_cflags" |
213 |
> |
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
214 |
> |
LIBS="$LIBS $sdl_libs" |
215 |
> |
else |
216 |
> |
WANT_SDL=no |
217 |
> |
fi |
218 |
> |
fi |
219 |
> |
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"` |
220 |
> |
else |
221 |
> |
SDL_SUPPORT="none" |
222 |
> |
fi |
223 |
> |
|
224 |
> |
dnl We need X11, if not using SDL. |
225 |
> |
if [[ "x$WANT_SDL" = "xno" ]]; then |
226 |
> |
AC_PATH_XTRA |
227 |
> |
if [[ "x$no_x" = "xyes" ]]; then |
228 |
> |
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
229 |
> |
fi |
230 |
> |
CFLAGS="$CFLAGS $X_CFLAGS" |
231 |
> |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
232 |
> |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
233 |
> |
fi |
234 |
|
|
235 |
|
dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. |
236 |
|
HAVE_PTHREADS=yes |
244 |
|
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then |
245 |
|
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) |
246 |
|
fi |
247 |
< |
AC_CHECK_FUNCS(pthread_cancel) |
247 |
> |
AC_CHECK_FUNCS(pthread_cond_init) |
248 |
> |
AC_CHECK_FUNCS(pthread_cancel pthread_testcancel) |
249 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
250 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
251 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setpshared) |
289 |
|
|
290 |
|
dnl We use GTK+ if possible. |
291 |
|
UISRCS=../dummy/prefs_editor_dummy.cpp |
292 |
< |
if [[ "x$WANT_GTK" = "xyes" ]]; then |
292 |
> |
case "x$WANT_GTK" in |
293 |
> |
xgtk2*) |
294 |
> |
AM_PATH_GTK_2_0(1.3.15, [ |
295 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
296 |
> |
GUI_LIBS="$GTK_LIBS" |
297 |
> |
WANT_GTK=gtk2 |
298 |
> |
], [ |
299 |
> |
case "x${WANT_GTK}x" in |
300 |
> |
*gtkx) |
301 |
> |
AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.]) |
302 |
> |
WANT_GTK=gtk |
303 |
> |
;; |
304 |
> |
*) |
305 |
> |
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
306 |
> |
WANT_GTK=no |
307 |
> |
;; |
308 |
> |
esac |
309 |
> |
]) |
310 |
> |
;; |
311 |
> |
esac |
312 |
> |
if [[ "x$WANT_GTK" = "xgtk" ]]; then |
313 |
|
AM_PATH_GTK(1.2.0, [ |
314 |
< |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
315 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
188 |
< |
LIBS="$LIBS $GTK_LIBS" |
189 |
< |
UISRCS=prefs_editor_gtk.cpp |
314 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
315 |
> |
GUI_LIBS="$GTK_LIBS" |
316 |
|
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
317 |
|
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
318 |
|
dnl includes <libintl.h> |
319 |
|
AM_GNU_GETTEXT |
320 |
|
B2_PATH_GNOMEUI([ |
321 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
322 |
< |
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
323 |
< |
LIBS="$LIBS $GNOMEUI_LIBS" |
322 |
> |
GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS" |
323 |
> |
GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS" |
324 |
|
], []) |
325 |
|
], [ |
326 |
|
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
327 |
|
WANT_GTK=no |
328 |
|
]) |
329 |
|
fi |
330 |
+ |
if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then |
331 |
+ |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
332 |
+ |
UISRCS=prefs_editor_gtk.cpp |
333 |
+ |
fi |
334 |
+ |
AC_SUBST(GUI_CFLAGS) |
335 |
+ |
AC_SUBST(GUI_LIBS) |
336 |
+ |
|
337 |
+ |
dnl Build external GUI if requested. |
338 |
+ |
if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then |
339 |
+ |
WANT_STANDALONE_GUI=no |
340 |
+ |
fi |
341 |
+ |
if [[ "$WANT_GTK" = "no" ]]; then |
342 |
+ |
WANT_STANDALONE_GUI=no |
343 |
+ |
fi |
344 |
+ |
AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI]) |
345 |
|
|
346 |
|
dnl We use ESD if possible. |
347 |
|
if [[ "x$WANT_ESD" = "xyes" ]]; then |
361 |
|
|
362 |
|
dnl Checks for header files. |
363 |
|
AC_HEADER_STDC |
364 |
< |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h) |
364 |
> |
AC_CHECK_HEADERS(stdlib.h stdint.h) |
365 |
> |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h) |
366 |
> |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
367 |
> |
AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h) |
368 |
> |
AC_CHECK_HEADERS(sys/poll.h sys/select.h) |
369 |
> |
AC_CHECK_HEADERS(arpa/inet.h) |
370 |
> |
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [ |
371 |
> |
#ifdef HAVE_SYS_TYPES_H |
372 |
> |
#include <sys/types.h> |
373 |
> |
#endif |
374 |
> |
#ifdef HAVE_SYS_SOCKET_H |
375 |
> |
#include <sys/socket.h> |
376 |
> |
#endif |
377 |
> |
]) |
378 |
> |
AC_CHECK_HEADERS(AvailabilityMacros.h) |
379 |
> |
AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h) |
380 |
|
|
381 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
382 |
|
AC_C_BIGENDIAN |
391 |
|
AC_CHECK_SIZEOF(long double, 12) |
392 |
|
AC_CHECK_SIZEOF(void *, 4) |
393 |
|
AC_TYPE_OFF_T |
394 |
< |
AC_CHECK_TYPE(loff_t, off_t) |
395 |
< |
AC_CHECK_TYPE(caddr_t, [char *]) |
394 |
> |
AC_CHECK_TYPES(loff_t) |
395 |
> |
AC_CHECK_TYPES(caddr_t) |
396 |
|
AC_TYPE_SIZE_T |
397 |
|
AC_TYPE_SIGNAL |
398 |
|
AC_HEADER_TIME |
416 |
|
fi |
417 |
|
|
418 |
|
dnl Checks for library functions. |
419 |
< |
AC_CHECK_FUNCS(strdup cfmakeraw) |
419 |
> |
AC_CHECK_FUNCS(strdup strerror cfmakeraw) |
420 |
|
AC_CHECK_FUNCS(clock_gettime timer_create) |
421 |
|
AC_CHECK_FUNCS(sigaction signal) |
422 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
423 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
424 |
+ |
AC_CHECK_FUNCS(poll inet_aton) |
425 |
|
|
426 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
427 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
448 |
|
*-*-sco3.2v5*) |
449 |
|
no_dev_ptmx=1 |
450 |
|
;; |
451 |
+ |
*-*-cygwin*) |
452 |
+ |
no_dev_ptmx=1 |
453 |
+ |
;; |
454 |
+ |
*-*-darwin*) |
455 |
+ |
no_dev_ptmx=1 |
456 |
+ |
;; |
457 |
|
esac |
458 |
|
|
459 |
|
if test -z "$no_dev_ptmx" ; then |
476 |
|
dnl (end of code from openssh-3.2.2p1 configure.ac) |
477 |
|
|
478 |
|
|
479 |
+ |
dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK) |
480 |
+ |
dnl doesn't work or is unimplemented. On these systems (mostly older |
481 |
+ |
dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4] |
482 |
+ |
AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O], |
483 |
+ |
ac_cv_nonblocking_io, [ |
484 |
+ |
case "$host" in |
485 |
+ |
*-*-osf*) |
486 |
+ |
ac_cv_nonblocking_io=FIONBIO |
487 |
+ |
;; |
488 |
+ |
*-*-sunos4*) |
489 |
+ |
ac_cv_nonblocking_io=FIONBIO |
490 |
+ |
;; |
491 |
+ |
*-*-ultrix*) |
492 |
+ |
ac_cv_nonblocking_io=FIONBIO |
493 |
+ |
;; |
494 |
+ |
*) |
495 |
+ |
ac_cv_nonblocking_io=O_NONBLOCK |
496 |
+ |
;; |
497 |
+ |
esac |
498 |
+ |
]) |
499 |
+ |
if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then |
500 |
+ |
AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used]) |
501 |
+ |
fi |
502 |
+ |
|
503 |
+ |
dnl Check whether compiler supports byte bit-fields |
504 |
+ |
AC_CACHE_CHECK([whether compiler supports byte bit-fields], |
505 |
+ |
ac_cv_have_byte_bitfields, [ |
506 |
+ |
AC_LANG_SAVE |
507 |
+ |
AC_LANG_CPLUSPLUS |
508 |
+ |
AC_TRY_RUN([ |
509 |
+ |
struct A { |
510 |
+ |
unsigned char b1:4; |
511 |
+ |
unsigned char b2:4; |
512 |
+ |
unsigned char c; |
513 |
+ |
unsigned short s; |
514 |
+ |
unsigned char a[4]; |
515 |
+ |
}; |
516 |
+ |
|
517 |
+ |
int main(void) { |
518 |
+ |
A a; |
519 |
+ |
return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1)); |
520 |
+ |
}], |
521 |
+ |
[ac_cv_have_byte_bitfields=yes], |
522 |
+ |
[ac_cv_have_byte_bitfields=no], |
523 |
+ |
dnl When cross-compiling, assume only GCC supports this |
524 |
+ |
[if [[ "$GCC" = "yes" ]]; then |
525 |
+ |
ac_cv_have_byte_bitfields="guessing yes" |
526 |
+ |
else |
527 |
+ |
ac_cv_have_byte_bitfields="guessing no" |
528 |
+ |
fi] |
529 |
+ |
) |
530 |
+ |
AC_LANG_RESTORE |
531 |
+ |
]) |
532 |
+ |
|
533 |
+ |
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES) |
534 |
+ |
AC_DEFUN([AC_CHECK_FRAMEWORK], [ |
535 |
+ |
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl |
536 |
+ |
AC_CACHE_CHECK([whether compiler supports framework $1], |
537 |
+ |
ac_Framework, [ |
538 |
+ |
saved_LIBS="$LIBS" |
539 |
+ |
LIBS="$LIBS -framework $1" |
540 |
+ |
AC_TRY_LINK( |
541 |
+ |
[$2], [], |
542 |
+ |
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"] |
543 |
+ |
) |
544 |
+ |
]) |
545 |
+ |
AS_IF([test AS_VAR_GET(ac_Framework) = yes], |
546 |
+ |
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])] |
547 |
+ |
) |
548 |
+ |
AS_VAR_POPDEF([ac_Framework])dnl |
549 |
+ |
]) |
550 |
+ |
|
551 |
+ |
dnl Check for some MacOS X frameworks |
552 |
+ |
AC_CHECK_FRAMEWORK(AppKit, []) |
553 |
+ |
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
554 |
+ |
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
555 |
+ |
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>]) |
556 |
+ |
|
557 |
|
dnl Select system-dependant source files. |
558 |
|
SERIALSRC=serial_unix.cpp |
559 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
560 |
|
SCSISRC=../dummy/scsi_dummy.cpp |
561 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
562 |
+ |
EXTFSSRC=extfs_unix.cpp |
563 |
|
EXTRASYSSRCS= |
564 |
|
CAN_NATIVE_M68K=no |
565 |
|
case "$target_os" in |
593 |
|
;; |
594 |
|
netbsd*) |
595 |
|
CAN_NATIVE_M68K=yes |
596 |
+ |
ETHERSRC=ether_unix.cpp |
597 |
|
;; |
598 |
|
solaris*) |
599 |
|
AUDIOSRC=Solaris/audio_solaris.cpp |
600 |
|
DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS" |
601 |
|
;; |
602 |
|
irix*) |
360 |
– |
ETHERSRC=ether_unix.cpp |
603 |
|
AUDIOSRC=Irix/audio_irix.cpp |
604 |
|
EXTRASYSSRCS=Irix/unaligned.c |
363 |
– |
dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS" |
364 |
– |
DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS" |
605 |
|
LIBS="$LIBS -laudio" |
606 |
|
WANT_ESD=no |
607 |
|
|
611 |
|
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
612 |
|
AC_MSG_CHECKING(if "-IPA" works) |
613 |
|
dnl Do a test compile of an empty function |
614 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
614 |
> |
AC_TRY_COMPILE([#if defined __GNUC__ |
615 |
> |
# error GCC does not support IPA yet |
616 |
> |
#endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
617 |
|
CFLAGS="$ocflags" |
618 |
+ |
;; |
619 |
+ |
darwin*) |
620 |
+ |
ETHERSRC=ether_unix.cpp |
621 |
+ |
if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then |
622 |
+ |
EXTRASYSSRCS="../MacOSX/sys_darwin.cpp" |
623 |
+ |
fi |
624 |
+ |
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
625 |
+ |
EXTFSSRC=../MacOSX/extfs_macosx.cpp |
626 |
+ |
fi |
627 |
+ |
;; |
628 |
+ |
cygwin*) |
629 |
+ |
SERIALSRC="../dummy/serial_dummy.cpp" |
630 |
+ |
EXTRASYSSRCS="../Windows/BasiliskII.rc" |
631 |
+ |
;; |
632 |
+ |
esac |
633 |
|
|
634 |
+ |
dnl Is the slirp library supported? |
635 |
+ |
case "$ac_cv_have_byte_bitfields" in |
636 |
+ |
yes|"guessing yes") |
637 |
+ |
CAN_SLIRP=yes |
638 |
+ |
ETHERSRC=ether_unix.cpp |
639 |
|
;; |
640 |
|
esac |
641 |
+ |
if [[ -n "$CAN_SLIRP" ]]; then |
642 |
+ |
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported]) |
643 |
+ |
SLIRP_SRCS="\ |
644 |
+ |
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ |
645 |
+ |
../slirp/cksum.c ../slirp/mbuf.c ../slirp/tcp_output.c \ |
646 |
+ |
../slirp/debug.c ../slirp/misc.c ../slirp/tcp_subr.c \ |
647 |
+ |
../slirp/if.c ../slirp/sbuf.c ../slirp/tcp_timer.c \ |
648 |
+ |
../slirp/ip_icmp.c ../slirp/slirp.c ../slirp/tftp.c \ |
649 |
+ |
../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c" |
650 |
+ |
fi |
651 |
+ |
AC_SUBST(SLIRP_SRCS) |
652 |
+ |
|
653 |
+ |
dnl SDL overrides |
654 |
+ |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
655 |
+ |
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) |
656 |
+ |
if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then |
657 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m" |
658 |
+ |
fi |
659 |
+ |
fi |
660 |
+ |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
661 |
+ |
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support]) |
662 |
+ |
VIDEOSRCS="../SDL/video_sdl.cpp" |
663 |
+ |
KEYCODES="../SDL/keycodes" |
664 |
+ |
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
665 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" |
666 |
+ |
else |
667 |
+ |
case "$target_os" in |
668 |
+ |
cygwin*) |
669 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp" |
670 |
+ |
;; |
671 |
+ |
*) |
672 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
673 |
+ |
;; |
674 |
+ |
esac |
675 |
+ |
fi |
676 |
+ |
else |
677 |
+ |
VIDEOSRCS="video_x.cpp" |
678 |
+ |
KEYCODES="keycodes" |
679 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp" |
680 |
+ |
fi |
681 |
+ |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
682 |
+ |
AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support]) |
683 |
+ |
AUDIOSRC="../SDL/audio_sdl.cpp" |
684 |
+ |
fi |
685 |
|
|
686 |
|
dnl Use 68k CPU natively? |
687 |
|
WANT_NATIVE_M68K=no |
697 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
698 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
699 |
|
fi |
700 |
< |
SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
700 |
> |
SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
701 |
|
|
702 |
|
dnl Define a macro that translates a yesno-variable into a C macro definition |
703 |
|
dnl to be put into the config.h file |
704 |
|
dnl $1 -- the macro to define |
705 |
|
dnl $2 -- the value to translate |
706 |
|
dnl $3 -- template name |
707 |
< |
AC_DEFUN(AC_TRANSLATE_DEFINE, [ |
707 |
> |
AC_DEFUN([AC_TRANSLATE_DEFINE], [ |
708 |
|
if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then |
709 |
|
AC_DEFINE($1, 1, $3) |
710 |
|
fi |
711 |
|
]) |
712 |
|
|
713 |
+ |
dnl Check that the host supports TUN/TAP devices |
714 |
+ |
AC_CACHE_CHECK([whether TUN/TAP is supported], |
715 |
+ |
ac_cv_tun_tap_support, [ |
716 |
+ |
AC_TRY_COMPILE([ |
717 |
+ |
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H) |
718 |
+ |
#include <linux/if.h> |
719 |
+ |
#include <linux/if_tun.h> |
720 |
+ |
#endif |
721 |
+ |
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H) |
722 |
+ |
#include <net/if.h> |
723 |
+ |
#include <net/if_tun.h> |
724 |
+ |
#endif |
725 |
+ |
], [ |
726 |
+ |
struct ifreq ifr; |
727 |
+ |
memset(&ifr, 0, sizeof(ifr)); |
728 |
+ |
ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
729 |
+ |
], |
730 |
+ |
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no |
731 |
+ |
) |
732 |
+ |
]) |
733 |
+ |
AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support", |
734 |
+ |
[Define if your system supports TUN/TAP devices.]) |
735 |
+ |
|
736 |
|
dnl Various checks if the system supports vm_allocate() and the like functions. |
737 |
|
have_mach_vm=no |
738 |
|
if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \ |
879 |
|
|
880 |
|
fi dnl HAVE_MMAP_VM |
881 |
|
|
882 |
+ |
dnl Check if we can modify the __PAGEZERO segment for use as Low Memory |
883 |
+ |
AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000], |
884 |
+ |
ac_cv_pagezero_hack, [ |
885 |
+ |
ac_cv_pagezero_hack=no |
886 |
+ |
if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then |
887 |
+ |
ac_cv_pagezero_hack=yes |
888 |
+ |
dnl might as well skip the test for mmap-able low memory |
889 |
+ |
ac_cv_can_map_lm=no |
890 |
+ |
fi |
891 |
+ |
]) |
892 |
+ |
AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack", |
893 |
+ |
[Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.]) |
894 |
+ |
|
895 |
|
dnl Check if we can mmap 0x2000 bytes from 0x0000 |
896 |
|
AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000], |
897 |
|
ac_cv_can_map_lm, [ |
976 |
|
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall", |
977 |
|
[Define if your system requires sigactions to be reinstalled.]) |
978 |
|
|
979 |
< |
dnl Check if extended signals are supported. |
980 |
< |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
981 |
< |
ac_cv_have_extended_signals, [ |
979 |
> |
dnl Check if Mach exceptions supported. |
980 |
> |
AC_CACHE_CHECK([whether your system supports Mach exceptions], |
981 |
> |
ac_cv_have_mach_exceptions, [ |
982 |
> |
AC_LANG_SAVE |
983 |
> |
AC_LANG_CPLUSPLUS |
984 |
> |
AC_TRY_RUN([ |
985 |
> |
#define HAVE_MACH_EXCEPTIONS 1 |
986 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
987 |
> |
#include "vm_alloc.cpp" |
988 |
> |
#include "sigsegv.cpp" |
989 |
> |
], [ |
990 |
> |
sigsegv_recovery=mach |
991 |
> |
ac_cv_have_mach_exceptions=yes |
992 |
> |
], |
993 |
> |
ac_cv_have_mach_exceptions=no, |
994 |
> |
dnl When cross-compiling, do not assume anything. |
995 |
> |
ac_cv_have_mach_exceptions=no |
996 |
> |
) |
997 |
> |
AC_LANG_RESTORE |
998 |
> |
] |
999 |
> |
) |
1000 |
> |
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
1001 |
> |
[Define if your system supports Mach exceptions.]) |
1002 |
> |
|
1003 |
> |
dnl Check if Windows exceptions are supported. |
1004 |
> |
AC_CACHE_CHECK([whether your system supports Windows exceptions], |
1005 |
> |
ac_cv_have_win32_exceptions, [ |
1006 |
|
AC_LANG_SAVE |
1007 |
|
AC_LANG_CPLUSPLUS |
1008 |
|
AC_TRY_RUN([ |
1009 |
< |
#define HAVE_SIGINFO_T 1 |
1009 |
> |
#define HAVE_WIN32_EXCEPTIONS 1 |
1010 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
1011 |
|
#include "vm_alloc.cpp" |
1012 |
|
#include "sigsegv.cpp" |
1013 |
< |
], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no, |
1013 |
> |
], [ |
1014 |
> |
sigsegv_recovery=win32 |
1015 |
> |
ac_cv_have_win32_exceptions=yes |
1016 |
> |
], |
1017 |
> |
ac_cv_have_win32_exceptions=no, |
1018 |
|
dnl When cross-compiling, do not assume anything. |
1019 |
< |
ac_cv_have_extended_signals=no |
1019 |
> |
ac_cv_have_win32_exceptions=no |
1020 |
|
) |
1021 |
|
AC_LANG_RESTORE |
1022 |
|
] |
1023 |
|
) |
1024 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
1025 |
< |
[Define if your system support extended signals.]) |
1024 |
> |
AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions", |
1025 |
> |
[Define if your system supports Windows exceptions.]) |
1026 |
> |
|
1027 |
> |
dnl Otherwise, check if extended signals are supported. |
1028 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
1029 |
> |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
1030 |
> |
ac_cv_have_extended_signals, [ |
1031 |
> |
AC_LANG_SAVE |
1032 |
> |
AC_LANG_CPLUSPLUS |
1033 |
> |
AC_TRY_RUN([ |
1034 |
> |
#define HAVE_SIGINFO_T 1 |
1035 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
1036 |
> |
#include "vm_alloc.cpp" |
1037 |
> |
#include "sigsegv.cpp" |
1038 |
> |
], [ |
1039 |
> |
sigsegv_recovery=siginfo |
1040 |
> |
ac_cv_have_extended_signals=yes |
1041 |
> |
], |
1042 |
> |
ac_cv_have_extended_signals=no, |
1043 |
> |
dnl When cross-compiling, do not assume anything. |
1044 |
> |
ac_cv_have_extended_signals=no |
1045 |
> |
) |
1046 |
> |
AC_LANG_RESTORE |
1047 |
> |
] |
1048 |
> |
) |
1049 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
1050 |
> |
[Define if your system support extended signals.]) |
1051 |
> |
fi |
1052 |
|
|
1053 |
|
dnl Otherwise, check for subterfuges. |
1054 |
< |
if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then |
1054 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
1055 |
|
AC_CACHE_CHECK([whether we then have a subterfuge for your system], |
1056 |
|
ac_cv_have_sigcontext_hack, [ |
1057 |
|
AC_LANG_SAVE |
1061 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
1062 |
|
#include "vm_alloc.cpp" |
1063 |
|
#include "sigsegv.cpp" |
1064 |
< |
], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no, |
1064 |
> |
], [ |
1065 |
> |
sigsegv_recovery=sigcontext |
1066 |
> |
ac_cv_have_sigcontext_hack=yes |
1067 |
> |
], |
1068 |
> |
ac_cv_have_sigcontext_hack=no, |
1069 |
|
dnl When cross-compiling, do not assume anything. |
1070 |
|
ac_cv_have_sigcontext_hack=no |
1071 |
|
) |
1097 |
|
|
1098 |
|
dnl Can we do Video on SEGV Signals ? |
1099 |
|
CAN_VOSF=no |
1100 |
< |
if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
1100 |
> |
if [[ -n "$sigsegv_recovery" ]]; then |
1101 |
|
CAN_VOSF=yes |
1102 |
|
fi |
1103 |
|
|
1104 |
+ |
dnl A dummy program that returns always true |
1105 |
+ |
AC_PATH_PROG([BLESS], "true") |
1106 |
+ |
|
1107 |
+ |
dnl Check for linker script support |
1108 |
+ |
case $target_os:$target_cpu in |
1109 |
+ |
linux*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1110 |
+ |
linux*:x86_64) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";; |
1111 |
+ |
linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";; |
1112 |
+ |
netbsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1113 |
+ |
freebsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";; |
1114 |
+ |
darwin*:*) LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";; |
1115 |
+ |
esac |
1116 |
+ |
if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then |
1117 |
+ |
AC_CACHE_CHECK([whether linker script is usable], |
1118 |
+ |
ac_cv_linker_script_works, [ |
1119 |
+ |
AC_LANG_SAVE |
1120 |
+ |
AC_LANG_CPLUSPLUS |
1121 |
+ |
saved_LDFLAGS="$LDFLAGS" |
1122 |
+ |
LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS" |
1123 |
+ |
AC_TRY_RUN( |
1124 |
+ |
[int main() {if ((char *)&main < (char *)0x70000000) return 1;}], |
1125 |
+ |
[ac_cv_linker_script_works=yes], |
1126 |
+ |
[ac_cv_linker_script_works=no], |
1127 |
+ |
dnl When cross-compiling, assume it works |
1128 |
+ |
[ac_cv_linker_script_works="guessing yes"] |
1129 |
+ |
) |
1130 |
+ |
AC_LANG_RESTORE |
1131 |
+ |
if [[ "$ac_cv_linker_script_works" = "no" ]]; then |
1132 |
+ |
LDFLAGS="$saved_LDFLAGS" |
1133 |
+ |
LINKER_SCRIPT_FLAGS="" |
1134 |
+ |
fi |
1135 |
+ |
]) |
1136 |
+ |
fi |
1137 |
+ |
AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works", |
1138 |
+ |
[Define if there is a linker script to relocate the executable above 0x70000000.]) |
1139 |
+ |
|
1140 |
|
dnl Determine the addressing mode to use |
1141 |
|
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
1142 |
|
ADDRESSING_MODE="real" |
1147 |
|
case $am in |
1148 |
|
real) |
1149 |
|
dnl Requires ability to mmap() Low Memory globals |
1150 |
< |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
1150 |
> |
if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then |
1151 |
|
continue |
1152 |
|
fi |
1153 |
< |
dnl Requires VOSF screen updates |
1153 |
> |
dnl Requires VOSF screen updates |
1154 |
|
if [[ "x$CAN_VOSF" = "xno" ]]; then |
1155 |
|
continue |
1156 |
|
fi |
1158 |
|
ADDRESSING_MODE="real" |
1159 |
|
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
1160 |
|
DEFINES="$DEFINES -DREAL_ADDRESSING" |
1161 |
+ |
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
1162 |
+ |
BLESS=Darwin/lowmem |
1163 |
+ |
LDFLAGS="$LDFLAGS -pagezero_size 0x2000" |
1164 |
+ |
fi |
1165 |
|
break |
1166 |
|
;; |
1167 |
|
direct) |
1214 |
|
dnl Check for GCC 2.7 or higher. |
1215 |
|
HAVE_GCC27=no |
1216 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
1217 |
< |
AC_EGREP_CPP(xyes, |
1218 |
< |
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
1219 |
< |
xyes |
1220 |
< |
#endif |
1221 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
1217 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5) |
1218 |
> |
# error gcc < 2.7 |
1219 |
> |
#endif |
1220 |
> |
]])], |
1221 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC27=yes], |
1222 |
> |
[AC_MSG_RESULT(no)]) |
1223 |
|
|
1224 |
|
dnl Check for GCC 3.0 or higher. |
1225 |
|
HAVE_GCC30=no |
1226 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
1227 |
< |
AC_EGREP_CPP(xyes, |
1228 |
< |
[#if __GNUC__ >= 3 |
1229 |
< |
xyes |
1230 |
< |
#endif |
1231 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1227 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3) |
1228 |
> |
# error gcc < 3 |
1229 |
> |
#endif |
1230 |
> |
]])], |
1231 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC30=yes], |
1232 |
> |
[AC_MSG_RESULT(no)]) |
1233 |
> |
|
1234 |
> |
dnl Check for ICC. |
1235 |
> |
AC_MSG_CHECKING(for ICC) |
1236 |
> |
HAVE_ICC=no |
1237 |
> |
if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then |
1238 |
> |
HAVE_ICC=yes |
1239 |
> |
fi |
1240 |
> |
AC_MSG_RESULT($HAVE_ICC) |
1241 |
|
|
1242 |
|
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher. |
1243 |
|
dnl Also set "-fno-exceptions" for C++ because exception handling requires |
1252 |
|
dnl Official: probably gcc-3.1 (mainline CVS) |
1253 |
|
dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk |
1254 |
|
dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1 |
1255 |
< |
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1255 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1256 |
|
SAVED_CXXFLAGS="$CXXFLAGS" |
1257 |
|
CXXFLAGS="$CXXFLAGS -fno-merge-constants" |
1258 |
|
AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [ |
1266 |
|
fi |
1267 |
|
fi |
1268 |
|
|
1269 |
+ |
dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4 |
1270 |
+ |
dnl However, there are some corner cases exposed on x86-64 |
1271 |
+ |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1272 |
+ |
SAVED_CXXFLAGS="$CXXFLAGS" |
1273 |
+ |
CXXFLAGS="$CXXFLAGS -fno-gcse-sm" |
1274 |
+ |
AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [ |
1275 |
+ |
AC_LANG_SAVE |
1276 |
+ |
AC_LANG_CPLUSPLUS |
1277 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no]) |
1278 |
+ |
AC_LANG_RESTORE |
1279 |
+ |
]) |
1280 |
+ |
if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then |
1281 |
+ |
CXXFLAGS="$SAVED_CXXFLAGS" |
1282 |
+ |
fi |
1283 |
+ |
fi |
1284 |
+ |
|
1285 |
+ |
dnl Add -fno-strict-aliasing for slirp sources |
1286 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1287 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1288 |
+ |
CFLAGS="$CFLAGS -fno-strict-aliasing" |
1289 |
+ |
AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing], |
1290 |
+ |
ac_cv_gcc_no_strict_aliasing, [ |
1291 |
+ |
AC_TRY_COMPILE([],[], |
1292 |
+ |
[ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")], |
1293 |
+ |
[ac_cv_gcc_no_strict_aliasing=no]) |
1294 |
+ |
]) |
1295 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1296 |
+ |
fi |
1297 |
+ |
|
1298 |
+ |
dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X) |
1299 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1300 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1301 |
+ |
CFLAGS="$CFLAGS -mdynamic-no-pic" |
1302 |
+ |
AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic], |
1303 |
+ |
ac_cv_gcc_mdynamic_no_pic, [ |
1304 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no]) |
1305 |
+ |
]) |
1306 |
+ |
if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then |
1307 |
+ |
CXXFLAGS="$CXXFLAGS -mdynamic-no-pic" |
1308 |
+ |
else |
1309 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1310 |
+ |
fi |
1311 |
+ |
fi |
1312 |
+ |
|
1313 |
|
dnl Select appropriate CPU source and REGPARAM define. |
1314 |
|
ASM_OPTIMIZATIONS=none |
1315 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
1334 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
1335 |
|
ASM_OPTIMIZATIONS="x86-64" |
1336 |
|
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
1337 |
+ |
JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS" |
1338 |
+ |
CAN_JIT=yes |
1339 |
|
fi |
1340 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
1341 |
|
dnl SPARC CPU |
1589 |
|
|
1590 |
|
dnl Remove the "-g" option if set for GCC. |
1591 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1592 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'` |
1593 |
< |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1592 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'` |
1593 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'` |
1594 |
|
fi |
1595 |
|
|
1596 |
|
dnl Or if we have -IPA (MIPSPro compilers) |
1606 |
|
AC_SUBST(SYSSRCS) |
1607 |
|
AC_SUBST(CPUINCLUDES) |
1608 |
|
AC_SUBST(CPUSRCS) |
1609 |
+ |
AC_SUBST(BLESS) |
1610 |
+ |
AC_SUBST(KEYCODES) |
1611 |
|
AC_CONFIG_FILES([Makefile]) |
1612 |
|
AC_OUTPUT |
1613 |
|
|
1615 |
|
echo |
1616 |
|
echo Basilisk II configuration summary: |
1617 |
|
echo |
1618 |
+ |
echo SDL support ............................ : $SDL_SUPPORT |
1619 |
|
echo XFree86 DGA support .................... : $WANT_XF86_DGA |
1620 |
|
echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE |
1621 |
|
echo fbdev DGA support ...................... : $WANT_FBDEV_DGA |
1629 |
|
echo Floating-Point emulation core .......... : $FPE_CORE |
1630 |
|
echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS |
1631 |
|
echo Addressing mode ........................ : $ADDRESSING_MODE |
1632 |
+ |
echo Bad memory access recovery type ........ : $sigsegv_recovery |
1633 |
|
echo |
1634 |
|
echo "Configuration done. Now type \"make\" (or \"gmake\")." |