1 |
|
dnl Process this file with autoconf to produce a configure script. |
2 |
|
dnl Written in 2002 by Christian Bauer et al. |
3 |
|
|
4 |
< |
AC_INIT(main_unix.cpp) |
4 |
> |
AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII) |
5 |
> |
AC_CONFIG_SRCDIR(main_unix.cpp) |
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 |
|
dnl Video options. |
18 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
19 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
20 |
|
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]) |
21 |
|
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
22 |
|
|
23 |
+ |
dnl SDL options. |
24 |
+ |
AC_ARG_ENABLE(sdl-static, [ --enable-sdl-static use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no]) |
25 |
+ |
AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no]) |
26 |
+ |
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no]) |
27 |
+ |
|
28 |
|
dnl JIT compiler options. |
29 |
|
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no]) |
30 |
|
AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no]) |
60 |
|
|
61 |
|
dnl External packages. |
62 |
|
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
63 |
< |
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) |
63 |
> |
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], |
64 |
> |
[case "$withval" in |
65 |
> |
gtk1) WANT_GTK="gtk";; |
66 |
> |
gtk|gtk2) WANT_GTK="$withval";; |
67 |
> |
yes) WANT_GTK="gtk2 gtk";; |
68 |
> |
*) WANT_GTK="no";; |
69 |
> |
esac], |
70 |
> |
[WANT_GTK="gtk2 gtk"]) |
71 |
|
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes]) |
72 |
|
|
73 |
|
dnl Canonical system information. |
90 |
|
HAVE_M68K=no |
91 |
|
HAVE_SPARC=no |
92 |
|
HAVE_POWERPC=no |
93 |
+ |
HAVE_X86_64=no |
94 |
|
case "$target_cpu" in |
95 |
< |
i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;; |
96 |
< |
m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;; |
97 |
< |
sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;; |
98 |
< |
powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;; |
99 |
< |
*) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/g'`;; |
95 |
> |
i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;; |
96 |
> |
m68k* ) HAVE_M68K=yes;; |
97 |
> |
sparc* ) HAVE_SPARC=yes;; |
98 |
> |
powerpc* ) HAVE_POWERPC=yes;; |
99 |
> |
x86_64* ) HAVE_X86_64=yes;; |
100 |
|
esac |
79 |
– |
DEFINES="$DEFINES -DCPU_$CPU_TYPE" |
101 |
|
|
102 |
|
dnl Checks for programs. |
103 |
|
AC_PROG_CC |
106 |
|
AC_PROG_CXX |
107 |
|
AC_PROG_MAKE_SET |
108 |
|
AC_PROG_INSTALL |
109 |
+ |
AC_PROG_EGREP |
110 |
|
|
111 |
|
dnl We use mon if possible. |
112 |
|
MONSRCS= |
125 |
|
AC_CHECK_LIB(Hcurses, tgetent, , |
126 |
|
AC_CHECK_LIB(curses, tgetent)))))) |
127 |
|
AC_CHECK_LIB(readline, readline) |
106 |
– |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
128 |
|
else |
129 |
|
AC_MSG_RESULT(no) |
130 |
|
AC_MSG_WARN([Could not find mon, ignoring --with-mon.]) |
135 |
|
dnl Checks for libraries. |
136 |
|
AC_CHECK_LIB(posix4, sem_init) |
137 |
|
AC_CHECK_LIB(rt, timer_create) |
138 |
+ |
AC_CHECK_LIB(rt, shm_open) |
139 |
+ |
|
140 |
+ |
dnl Do we need SDL? |
141 |
+ |
WANT_SDL=no |
142 |
+ |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
143 |
+ |
WANT_SDL=yes |
144 |
+ |
WANT_XF86_DGA=no |
145 |
+ |
WANT_XF86_VIDMODE=no |
146 |
+ |
WANT_FBDEV_DGA=no |
147 |
+ |
SDL_SUPPORT="$SDL_SUPPORT video" |
148 |
+ |
fi |
149 |
+ |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
150 |
+ |
WANT_SDL=yes |
151 |
+ |
SDL_SUPPORT="$SDL_SUPPORT audio" |
152 |
+ |
fi |
153 |
+ |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
154 |
+ |
AC_PATH_PROG(sdl_config, "sdl-config") |
155 |
+ |
if [[ -n "$sdl_config" ]]; then |
156 |
+ |
case $target_os in |
157 |
+ |
# Special treatment for Cygwin so that we can still use the POSIX layer |
158 |
+ |
*cygwin*) |
159 |
+ |
sdl_cflags="-I`$sdl_config --prefix`/include/SDL" |
160 |
+ |
sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" |
161 |
+ |
;; |
162 |
+ |
*) |
163 |
+ |
sdl_cflags=`$sdl_config --cflags` |
164 |
+ |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
165 |
+ |
sdl_libs=`$sdl_config --static-libs` |
166 |
+ |
else |
167 |
+ |
sdl_libs=`$sdl_config --libs` |
168 |
+ |
fi |
169 |
+ |
;; |
170 |
+ |
esac |
171 |
+ |
CFLAGS="$CFLAGS $sdl_cflags" |
172 |
+ |
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
173 |
+ |
LIBS="$LIBS $sdl_libs" |
174 |
+ |
else |
175 |
+ |
WANT_SDL=no |
176 |
+ |
fi |
177 |
+ |
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"` |
178 |
+ |
else |
179 |
+ |
SDL_SUPPORT="none" |
180 |
+ |
fi |
181 |
|
|
182 |
< |
dnl We need X11. |
183 |
< |
AC_PATH_XTRA |
184 |
< |
if [[ "x$no_x" = "xyes" ]]; then |
185 |
< |
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
186 |
< |
fi |
187 |
< |
CFLAGS="$CFLAGS $X_CFLAGS" |
188 |
< |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
189 |
< |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
182 |
> |
dnl We need X11, if not using SDL. |
183 |
> |
if [[ "x$WANT_SDL" = "xno" ]]; then |
184 |
> |
AC_PATH_XTRA |
185 |
> |
if [[ "x$no_x" = "xyes" ]]; then |
186 |
> |
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
187 |
> |
fi |
188 |
> |
CFLAGS="$CFLAGS $X_CFLAGS" |
189 |
> |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
190 |
> |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
191 |
> |
fi |
192 |
|
|
193 |
|
dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. |
194 |
|
HAVE_PTHREADS=yes |
202 |
|
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then |
203 |
|
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) |
204 |
|
fi |
205 |
< |
AC_CHECK_FUNCS(pthread_cancel) |
205 |
> |
AC_CHECK_FUNCS(pthread_cond_init) |
206 |
> |
AC_CHECK_FUNCS(pthread_cancel pthread_testcancel) |
207 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
208 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
209 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setpshared) |
247 |
|
|
248 |
|
dnl We use GTK+ if possible. |
249 |
|
UISRCS=../dummy/prefs_editor_dummy.cpp |
250 |
< |
if [[ "x$WANT_GTK" = "xyes" ]]; then |
250 |
> |
case "x$WANT_GTK" in |
251 |
> |
xgtk2*) |
252 |
> |
AM_PATH_GTK_2_0(1.3.15, [ |
253 |
> |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
254 |
> |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
255 |
> |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
256 |
> |
LIBS="$LIBS $GTK_LIBS" |
257 |
> |
UISRCS=prefs_editor_gtk.cpp |
258 |
> |
WANT_GTK=gtk2 |
259 |
> |
], [ |
260 |
> |
case "x${WANT_GTK}x" in |
261 |
> |
*gtkx) |
262 |
> |
AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.]) |
263 |
> |
WANT_GTK=gtk |
264 |
> |
;; |
265 |
> |
*) |
266 |
> |
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
267 |
> |
WANT_GTK=no |
268 |
> |
;; |
269 |
> |
esac |
270 |
> |
]) |
271 |
> |
;; |
272 |
> |
esac |
273 |
> |
if [[ "x$WANT_GTK" = "xgtk" ]]; then |
274 |
|
AM_PATH_GTK(1.2.0, [ |
275 |
|
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
276 |
|
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
277 |
|
LIBS="$LIBS $GTK_LIBS" |
278 |
|
UISRCS=prefs_editor_gtk.cpp |
279 |
+ |
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
280 |
+ |
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
281 |
+ |
dnl includes <libintl.h> |
282 |
+ |
AM_GNU_GETTEXT |
283 |
|
B2_PATH_GNOMEUI([ |
284 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
285 |
|
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
309 |
|
|
310 |
|
dnl Checks for header files. |
311 |
|
AC_HEADER_STDC |
312 |
< |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h) |
312 |
> |
AC_CHECK_HEADERS(stdlib.h stdint.h) |
313 |
> |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h) |
314 |
> |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
315 |
> |
AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h) |
316 |
> |
AC_CHECK_HEADERS(sys/poll.h sys/select.h) |
317 |
> |
AC_CHECK_HEADERS(arpa/inet.h) |
318 |
> |
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [ |
319 |
> |
#ifdef HAVE_SYS_TYPES_H |
320 |
> |
#include <sys/types.h> |
321 |
> |
#endif |
322 |
> |
#ifdef HAVE_SYS_SOCKET_H |
323 |
> |
#include <sys/socket.h> |
324 |
> |
#endif |
325 |
> |
]) |
326 |
> |
AC_CHECK_HEADERS(AvailabilityMacros.h) |
327 |
> |
AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h) |
328 |
|
|
329 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
330 |
|
AC_C_BIGENDIAN |
339 |
|
AC_CHECK_SIZEOF(long double, 12) |
340 |
|
AC_CHECK_SIZEOF(void *, 4) |
341 |
|
AC_TYPE_OFF_T |
342 |
< |
AC_CHECK_TYPE(loff_t, off_t) |
343 |
< |
AC_CHECK_TYPE(caddr_t, [char *]) |
342 |
> |
AC_CHECK_TYPES(loff_t) |
343 |
> |
AC_CHECK_TYPES(caddr_t) |
344 |
|
AC_TYPE_SIZE_T |
345 |
|
AC_TYPE_SIGNAL |
346 |
|
AC_HEADER_TIME |
364 |
|
fi |
365 |
|
|
366 |
|
dnl Checks for library functions. |
367 |
< |
AC_CHECK_FUNCS(strdup cfmakeraw) |
367 |
> |
AC_CHECK_FUNCS(strdup strerror cfmakeraw) |
368 |
|
AC_CHECK_FUNCS(clock_gettime timer_create) |
369 |
|
AC_CHECK_FUNCS(sigaction signal) |
370 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
371 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
372 |
+ |
AC_CHECK_FUNCS(poll inet_aton) |
373 |
|
|
374 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
375 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
396 |
|
*-*-sco3.2v5*) |
397 |
|
no_dev_ptmx=1 |
398 |
|
;; |
399 |
+ |
*-*-cygwin*) |
400 |
+ |
no_dev_ptmx=1 |
401 |
+ |
;; |
402 |
|
esac |
403 |
|
|
404 |
|
if test -z "$no_dev_ptmx" ; then |
421 |
|
dnl (end of code from openssh-3.2.2p1 configure.ac) |
422 |
|
|
423 |
|
|
424 |
+ |
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES) |
425 |
+ |
AC_DEFUN([AC_CHECK_FRAMEWORK], [ |
426 |
+ |
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl |
427 |
+ |
AC_CACHE_CHECK([whether compiler supports framework $1], |
428 |
+ |
ac_Framework, [ |
429 |
+ |
saved_LIBS="$LIBS" |
430 |
+ |
LIBS="$LIBS -framework $1" |
431 |
+ |
AC_TRY_LINK( |
432 |
+ |
[$2], [int main(void) { return 0; }], |
433 |
+ |
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"] |
434 |
+ |
) |
435 |
+ |
]) |
436 |
+ |
AS_IF([test AS_VAR_GET(ac_Framework) = yes], |
437 |
+ |
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])] |
438 |
+ |
) |
439 |
+ |
AS_VAR_POPDEF([ac_Framework])dnl |
440 |
+ |
]) |
441 |
+ |
|
442 |
+ |
dnl Check for some MacOS X frameworks |
443 |
+ |
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
444 |
+ |
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
445 |
+ |
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>]) |
446 |
+ |
|
447 |
|
dnl Select system-dependant source files. |
448 |
|
SERIALSRC=serial_unix.cpp |
449 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
450 |
|
SCSISRC=../dummy/scsi_dummy.cpp |
451 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
452 |
+ |
EXTFSSRC=extfs_unix.cpp |
453 |
|
EXTRASYSSRCS= |
454 |
|
CAN_NATIVE_M68K=no |
455 |
|
case "$target_os" in |
483 |
|
;; |
484 |
|
netbsd*) |
485 |
|
CAN_NATIVE_M68K=yes |
486 |
+ |
ETHERSRC=ether_unix.cpp |
487 |
|
;; |
488 |
|
solaris*) |
489 |
|
AUDIOSRC=Solaris/audio_solaris.cpp |
493 |
|
ETHERSRC=ether_unix.cpp |
494 |
|
AUDIOSRC=Irix/audio_irix.cpp |
495 |
|
EXTRASYSSRCS=Irix/unaligned.c |
358 |
– |
dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS" |
359 |
– |
DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS" |
496 |
|
LIBS="$LIBS -laudio" |
497 |
|
WANT_ESD=no |
498 |
|
|
499 |
< |
dnl Check if our compiler supports -Ofast (MIPSPro) |
500 |
< |
HAVE_OFAST=no |
499 |
> |
dnl Check if our compiler supports -IPA (MIPSPro) |
500 |
> |
HAVE_IPA=no |
501 |
|
ocflags="$CFLAGS" |
502 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'` |
503 |
< |
AC_MSG_CHECKING(if "-Ofast" works) |
502 |
> |
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
503 |
> |
AC_MSG_CHECKING(if "-IPA" works) |
504 |
|
dnl Do a test compile of an empty function |
505 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no)) |
505 |
> |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
506 |
|
CFLAGS="$ocflags" |
507 |
< |
|
507 |
> |
;; |
508 |
> |
darwin*) |
509 |
> |
ETHERSRC=ether_unix.cpp |
510 |
> |
if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then |
511 |
> |
EXTRASYSSRCS="../MacOSX/sys_darwin.cpp" |
512 |
> |
fi |
513 |
> |
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
514 |
> |
EXTFSSRC=../MacOSX/extfs_macosx.mm |
515 |
> |
fi |
516 |
> |
;; |
517 |
> |
cygwin*) |
518 |
> |
SERIALSRC="../dummy/serial_dummy.cpp" |
519 |
> |
EXTRASYSSRCS="../Windows/BasiliskII.rc" |
520 |
|
;; |
521 |
|
esac |
522 |
|
|
523 |
+ |
dnl Is the slirp library supported? |
524 |
+ |
if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then |
525 |
+ |
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported]) |
526 |
+ |
SLIRP_SRCS="\ |
527 |
+ |
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ |
528 |
+ |
../slirp/cksum.c ../slirp/mbuf.c ../slirp/tcp_output.c \ |
529 |
+ |
../slirp/debug.c ../slirp/misc.c ../slirp/tcp_subr.c \ |
530 |
+ |
../slirp/if.c ../slirp/sbuf.c ../slirp/tcp_timer.c \ |
531 |
+ |
../slirp/ip_icmp.c ../slirp/slirp.c ../slirp/tftp.c \ |
532 |
+ |
../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c" |
533 |
+ |
fi |
534 |
+ |
AC_SUBST(SLIRP_SRCS) |
535 |
+ |
|
536 |
+ |
dnl SDL overrides |
537 |
+ |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
538 |
+ |
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) |
539 |
+ |
fi |
540 |
+ |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
541 |
+ |
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support]) |
542 |
+ |
VIDEOSRCS="../SDL/video_sdl.cpp" |
543 |
+ |
KEYCODES="../SDL/keycodes" |
544 |
+ |
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
545 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" |
546 |
+ |
else |
547 |
+ |
case "$target_os" in |
548 |
+ |
cygwin*) |
549 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp" |
550 |
+ |
;; |
551 |
+ |
*) |
552 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
553 |
+ |
;; |
554 |
+ |
esac |
555 |
+ |
fi |
556 |
+ |
else |
557 |
+ |
VIDEOSRCS="video_x.cpp" |
558 |
+ |
KEYCODES="keycodes" |
559 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp" |
560 |
+ |
fi |
561 |
+ |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
562 |
+ |
AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support]) |
563 |
+ |
AUDIOSRC="../SDL/audio_sdl.cpp" |
564 |
+ |
fi |
565 |
+ |
|
566 |
|
dnl Use 68k CPU natively? |
567 |
|
WANT_NATIVE_M68K=no |
568 |
|
if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then |
577 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
578 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
579 |
|
fi |
580 |
< |
SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
580 |
> |
SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
581 |
|
|
582 |
|
dnl Define a macro that translates a yesno-variable into a C macro definition |
583 |
|
dnl to be put into the config.h file |
584 |
|
dnl $1 -- the macro to define |
585 |
|
dnl $2 -- the value to translate |
586 |
|
dnl $3 -- template name |
587 |
< |
AC_DEFUN(AC_TRANSLATE_DEFINE, [ |
587 |
> |
AC_DEFUN([AC_TRANSLATE_DEFINE], [ |
588 |
|
if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then |
589 |
|
AC_DEFINE($1, 1, $3) |
590 |
|
fi |
591 |
|
]) |
592 |
|
|
593 |
+ |
dnl Check that the host supports TUN/TAP devices |
594 |
+ |
AC_CACHE_CHECK([whether TUN/TAP is supported], |
595 |
+ |
ac_cv_tun_tap_support, [ |
596 |
+ |
AC_TRY_COMPILE([ |
597 |
+ |
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H) |
598 |
+ |
#include <linux/if.h> |
599 |
+ |
#include <linux/if_tun.h> |
600 |
+ |
#endif |
601 |
+ |
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H) |
602 |
+ |
#include <net/if.h> |
603 |
+ |
#include <net/if_tun.h> |
604 |
+ |
#endif |
605 |
+ |
], [ |
606 |
+ |
struct ifreq ifr; |
607 |
+ |
memset(&ifr, 0, sizeof(ifr)); |
608 |
+ |
ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
609 |
+ |
], |
610 |
+ |
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no |
611 |
+ |
) |
612 |
+ |
]) |
613 |
+ |
AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support", |
614 |
+ |
[Define if your system supports TUN/TAP devices.]) |
615 |
+ |
|
616 |
|
dnl Various checks if the system supports vm_allocate() and the like functions. |
617 |
|
have_mach_vm=no |
618 |
|
if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \ |
759 |
|
|
760 |
|
fi dnl HAVE_MMAP_VM |
761 |
|
|
762 |
+ |
dnl Check if we can modify the __PAGEZERO segment for use as Low Memory |
763 |
+ |
AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000], |
764 |
+ |
ac_cv_pagezero_hack, [ |
765 |
+ |
ac_cv_pagezero_hack=no |
766 |
+ |
if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then |
767 |
+ |
ac_cv_pagezero_hack=yes |
768 |
+ |
dnl might as well skip the test for mmap-able low memory |
769 |
+ |
ac_cv_can_map_lm=no |
770 |
+ |
fi |
771 |
+ |
]) |
772 |
+ |
AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack", |
773 |
+ |
[Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.]) |
774 |
+ |
|
775 |
|
dnl Check if we can mmap 0x2000 bytes from 0x0000 |
776 |
|
AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000], |
777 |
|
ac_cv_can_map_lm, [ |
780 |
|
AC_TRY_RUN([ |
781 |
|
#include "vm_alloc.cpp" |
782 |
|
int main(void) { /* returns 0 if we could map the lowmem globals */ |
783 |
< |
volatile char * lm; |
783 |
> |
volatile char * lm = 0; |
784 |
|
if (vm_init() < 0) exit(1); |
785 |
< |
if ((lm = (volatile char *)vm_acquire_fixed(0, 0x2000)) == VM_MAP_FAILED) exit(1); |
785 |
> |
if (vm_acquire_fixed(0, 0x2000) < 0) exit(1); |
786 |
|
lm[0] = 'z'; |
787 |
|
if (vm_release((char *)lm, 0x2000) < 0) exit(1); |
788 |
|
vm_exit(); exit(0); |
795 |
|
] |
796 |
|
) |
797 |
|
|
798 |
+ |
dnl Check if we have POSIX shared memory support |
799 |
+ |
AC_CACHE_CHECK([whether POSIX shared memory is working], |
800 |
+ |
ac_cv_have_posix_shm, [ |
801 |
+ |
AC_LANG_SAVE |
802 |
+ |
AC_LANG_CPLUSPLUS |
803 |
+ |
AC_TRY_RUN([ |
804 |
+ |
#define HAVE_POSIX_SHM |
805 |
+ |
#include "vm_alloc.cpp" |
806 |
+ |
int main(void) { /* returns 0 if we have working POSIX shm */ |
807 |
+ |
if (vm_init() < 0) exit(2); |
808 |
+ |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
809 |
+ |
if (m1 == VM_MAP_FAILED) exit(3); |
810 |
+ |
vm_exit(); exit(0); |
811 |
+ |
} |
812 |
+ |
], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no, |
813 |
+ |
dnl When cross-compiling, do not assume anything. |
814 |
+ |
ac_cv_have_posix_shm="guessing no" |
815 |
+ |
) |
816 |
+ |
AC_LANG_RESTORE |
817 |
+ |
] |
818 |
+ |
) |
819 |
+ |
AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm", |
820 |
+ |
[Define if your system supports POSIX shared memory.]) |
821 |
+ |
|
822 |
+ |
dnl Check if we have working 33-bit memory addressing |
823 |
+ |
AC_CACHE_CHECK([whether 33-bit memory addressing is working], |
824 |
+ |
ac_cv_have_33bit_addressing, [ |
825 |
+ |
AC_LANG_SAVE |
826 |
+ |
AC_LANG_CPLUSPLUS |
827 |
+ |
AC_TRY_RUN([ |
828 |
+ |
#define USE_33BIT_ADDRESSING 1 |
829 |
+ |
#include "vm_alloc.cpp" |
830 |
+ |
int main(void) { /* returns 0 if we have working 33-bit addressing */ |
831 |
+ |
if (sizeof(void *) < 8) exit(1); |
832 |
+ |
if (vm_init() < 0) exit(2); |
833 |
+ |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
834 |
+ |
if (m1 == VM_MAP_FAILED) exit(3); |
835 |
+ |
char *m2 = m1 + (1L << 32); |
836 |
+ |
m1[0] = 0x12; if (m2[0] != 0x12) exit(4); |
837 |
+ |
m2[0] = 0x34; if (m1[0] != 0x34) exit(5); |
838 |
+ |
vm_exit(); exit(0); |
839 |
+ |
} |
840 |
+ |
], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no, |
841 |
+ |
dnl When cross-compiling, do not assume anything. |
842 |
+ |
ac_cv_have_33bit_addressing="guessing no" |
843 |
+ |
) |
844 |
+ |
AC_LANG_RESTORE |
845 |
+ |
] |
846 |
+ |
) |
847 |
+ |
|
848 |
|
dnl Check signal handlers need to be reinstalled |
849 |
|
AC_CACHE_CHECK([whether signal handlers need to be reinstalled], |
850 |
|
ac_cv_signal_need_reinstall, [ |
906 |
|
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall", |
907 |
|
[Define if your system requires sigactions to be reinstalled.]) |
908 |
|
|
909 |
< |
dnl Check if extended signals are supported. |
910 |
< |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
911 |
< |
ac_cv_have_extended_signals, [ |
909 |
> |
dnl Check if Mach exceptions supported. |
910 |
> |
AC_CACHE_CHECK([whether your system supports Mach exceptions], |
911 |
> |
ac_cv_have_mach_exceptions, [ |
912 |
> |
AC_LANG_SAVE |
913 |
> |
AC_LANG_CPLUSPLUS |
914 |
> |
AC_TRY_RUN([ |
915 |
> |
#define HAVE_MACH_EXCEPTIONS 1 |
916 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
917 |
> |
#include "vm_alloc.cpp" |
918 |
> |
#include "sigsegv.cpp" |
919 |
> |
], [ |
920 |
> |
sigsegv_recovery=mach |
921 |
> |
ac_cv_have_mach_exceptions=yes |
922 |
> |
], |
923 |
> |
ac_cv_have_mach_exceptions=no, |
924 |
> |
dnl When cross-compiling, do not assume anything. |
925 |
> |
ac_cv_have_mach_exceptions=no |
926 |
> |
) |
927 |
> |
AC_LANG_RESTORE |
928 |
> |
] |
929 |
> |
) |
930 |
> |
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
931 |
> |
[Define if your system supports Mach exceptions.]) |
932 |
> |
|
933 |
> |
dnl Check if Windows exceptions are supported. |
934 |
> |
AC_CACHE_CHECK([whether your system supports Windows exceptions], |
935 |
> |
ac_cv_have_win32_exceptions, [ |
936 |
|
AC_LANG_SAVE |
937 |
|
AC_LANG_CPLUSPLUS |
938 |
|
AC_TRY_RUN([ |
939 |
< |
#define HAVE_SIGINFO_T 1 |
939 |
> |
#define HAVE_WIN32_EXCEPTIONS 1 |
940 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
941 |
|
#include "vm_alloc.cpp" |
942 |
|
#include "sigsegv.cpp" |
943 |
< |
], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no, |
943 |
> |
], [ |
944 |
> |
sigsegv_recovery=win32 |
945 |
> |
ac_cv_have_win32_exceptions=yes |
946 |
> |
], |
947 |
> |
ac_cv_have_win32_exceptions=no, |
948 |
|
dnl When cross-compiling, do not assume anything. |
949 |
< |
ac_cv_have_extended_signals=no |
949 |
> |
ac_cv_have_win32_exceptions=no |
950 |
|
) |
951 |
|
AC_LANG_RESTORE |
952 |
|
] |
953 |
|
) |
954 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
955 |
< |
[Define if your system support extended signals.]) |
954 |
> |
AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions", |
955 |
> |
[Define if your system supports Windows exceptions.]) |
956 |
> |
|
957 |
> |
dnl Otherwise, check if extended signals are supported. |
958 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
959 |
> |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
960 |
> |
ac_cv_have_extended_signals, [ |
961 |
> |
AC_LANG_SAVE |
962 |
> |
AC_LANG_CPLUSPLUS |
963 |
> |
AC_TRY_RUN([ |
964 |
> |
#define HAVE_SIGINFO_T 1 |
965 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
966 |
> |
#include "vm_alloc.cpp" |
967 |
> |
#include "sigsegv.cpp" |
968 |
> |
], [ |
969 |
> |
sigsegv_recovery=siginfo |
970 |
> |
ac_cv_have_extended_signals=yes |
971 |
> |
], |
972 |
> |
ac_cv_have_extended_signals=no, |
973 |
> |
dnl When cross-compiling, do not assume anything. |
974 |
> |
ac_cv_have_extended_signals=no |
975 |
> |
) |
976 |
> |
AC_LANG_RESTORE |
977 |
> |
] |
978 |
> |
) |
979 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
980 |
> |
[Define if your system support extended signals.]) |
981 |
> |
fi |
982 |
|
|
983 |
|
dnl Otherwise, check for subterfuges. |
984 |
< |
if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then |
984 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
985 |
|
AC_CACHE_CHECK([whether we then have a subterfuge for your system], |
986 |
|
ac_cv_have_sigcontext_hack, [ |
987 |
|
AC_LANG_SAVE |
991 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
992 |
|
#include "vm_alloc.cpp" |
993 |
|
#include "sigsegv.cpp" |
994 |
< |
], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no, |
994 |
> |
], [ |
995 |
> |
sigsegv_recovery=sigcontext |
996 |
> |
ac_cv_have_sigcontext_hack=yes |
997 |
> |
], |
998 |
> |
ac_cv_have_sigcontext_hack=no, |
999 |
|
dnl When cross-compiling, do not assume anything. |
1000 |
|
ac_cv_have_sigcontext_hack=no |
1001 |
|
) |
1027 |
|
|
1028 |
|
dnl Can we do Video on SEGV Signals ? |
1029 |
|
CAN_VOSF=no |
1030 |
< |
if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
1030 |
> |
if [[ -n "$sigsegv_recovery" ]]; then |
1031 |
|
CAN_VOSF=yes |
1032 |
|
fi |
1033 |
|
|
1034 |
+ |
dnl A dummy program that returns always true |
1035 |
+ |
AC_PATH_PROG([BLESS], "true") |
1036 |
+ |
|
1037 |
|
dnl Determine the addressing mode to use |
1038 |
|
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
1039 |
|
ADDRESSING_MODE="real" |
1044 |
|
case $am in |
1045 |
|
real) |
1046 |
|
dnl Requires ability to mmap() Low Memory globals |
1047 |
< |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
1047 |
> |
if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then |
1048 |
|
continue |
1049 |
|
fi |
1050 |
< |
dnl Requires VOSF screen updates |
1050 |
> |
dnl Requires VOSF screen updates |
1051 |
|
if [[ "x$CAN_VOSF" = "xno" ]]; then |
1052 |
|
continue |
1053 |
|
fi |
1055 |
|
ADDRESSING_MODE="real" |
1056 |
|
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
1057 |
|
DEFINES="$DEFINES -DREAL_ADDRESSING" |
1058 |
+ |
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
1059 |
+ |
BLESS=Darwin/lowmem |
1060 |
+ |
LDFLAGS="$LDFLAGS -pagezero_size 0x2000" |
1061 |
+ |
fi |
1062 |
|
break |
1063 |
|
;; |
1064 |
|
direct) |
1111 |
|
dnl Check for GCC 2.7 or higher. |
1112 |
|
HAVE_GCC27=no |
1113 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
1114 |
< |
AC_EGREP_CPP(yes, |
1115 |
< |
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
1116 |
< |
yes |
1117 |
< |
#endif |
1118 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
1114 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5) |
1115 |
> |
# error gcc < 2.7 |
1116 |
> |
#endif |
1117 |
> |
]])], |
1118 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC27=yes], |
1119 |
> |
[AC_MSG_RESULT(no)]) |
1120 |
|
|
1121 |
|
dnl Check for GCC 3.0 or higher. |
1122 |
|
HAVE_GCC30=no |
1123 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
1124 |
< |
AC_EGREP_CPP(yes, |
1125 |
< |
[#if __GNUC__ >= 3 |
1126 |
< |
yes |
1127 |
< |
#endif |
1128 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1124 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3) |
1125 |
> |
# error gcc < 3 |
1126 |
> |
#endif |
1127 |
> |
]])], |
1128 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC30=yes], |
1129 |
> |
[AC_MSG_RESULT(no)]) |
1130 |
> |
|
1131 |
> |
dnl Check for ICC. |
1132 |
> |
AC_MSG_CHECKING(for ICC) |
1133 |
> |
HAVE_ICC=no |
1134 |
> |
if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then |
1135 |
> |
HAVE_ICC=yes |
1136 |
> |
fi |
1137 |
> |
AC_MSG_RESULT($HAVE_ICC) |
1138 |
|
|
1139 |
|
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher. |
1140 |
|
dnl Also set "-fno-exceptions" for C++ because exception handling requires |
1149 |
|
dnl Official: probably gcc-3.1 (mainline CVS) |
1150 |
|
dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk |
1151 |
|
dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1 |
1152 |
< |
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1152 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1153 |
|
SAVED_CXXFLAGS="$CXXFLAGS" |
1154 |
|
CXXFLAGS="$CXXFLAGS -fno-merge-constants" |
1155 |
|
AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [ |
1163 |
|
fi |
1164 |
|
fi |
1165 |
|
|
1166 |
+ |
dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4 |
1167 |
+ |
dnl However, there are some corner cases exposed on x86-64 |
1168 |
+ |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1169 |
+ |
SAVED_CXXFLAGS="$CXXFLAGS" |
1170 |
+ |
CXXFLAGS="$CXXFLAGS -fno-gcse-sm" |
1171 |
+ |
AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [ |
1172 |
+ |
AC_LANG_SAVE |
1173 |
+ |
AC_LANG_CPLUSPLUS |
1174 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no]) |
1175 |
+ |
AC_LANG_RESTORE |
1176 |
+ |
]) |
1177 |
+ |
if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then |
1178 |
+ |
CXXFLAGS="$SAVED_CXXFLAGS" |
1179 |
+ |
fi |
1180 |
+ |
fi |
1181 |
+ |
|
1182 |
+ |
dnl Add -fno-strict-aliasing for slirp sources |
1183 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1184 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1185 |
+ |
CFLAGS="$CFLAGS -fno-strict-aliasing" |
1186 |
+ |
AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing], |
1187 |
+ |
ac_cv_gcc_no_strict_aliasing, [ |
1188 |
+ |
AC_TRY_COMPILE([],[], |
1189 |
+ |
[ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")], |
1190 |
+ |
[ac_cv_gcc_no_strict_aliasing=no]) |
1191 |
+ |
]) |
1192 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1193 |
+ |
fi |
1194 |
+ |
|
1195 |
+ |
dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X) |
1196 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1197 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1198 |
+ |
CFLAGS="$CFLAGS -mdynamic-no-pic" |
1199 |
+ |
AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic], |
1200 |
+ |
ac_cv_gcc_mdynamic_no_pic, [ |
1201 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no]) |
1202 |
+ |
]) |
1203 |
+ |
if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then |
1204 |
+ |
CXXFLAGS="$CXXFLAGS -mdynamic-no-pic" |
1205 |
+ |
else |
1206 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1207 |
+ |
fi |
1208 |
+ |
fi |
1209 |
+ |
|
1210 |
|
dnl Select appropriate CPU source and REGPARAM define. |
1211 |
|
ASM_OPTIMIZATIONS=none |
1212 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
1216 |
|
CAN_JIT=no |
1217 |
|
JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp" |
1218 |
|
|
1219 |
< |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then |
1219 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
1220 |
|
dnl i386 CPU |
1221 |
< |
DEFINES="$DEFINES -DSAHF_SETO_PROFITABLE -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\"" |
1221 |
> |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\"" |
1222 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
1223 |
|
ASM_OPTIMIZATIONS=i386 |
1224 |
< |
DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS" |
1225 |
< |
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
1226 |
< |
JITSRCS="cpufast1_nf.s cpufast2_nf.s cpufast3_nf.s cpufast4_nf.s cpufast5_nf.s cpufast6_nf.s cpufast7_nf.s cpufast8_nf.s $JITSRCS" |
1224 |
> |
DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE" |
1225 |
> |
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" |
1226 |
> |
CAN_JIT=yes |
1227 |
> |
fi |
1228 |
> |
elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then |
1229 |
> |
dnl x86-64 CPU |
1230 |
> |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE" |
1231 |
> |
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
1232 |
> |
ASM_OPTIMIZATIONS="x86-64" |
1233 |
> |
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
1234 |
> |
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" |
1235 |
> |
CAN_JIT=yes |
1236 |
> |
WANT_33BIT_ADDRESSING=yes |
1237 |
|
fi |
832 |
– |
CAN_JIT=yes |
1238 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
1239 |
|
dnl SPARC CPU |
1240 |
|
case "$target_os" in |
1277 |
|
WANT_JIT_DEBUG=no |
1278 |
|
fi |
1279 |
|
fi |
1280 |
+ |
|
1281 |
+ |
dnl IEEE core is the only FPU emulator to use with the JIT compiler |
1282 |
+ |
case $FPE_CORE_TEST_ORDER in |
1283 |
+ |
ieee*) ;; |
1284 |
+ |
*) AC_MSG_WARN([Forcing use of the IEEE FPU core, as the JIT compiler supports only this one.]) ;; |
1285 |
+ |
esac |
1286 |
+ |
FPE_CORE_TEST_ORDER="ieee" |
1287 |
|
else |
1288 |
|
WANT_JIT=no |
1289 |
|
WANT_JIT_DEBUG=no |
1290 |
|
JITSRCS="" |
1291 |
|
fi |
1292 |
|
|
1293 |
+ |
dnl Use 33-bit memory addressing? |
1294 |
+ |
if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then |
1295 |
+ |
use_33bit_addressing=yes |
1296 |
+ |
fi |
1297 |
+ |
AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing", |
1298 |
+ |
[Define to use 33-bit memory addressing on 64-bit JIT capable systems.]) |
1299 |
+ |
|
1300 |
|
dnl Utility macro used by next two tests. |
1301 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
1302 |
|
dnl commands examining object file, |
1494 |
|
|
1495 |
|
dnl Remove the "-g" option if set for GCC. |
1496 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1497 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'` |
1498 |
< |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1497 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'` |
1498 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'` |
1499 |
|
fi |
1500 |
|
|
1501 |
< |
dnl Or if we have -Ofast |
1502 |
< |
if [[ "x$HAVE_OFAST" = "xyes" ]]; then |
1503 |
< |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast" |
1504 |
< |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast" |
1501 |
> |
dnl Or if we have -IPA (MIPSPro compilers) |
1502 |
> |
if [[ "x$HAVE_IPA" = "xyes" ]]; then |
1503 |
> |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1504 |
> |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1505 |
|
CXXFLAGS="-LANG:std $CXXFLAGS" |
1506 |
< |
LDFLAGS="$LDFLAGS -ipa" |
1506 |
> |
LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA" |
1507 |
|
fi |
1508 |
|
|
1509 |
|
dnl Generate Makefile. |
1511 |
|
AC_SUBST(SYSSRCS) |
1512 |
|
AC_SUBST(CPUINCLUDES) |
1513 |
|
AC_SUBST(CPUSRCS) |
1514 |
< |
AC_OUTPUT(Makefile) |
1514 |
> |
AC_SUBST(BLESS) |
1515 |
> |
AC_SUBST(KEYCODES) |
1516 |
> |
AC_CONFIG_FILES([Makefile]) |
1517 |
> |
AC_OUTPUT |
1518 |
|
|
1519 |
|
dnl Print summary. |
1520 |
|
echo |
1521 |
|
echo Basilisk II configuration summary: |
1522 |
|
echo |
1523 |
+ |
echo SDL support ............................ : $SDL_SUPPORT |
1524 |
|
echo XFree86 DGA support .................... : $WANT_XF86_DGA |
1525 |
|
echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE |
1526 |
|
echo fbdev DGA support ...................... : $WANT_FBDEV_DGA |
1534 |
|
echo Floating-Point emulation core .......... : $FPE_CORE |
1535 |
|
echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS |
1536 |
|
echo Addressing mode ........................ : $ADDRESSING_MODE |
1537 |
+ |
echo Bad memory access recovery type ........ : $sigsegv_recovery |
1538 |
|
echo |
1539 |
|
echo "Configuration done. Now type \"make\" (or \"gmake\")." |