ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/configure.ac
Revision: 1.41
Committed: 2005-05-13T17:32:13Z (19 years, 6 months ago) by gbeauche
Branch: MAIN
Changes since 1.40: +11 -2 lines
Log Message:
Fix build on MacOS X: dedicated extfs_macosx.mm & static SDL libs

File Contents

# User Rev Content
1 gbeauche 1.1 dnl Process this file with autoconf to produce a configure script.
2     dnl Written in 2002 by Christian Bauer et al.
3    
4 cebix 1.16 AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII)
5     AC_CONFIG_SRCDIR(main_unix.cpp)
6 gbeauche 1.1 AC_PREREQ(2.52)
7     AC_CONFIG_HEADER(config.h)
8    
9 gbeauche 1.19 dnl Aliases for PACKAGE and VERSION macros.
10 gbeauche 1.22 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.])
11     AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.])
12 gbeauche 1.19
13 gbeauche 1.21 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 gbeauche 1.5 dnl Video options.
18 gbeauche 1.1 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 gbeauche 1.26 dnl SDL options.
24 gbeauche 1.41 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 gbeauche 1.26 AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
26 gbeauche 1.31 AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
27 gbeauche 1.26
28 gbeauche 1.5 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])
31    
32 gbeauche 1.1 dnl FPU emulation core.
33     AC_ARG_ENABLE(fpe,
34     [ --enable-fpe=FPE specify which fpu emulator to use [default=auto]],
35     [ case "$enableval" in
36     dnl default is always ieee, if architecture has this fp format
37     auto) FPE_CORE_TEST_ORDER="ieee uae";;
38     ieee) FPE_CORE_TEST_ORDER="ieee";;
39     uae) FPE_CORE_TEST_ORDER="uae";;
40     x86) FPE_CORE_TEST_ORDER="x86";;
41     *) AC_MSG_ERROR([--enable-fpe takes only one of the following values: auto, x86, ieee, uae]);;
42     esac
43     ],
44     [ FPE_CORE_TEST_ORDER="ieee uae"
45     ])
46    
47     dnl Addressing modes.
48     AC_ARG_ENABLE(addressing,
49     [ --enable-addressing=AM specify the addressing mode to use [default=fastest]],
50     [ case "$enableval" in
51     real) ADDRESSING_TEST_ORDER="real";;
52     direct) ADDRESSING_TEST_ORDER="direct";;
53     banks) ADDRESSING_TEST_ORDER="banks";;
54     fastest)ADDRESSING_TEST_ORDER="direct banks";;
55     *) AC_MSG_ERROR([--enable-addressing takes only one of the following values: fastest, real, direct, banks]);;
56     esac
57     ],
58     [ ADDRESSING_TEST_ORDER="direct banks"
59     ])
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])
64     AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
65    
66     dnl Canonical system information.
67     AC_CANONICAL_HOST
68     AC_CANONICAL_TARGET
69    
70     dnl Target OS type (target is host if not cross-compiling).
71     case "$target_os" in
72     linux*) OS_TYPE=linux;;
73     netbsd*) OS_TYPE=netbsd;;
74     freebsd*) OS_TYPE=freebsd;;
75     solaris*) OS_TYPE=solaris;;
76     darwin*) OS_TYPE=darwin;;
77     *) OS_TYPE=`echo $target_os | sed -e 's/-/_/g' | sed -e 's/\./_/g'`;;
78     esac
79     DEFINES="$DEFINES -DOS_$OS_TYPE"
80    
81     dnl Target CPU type.
82     HAVE_I386=no
83     HAVE_M68K=no
84     HAVE_SPARC=no
85     HAVE_POWERPC=no
86 gbeauche 1.13 HAVE_X86_64=no
87 gbeauche 1.1 case "$target_cpu" in
88 gbeauche 1.12 i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;;
89     m68k* ) HAVE_M68K=yes;;
90     sparc* ) HAVE_SPARC=yes;;
91     powerpc* ) HAVE_POWERPC=yes;;
92 gbeauche 1.13 x86_64* ) HAVE_X86_64=yes;;
93 gbeauche 1.1 esac
94    
95     dnl Checks for programs.
96     AC_PROG_CC
97     AC_PROG_CC_C_O
98     AC_PROG_CPP
99     AC_PROG_CXX
100     AC_PROG_MAKE_SET
101     AC_PROG_INSTALL
102 gbeauche 1.36 AC_PROG_EGREP
103 gbeauche 1.1
104     dnl We use mon if possible.
105     MONSRCS=
106     if [[ "x$WANT_MON" = "xyes" ]]; then
107     AC_MSG_CHECKING(for mon)
108     mon_srcdir=../../../mon/src
109     if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
110     AC_MSG_RESULT(yes)
111     AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
112     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"
113     CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
114     AC_CHECK_LIB(ncurses, tgetent, ,
115     AC_CHECK_LIB(termcap, tgetent, ,
116     AC_CHECK_LIB(termlib, tgetent, ,
117     AC_CHECK_LIB(terminfo, tgetent, ,
118     AC_CHECK_LIB(Hcurses, tgetent, ,
119     AC_CHECK_LIB(curses, tgetent))))))
120     AC_CHECK_LIB(readline, readline)
121     else
122     AC_MSG_RESULT(no)
123     AC_MSG_WARN([Could not find mon, ignoring --with-mon.])
124     WANT_MON=no
125     fi
126     fi
127    
128     dnl Checks for libraries.
129     AC_CHECK_LIB(posix4, sem_init)
130     AC_CHECK_LIB(rt, timer_create)
131 gbeauche 1.34 AC_CHECK_LIB(rt, shm_open)
132 gbeauche 1.1
133 gbeauche 1.26 dnl Do we need SDL?
134     WANT_SDL=no
135     if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
136     WANT_SDL=yes
137     WANT_XF86_DGA=no
138     WANT_XF86_VIDMODE=no
139     WANT_FBDEV_DGA=no
140 gbeauche 1.31 SDL_SUPPORT="$SDL_SUPPORT video"
141     fi
142     if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
143     WANT_SDL=yes
144     SDL_SUPPORT="$SDL_SUPPORT audio"
145 gbeauche 1.26 fi
146     if [[ "x$WANT_SDL" = "xyes" ]]; then
147     AC_PATH_PROG(sdl_config, "sdl-config")
148     if [[ -n "$sdl_config" ]]; then
149 gbeauche 1.36 case $target_os in
150     # Special treatment for Cygwin so that we can still use the POSIX layer
151     *cygwin*)
152     sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
153     sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
154     ;;
155     *)
156     sdl_cflags=`$sdl_config --cflags`
157 gbeauche 1.41 if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
158     sdl_libs=`$sdl_config --static-libs`
159     else
160     sdl_libs=`$sdl_config --libs`
161     fi
162 gbeauche 1.36 ;;
163     esac
164 gbeauche 1.26 CFLAGS="$CFLAGS $sdl_cflags"
165     CXXFLAGS="$CXXFLAGS $sdl_cflags"
166     LIBS="$LIBS $sdl_libs"
167     else
168     WANT_SDL=no
169     fi
170 gbeauche 1.31 SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
171     else
172     SDL_SUPPORT="none"
173 gbeauche 1.26 fi
174    
175     dnl We need X11, if not using SDL.
176     if [[ "x$WANT_SDL" = "xno" ]]; then
177     AC_PATH_XTRA
178     if [[ "x$no_x" = "xyes" ]]; then
179     AC_MSG_ERROR([You need X11 to run Basilisk II.])
180     fi
181     CFLAGS="$CFLAGS $X_CFLAGS"
182     CXXFLAGS="$CXXFLAGS $X_CFLAGS"
183     LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
184     fi
185 gbeauche 1.1
186     dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
187     HAVE_PTHREADS=yes
188     AC_CHECK_LIB(pthread, pthread_create, , [
189     AC_CHECK_LIB(c_r, pthread_create, , [
190     AC_CHECK_LIB(PTL, pthread_create, , [
191     HAVE_PTHREADS=no
192     ])
193     ])
194     ])
195     if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
196     AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
197     fi
198     AC_CHECK_FUNCS(pthread_cancel)
199     AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
200     AC_CHECK_FUNCS(pthread_mutexattr_settype)
201 gbeauche 1.3 AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
202 gbeauche 1.1
203     dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
204     SEMSRC=
205     AC_CHECK_FUNCS(sem_init, , [
206     if test "x$HAVE_PTHREADS" = "xyes"; then
207     SEMSRC=posix_sem.cpp
208     fi
209     ])
210    
211     dnl We use DGA (XFree86 or fbdev) if possible.
212     if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
213     AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [
214     AC_DEFINE(ENABLE_XF86_DGA, 1, [Define if using XFree86 DGA extension.])
215     LIBS="$LIBS -lXxf86dga"
216     if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
217     AC_MSG_WARN([Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga.])
218     WANT_FBDEV_DGA=no
219     fi
220     ], [
221     AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.])
222     WANT_XF86_DGA=no
223     ])
224     fi
225     if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
226     AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using DGA with framebuffer device.])
227     fi
228    
229     dnl We use XFree86 VidMode if possible.
230     if [[ "x$WANT_XF86_VIDMODE" = "xyes" ]]; then
231     AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, [
232     AC_DEFINE(ENABLE_XF86_VIDMODE, 1, [Define if using XFree86 DGA extension.])
233     LIBS="$LIBS -lXxf86vm"
234     ], [
235     AC_MSG_WARN([Could not find XFree86 VidMode extension, ignoring --enable-xf86-vidmode.])
236     WANT_XF86_VIDMODE=no
237     ])
238     fi
239    
240     dnl We use GTK+ if possible.
241     UISRCS=../dummy/prefs_editor_dummy.cpp
242     if [[ "x$WANT_GTK" = "xyes" ]]; then
243     AM_PATH_GTK(1.2.0, [
244     AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
245     CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
246     LIBS="$LIBS $GTK_LIBS"
247     UISRCS=prefs_editor_gtk.cpp
248 gbeauche 1.18 dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if
249     dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which
250     dnl includes <libintl.h>
251     AM_GNU_GETTEXT
252 gbeauche 1.1 B2_PATH_GNOMEUI([
253     AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.])
254     CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
255     LIBS="$LIBS $GNOMEUI_LIBS"
256     ], [])
257     ], [
258     AC_MSG_WARN([Could not find GTK+, disabling user interface.])
259     WANT_GTK=no
260     ])
261     fi
262    
263     dnl We use ESD if possible.
264     if [[ "x$WANT_ESD" = "xyes" ]]; then
265     AM_PATH_ESD(0.2.8, [
266     AC_DEFINE(ENABLE_ESD, 1, [Define is using ESD.])
267     CFLAGS="$CFLAGS $ESD_CFLAGS"
268     CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
269     LIBS="$LIBS $ESD_LIBS"
270     ], [
271     AC_MSG_WARN([Could not find ESD, disabling ESD support.])
272     WANT_ESD=no
273     ])
274     fi
275    
276     dnl We use 64-bit file size support if possible.
277     AC_SYS_LARGEFILE
278    
279     dnl Checks for header files.
280     AC_HEADER_STDC
281 gbeauche 1.24 AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
282 gbeauche 1.20 AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
283 gbeauche 1.39 AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h sys/select.h)
284     AC_CHECK_HEADERS(arpa/inet.h)
285 gbeauche 1.35 AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
286     #ifdef HAVE_SYS_SOCKET_H
287     #include <sys/socket.h>
288     #endif
289     ])
290 gbeauche 1.30 AC_CHECK_HEADERS(AvailabilityMacros.h)
291 gbeauche 1.1
292     dnl Checks for typedefs, structures, and compiler characteristics.
293     AC_C_BIGENDIAN
294     AC_C_CONST
295     AC_C_INLINE
296     AC_CHECK_SIZEOF(short, 2)
297     AC_CHECK_SIZEOF(int, 4)
298     AC_CHECK_SIZEOF(long, 4)
299     AC_CHECK_SIZEOF(long long, 8)
300     AC_CHECK_SIZEOF(float, 4)
301     AC_CHECK_SIZEOF(double, 8)
302     AC_CHECK_SIZEOF(long double, 12)
303     AC_CHECK_SIZEOF(void *, 4)
304     AC_TYPE_OFF_T
305 gbeauche 1.24 AC_CHECK_TYPES(loff_t)
306     AC_CHECK_TYPES(caddr_t)
307 gbeauche 1.1 AC_TYPE_SIZE_T
308     AC_TYPE_SIGNAL
309     AC_HEADER_TIME
310     AC_STRUCT_TM
311    
312     dnl Check whether sys/socket.h defines type socklen_t.
313     dnl (extracted from ac-archive/Miscellaneous)
314     AC_CACHE_CHECK([for socklen_t],
315     ac_cv_type_socklen_t, [
316     AC_TRY_COMPILE([
317     #include <sys/types.h>
318     #include <sys/socket.h>
319     ], [socklen_t len = 42; return 0;],
320     ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
321     dnl When cross-compiling, do not assume anything.
322     ac_cv_type_socklen_t="guessing no"
323     )
324     ])
325     if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
326     AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
327     fi
328    
329     dnl Checks for library functions.
330 gbeauche 1.39 AC_CHECK_FUNCS(strdup strerror cfmakeraw)
331 gbeauche 1.1 AC_CHECK_FUNCS(clock_gettime timer_create)
332     AC_CHECK_FUNCS(sigaction signal)
333     AC_CHECK_FUNCS(mmap mprotect munmap)
334     AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
335 gbeauche 1.39 AC_CHECK_FUNCS(inet_aton)
336 gbeauche 1.1
337     dnl Darwin seems to define mach_task_self() instead of task_self().
338     AC_CHECK_FUNCS(mach_task_self task_self)
339    
340     dnl Check for headers and functions related to pty support (sshpty.c)
341     dnl From openssh-3.2.2p1 configure.ac
342    
343     AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
344     AC_CHECK_FUNCS(_getpty vhangup strlcpy)
345    
346     case "$host" in
347     *-*-hpux10.26)
348     disable_ptmx_check=yes
349     ;;
350     *-*-linux*)
351     no_dev_ptmx=1
352     ;;
353     mips-sony-bsd|mips-sony-newsos4)
354     AC_DEFINE(HAVE_NEWS4, 1, [Define if you are on NEWS-OS (additions from openssh-3.2.2p1, for sshpty.c).])
355     ;;
356     *-*-sco3.2v4*)
357     no_dev_ptmx=1
358     ;;
359     *-*-sco3.2v5*)
360     no_dev_ptmx=1
361     ;;
362 gbeauche 1.36 *-*-cygwin*)
363     no_dev_ptmx=1
364     ;;
365 gbeauche 1.1 esac
366    
367     if test -z "$no_dev_ptmx" ; then
368     if test "x$disable_ptmx_check" != "xyes" ; then
369     AC_CHECK_FILE([/dev/ptmx],
370     [
371     AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx.])
372     have_dev_ptmx=1
373     ]
374     )
375     fi
376     fi
377     AC_CHECK_FILE([/dev/ptc],
378     [
379     AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, [Define if you have /dev/ptc.])
380     have_dev_ptc=1
381     ]
382     )
383    
384     dnl (end of code from openssh-3.2.2p1 configure.ac)
385    
386    
387 gbeauche 1.30 dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
388     AC_DEFUN(AC_CHECK_FRAMEWORK, [
389     AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
390     AC_CACHE_CHECK([whether compiler supports framework $1],
391     ac_Framework, [
392     saved_LIBS="$LIBS"
393     LIBS="$LIBS -framework $1"
394     AC_TRY_LINK(
395     [$2], [int main(void) { return 0; }],
396     [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
397     )
398     ])
399     AS_IF([test AS_VAR_GET(ac_Framework) = yes],
400     [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
401     )
402     AS_VAR_POPDEF([ac_Framework])dnl
403     ])
404    
405     dnl Check for some MacOS X frameworks
406     AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
407     AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
408    
409 gbeauche 1.1 dnl Select system-dependant source files.
410     SERIALSRC=serial_unix.cpp
411     ETHERSRC=../dummy/ether_dummy.cpp
412     SCSISRC=../dummy/scsi_dummy.cpp
413     AUDIOSRC=../dummy/audio_dummy.cpp
414 gbeauche 1.41 EXTFSSRC=extfs_unix.cpp
415 gbeauche 1.1 EXTRASYSSRCS=
416     CAN_NATIVE_M68K=no
417     case "$target_os" in
418     linux*)
419     ETHERSRC=ether_unix.cpp
420     AUDIOSRC=audio_oss_esd.cpp
421     SCSISRC=Linux/scsi_linux.cpp
422     ;;
423     freebsd*)
424     ETHERSRC=ether_unix.cpp
425     AUDIOSRC=audio_oss_esd.cpp
426     DEFINES="$DEFINES -DBSD_COMP"
427     CXXFLAGS="$CXXFLAGS -fpermissive"
428     dnl Check for the CAM library
429     AC_CHECK_LIB(cam, cam_open_btl, HAVE_LIBCAM=yes, HAVE_LIBCAM=no)
430     if [[ "x$HAVE_LIBCAM" = "xno" ]]; then
431     AC_MSG_WARN([Cannot find libcam for SCSI management, disabling SCSI support.])
432     else
433     dnl Check for the sys kernel includes
434     AC_CHECK_HEADER(camlib.h)
435     if [[ "x$ac_cv_header_camlib_h" = "xno" ]]; then
436     dnl In this case I should fix this thing including a "patch"
437     dnl to access directly to the functions in the kernel :) --Orlando
438     AC_MSG_WARN([Cannot find includes for CAM library, disabling SCSI support.])
439     else
440     SCSISRC=FreeBSD/scsi_freebsd.cpp
441     LIBS="$LIBS -lcam"
442     DEFINES="$DEFINES -DCAM"
443     fi
444     fi
445     ;;
446     netbsd*)
447     CAN_NATIVE_M68K=yes
448     ;;
449     solaris*)
450     AUDIOSRC=Solaris/audio_solaris.cpp
451     DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
452     ;;
453     irix*)
454     ETHERSRC=ether_unix.cpp
455     AUDIOSRC=Irix/audio_irix.cpp
456     EXTRASYSSRCS=Irix/unaligned.c
457     dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
458     DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
459     LIBS="$LIBS -laudio"
460     WANT_ESD=no
461    
462 gbeauche 1.14 dnl Check if our compiler supports -IPA (MIPSPro)
463     HAVE_IPA=no
464 gbeauche 1.1 ocflags="$CFLAGS"
465 gbeauche 1.14 CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"`
466     AC_MSG_CHECKING(if "-IPA" works)
467 gbeauche 1.1 dnl Do a test compile of an empty function
468 gbeauche 1.14 AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
469 gbeauche 1.1 CFLAGS="$ocflags"
470 gbeauche 1.30 ;;
471     darwin*)
472     if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
473     EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
474     fi
475 gbeauche 1.41 if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
476     EXTFSSRC=../MacOSX/extfs_macosx.mm
477     fi
478 gbeauche 1.1 ;;
479 gbeauche 1.36 cygwin*)
480     SERIALSRC="../dummy/serial_dummy.cpp"
481 gbeauche 1.37 EXTRASYSSRCS="../Windows/BasiliskII.rc"
482 gbeauche 1.36 ;;
483 gbeauche 1.1 esac
484 gbeauche 1.26 dnl SDL overrides
485     if [[ "x$WANT_SDL" = "xyes" ]]; then
486     AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
487     fi
488     if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
489 gbeauche 1.31 AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
490 gbeauche 1.30 VIDEOSRCS="../SDL/video_sdl.cpp"
491 gbeauche 1.29 KEYCODES="../SDL/keycodes"
492 gbeauche 1.30 if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
493     EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
494     else
495 gbeauche 1.38 case "$target_os" in
496     cygwin*)
497     EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
498     ;;
499     *)
500     EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
501     ;;
502     esac
503 gbeauche 1.30 fi
504 gbeauche 1.26 else
505 gbeauche 1.30 VIDEOSRCS="video_x.cpp"
506 gbeauche 1.29 KEYCODES="keycodes"
507 gbeauche 1.30 EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
508 gbeauche 1.26 fi
509 gbeauche 1.31 if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
510     AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
511     AUDIOSRC="../SDL/audio_sdl.cpp"
512     fi
513 gbeauche 1.1
514     dnl Use 68k CPU natively?
515     WANT_NATIVE_M68K=no
516     if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then
517     AC_DEFINE(ENABLE_NATIVE_M68K, 1, [Define if using native 68k mode.])
518     WANT_NATIVE_M68K=yes
519     fi
520    
521     if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
522     dnl Serial, ethernet and audio support needs pthreads
523     AC_MSG_WARN([You don't have pthreads, disabling serial, ethernet and audio support.])
524     SERIALSRC=../dummy/serial_dummy.cpp
525     ETHERSRC=../dummy/ether_dummy.cpp
526     AUDIOSRC=../dummy/audio_dummy.cpp
527     fi
528 gbeauche 1.41 SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
529 gbeauche 1.1
530     dnl Define a macro that translates a yesno-variable into a C macro definition
531     dnl to be put into the config.h file
532     dnl $1 -- the macro to define
533     dnl $2 -- the value to translate
534     dnl $3 -- template name
535     AC_DEFUN(AC_TRANSLATE_DEFINE, [
536     if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
537     AC_DEFINE($1, 1, $3)
538     fi
539     ])
540    
541 gbeauche 1.25 dnl Check that the host supports TUN/TAP devices
542     AC_CACHE_CHECK([whether TUN/TAP is supported],
543     ac_cv_tun_tap_support, [
544     AC_TRY_COMPILE([
545     #if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
546     #include <linux/if.h>
547     #include <linux/if_tun.h>
548     #endif
549     #if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H)
550     #include <net/if.h>
551     #include <net/if_tun.h>
552     #endif
553     ], [
554     struct ifreq ifr;
555     memset(&ifr, 0, sizeof(ifr));
556     ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
557     ],
558     ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no
559     )
560     ])
561     AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support",
562     [Define if your system supports TUN/TAP devices.])
563    
564 gbeauche 1.1 dnl Various checks if the system supports vm_allocate() and the like functions.
565     have_mach_vm=no
566     if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
567     "x$ac_cv_func_vm_protect" = "xyes" ]]; then
568     have_mach_vm=yes
569     fi
570     AC_TRANSLATE_DEFINE(HAVE_MACH_VM, "$have_mach_vm",
571     [Define if your system has a working vm_allocate()-based memory allocator.])
572    
573     dnl Check that vm_allocate(), vm_protect() work
574     if [[ "x$have_mach_vm" = "xyes" ]]; then
575    
576     AC_CACHE_CHECK([whether vm_protect works],
577     ac_cv_vm_protect_works, [
578     AC_LANG_SAVE
579     AC_LANG_CPLUSPLUS
580     ac_cv_vm_protect_works=yes
581     dnl First the tests that should segfault
582     for test_def in NONE_READ NONE_WRITE READ_WRITE; do
583     AC_TRY_RUN([
584     #define CONFIGURE_TEST_VM_MAP
585     #define TEST_VM_PROT_$test_def
586     #include "vm_alloc.cpp"
587     ], ac_cv_vm_protect_works=no, rm -f core,
588     dnl When cross-compiling, do not assume anything
589     ac_cv_vm_protect_works="guessing no"
590     )
591     done
592     AC_TRY_RUN([
593     #define CONFIGURE_TEST_VM_MAP
594     #define TEST_VM_PROT_RDWR_WRITE
595     #include "vm_alloc.cpp"
596     ], , ac_cv_vm_protect_works=no,
597     dnl When cross-compiling, do not assume anything
598     ac_cv_vm_protect_works="guessing no"
599     )
600     AC_LANG_RESTORE
601     ]
602     )
603    
604     dnl Remove support for vm_allocate() if vm_protect() does not work
605     if [[ "x$have_mach_vm" = "xyes" ]]; then
606     case $ac_cv_vm_protect_works in
607     *yes) have_mach_vm=yes;;
608     *no) have_mach_vm=no;;
609     esac
610     fi
611     AC_TRANSLATE_DEFINE(HAVE_MACH_VM, "$have_mach_vm",
612     [Define if your system has a working vm_allocate()-based memory allocator.])
613    
614     fi dnl HAVE_MACH_VM
615    
616     dnl Various checks if the system supports mmap() and the like functions.
617     dnl ... and Mach memory allocators are not supported
618     have_mmap_vm=no
619     if [[ "x$ac_cv_func_mmap" = "xyes" -a "x$ac_cv_func_munmap" = "xyes" -a \
620     "x$ac_cv_func_mprotect" = "xyes" ]]; then
621     if [[ "x$have_mach_vm" = "xno" ]]; then
622     have_mmap_vm=yes
623     fi
624     fi
625     AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, "$have_mmap_vm",
626     [Define if your system has a working mmap()-based memory allocator.])
627    
628     dnl Check that mmap() and associated functions work.
629     if [[ "x$have_mmap_vm" = "xyes" ]]; then
630    
631     dnl Check if we have a working anonymous mmap()
632     AC_CACHE_CHECK([whether mmap supports MAP_ANON],
633     ac_cv_mmap_anon, [
634     AC_LANG_SAVE
635     AC_LANG_CPLUSPLUS
636     AC_TRY_RUN([
637     #define HAVE_MMAP_ANON
638     #define CONFIGURE_TEST_VM_MAP
639     #define TEST_VM_MMAP_ANON
640     #include "vm_alloc.cpp"
641     ], ac_cv_mmap_anon=yes, ac_cv_mmap_anon=no,
642     dnl When cross-compiling, do not assume anything.
643     ac_cv_mmap_anon="guessing no"
644     )
645     AC_LANG_RESTORE
646     ]
647     )
648     AC_TRANSLATE_DEFINE(HAVE_MMAP_ANON, "$ac_cv_mmap_anon",
649     [Define if <sys/mman.h> defines MAP_ANON and mmap()'ing with MAP_ANON works.])
650    
651     AC_CACHE_CHECK([whether mmap supports MAP_ANONYMOUS],
652     ac_cv_mmap_anonymous, [
653     AC_LANG_SAVE
654     AC_LANG_CPLUSPLUS
655     AC_TRY_RUN([
656     #define HAVE_MMAP_ANONYMOUS
657     #define CONFIGURE_TEST_VM_MAP
658     #define TEST_VM_MMAP_ANON
659     #include "vm_alloc.cpp"
660     ], ac_cv_mmap_anonymous=yes, ac_cv_mmap_anonymous=no,
661     dnl When cross-compiling, do not assume anything.
662     ac_cv_mmap_anonymous="guessing no"
663     )
664     AC_LANG_RESTORE
665     ]
666     )
667     AC_TRANSLATE_DEFINE(HAVE_MMAP_ANONYMOUS, "$ac_cv_mmap_anonymous",
668     [Define if <sys/mman.h> defines MAP_ANONYMOUS and mmap()'ing with MAP_ANONYMOUS works.])
669    
670     AC_CACHE_CHECK([whether mprotect works],
671     ac_cv_mprotect_works, [
672     AC_LANG_SAVE
673     AC_LANG_CPLUSPLUS
674     ac_cv_mprotect_works=yes
675     dnl First the tests that should segfault
676     for test_def in NONE_READ NONE_WRITE READ_WRITE; do
677     AC_TRY_RUN([
678     #define CONFIGURE_TEST_VM_MAP
679     #define TEST_VM_PROT_$test_def
680     #include "vm_alloc.cpp"
681     ], ac_cv_mprotect_works=no, rm -f core,
682     dnl When cross-compiling, do not assume anything
683     ac_cv_mprotect_works="guessing no"
684     )
685     done
686     AC_TRY_RUN([
687     #define CONFIGURE_TEST_VM_MAP
688     #define TEST_VM_PROT_RDWR_WRITE
689     #include "vm_alloc.cpp"
690     ], , ac_cv_mprotect_works=no,
691     dnl When cross-compiling, do not assume anything
692     ac_cv_mprotect_works="guessing no"
693     )
694     AC_LANG_RESTORE
695     ]
696     )
697    
698     dnl Remove support for mmap() if mprotect() does not work
699     if [[ "x$have_mmap_vm" = "xyes" ]]; then
700     case $ac_cv_mprotect_works in
701     *yes) have_mmap_vm=yes;;
702     *no) have_mmap_vm=no;;
703     esac
704     fi
705     AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_mmap_vm,
706     [Define if your system has a working mmap()-based memory allocator.])
707    
708     fi dnl HAVE_MMAP_VM
709    
710 gbeauche 1.23 dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
711     AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000],
712     ac_cv_pagezero_hack, [
713     ac_cv_pagezero_hack=no
714     if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then
715     ac_cv_pagezero_hack=yes
716     dnl might as well skip the test for mmap-able low memory
717     ac_cv_can_map_lm=no
718     fi
719     ])
720     AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
721     [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
722    
723 gbeauche 1.1 dnl Check if we can mmap 0x2000 bytes from 0x0000
724     AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
725     ac_cv_can_map_lm, [
726     AC_LANG_SAVE
727     AC_LANG_CPLUSPLUS
728     AC_TRY_RUN([
729     #include "vm_alloc.cpp"
730     int main(void) { /* returns 0 if we could map the lowmem globals */
731 gbeauche 1.15 volatile char * lm = 0;
732 gbeauche 1.1 if (vm_init() < 0) exit(1);
733 gbeauche 1.15 if (vm_acquire_fixed(0, 0x2000) < 0) exit(1);
734 gbeauche 1.1 lm[0] = 'z';
735     if (vm_release((char *)lm, 0x2000) < 0) exit(1);
736     vm_exit(); exit(0);
737     }
738     ], ac_cv_can_map_lm=yes, ac_cv_can_map_lm=no,
739     dnl When cross-compiling, do not assume anything.
740     ac_cv_can_map_lm="guessing no"
741     )
742     AC_LANG_RESTORE
743     ]
744     )
745    
746 gbeauche 1.34 dnl Check if we have POSIX shared memory support
747     AC_CACHE_CHECK([whether POSIX shared memory is working],
748     ac_cv_have_posix_shm, [
749     AC_LANG_SAVE
750     AC_LANG_CPLUSPLUS
751     AC_TRY_RUN([
752     #define HAVE_POSIX_SHM
753     #include "vm_alloc.cpp"
754     int main(void) { /* returns 0 if we have working POSIX shm */
755     if (vm_init() < 0) exit(2);
756     char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
757     if (m1 == VM_MAP_FAILED) exit(3);
758     vm_exit(); exit(0);
759     }
760     ], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no,
761     dnl When cross-compiling, do not assume anything.
762     ac_cv_have_posix_shm="guessing no"
763     )
764     AC_LANG_RESTORE
765     ]
766     )
767     AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm",
768     [Define if your system supports POSIX shared memory.])
769    
770     dnl Check if we have working 33-bit memory addressing
771     AC_CACHE_CHECK([whether 33-bit memory addressing is working],
772     ac_cv_have_33bit_addressing, [
773     AC_LANG_SAVE
774     AC_LANG_CPLUSPLUS
775     AC_TRY_RUN([
776     #define USE_33BIT_ADDRESSING 1
777     #include "vm_alloc.cpp"
778     int main(void) { /* returns 0 if we have working 33-bit addressing */
779     if (sizeof(void *) < 8) exit(1);
780     if (vm_init() < 0) exit(2);
781     char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
782     if (m1 == VM_MAP_FAILED) exit(3);
783     char *m2 = m1 + (1L << 32);
784     m1[0] = 0x12; if (m2[0] != 0x12) exit(4);
785     m2[0] = 0x34; if (m1[0] != 0x34) exit(5);
786     vm_exit(); exit(0);
787     }
788     ], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no,
789     dnl When cross-compiling, do not assume anything.
790     ac_cv_have_33bit_addressing="guessing no"
791     )
792     AC_LANG_RESTORE
793     ]
794     )
795    
796 gbeauche 1.1 dnl Check signal handlers need to be reinstalled
797     AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
798     ac_cv_signal_need_reinstall, [
799     AC_LANG_SAVE
800     AC_LANG_CPLUSPLUS
801     AC_TRY_RUN([
802     #include <stdlib.h>
803     #ifdef HAVE_UNISTD_H
804     #include <unistd.h>
805     #endif
806     #include <signal.h>
807     static int handled_signal = 0;
808     RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
809     int main(void) { /* returns 0 if signals need not to be reinstalled */
810     signal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
811     exit(handled_signal == 2);
812     }
813     ], ac_cv_signal_need_reinstall=yes, ac_cv_signal_need_reinstall=no,
814     dnl When cross-compiling, do not assume anything.
815     ac_cv_signal_need_reinstall="guessing yes"
816     )
817     AC_LANG_RESTORE
818     ]
819     )
820     AC_TRANSLATE_DEFINE(SIGNAL_NEED_REINSTALL, "$ac_cv_signal_need_reinstall",
821     [Define if your system requires signals to be reinstalled.])
822    
823     dnl Check if sigaction handlers need to be reinstalled
824     AC_CACHE_CHECK([whether sigaction handlers need to be reinstalled],
825     ac_cv_sigaction_need_reinstall, [
826     AC_LANG_SAVE
827     AC_LANG_CPLUSPLUS
828     AC_TRY_RUN([
829     #include <stdlib.h>
830     #ifdef HAVE_UNISTD_H
831     #include <unistd.h>
832     #endif
833     #include <signal.h>
834     static int handled_signal = 0;
835     RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
836     typedef RETSIGTYPE (*signal_handler)(int);
837     static signal_handler mysignal(int sig, signal_handler handler) {
838     struct sigaction old_sa;
839     struct sigaction new_sa;
840     new_sa.sa_handler = handler;
841     return ((sigaction(sig,&new_sa,&old_sa) < 0) ? SIG_IGN : old_sa.sa_handler);
842     }
843     int main(void) { /* returns 0 if signals need not to be reinstalled */
844     mysignal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
845     exit(handled_signal == 2);
846     }
847     ], ac_cv_sigaction_need_reinstall=yes, ac_cv_sigaction_need_reinstall=no,
848     dnl When cross-compiling, do not assume anything.
849     ac_cv_sigaction_need_reinstall="guessing yes"
850     )
851     AC_LANG_RESTORE
852     ]
853     )
854     AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
855     [Define if your system requires sigactions to be reinstalled.])
856    
857 gbeauche 1.21 dnl Check if Mach exceptions supported.
858     AC_CACHE_CHECK([whether your system supports Mach exceptions],
859     ac_cv_have_mach_exceptions, [
860 gbeauche 1.1 AC_LANG_SAVE
861     AC_LANG_CPLUSPLUS
862     AC_TRY_RUN([
863 gbeauche 1.21 #define HAVE_MACH_EXCEPTIONS 1
864 gbeauche 1.1 #define CONFIGURE_TEST_SIGSEGV_RECOVERY
865     #include "vm_alloc.cpp"
866     #include "sigsegv.cpp"
867 gbeauche 1.21 ], [
868     sigsegv_recovery=mach
869     ac_cv_have_mach_exceptions=yes
870     ],
871     ac_cv_have_mach_exceptions=no,
872 gbeauche 1.1 dnl When cross-compiling, do not assume anything.
873 gbeauche 1.21 ac_cv_have_mach_exceptions=no
874 gbeauche 1.1 )
875     AC_LANG_RESTORE
876     ]
877     )
878 gbeauche 1.21 AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
879     [Define if your system supports Mach exceptions.])
880    
881 gbeauche 1.36 dnl Check if Windows exceptions are supported.
882     AC_CACHE_CHECK([whether your system supports Windows exceptions],
883     ac_cv_have_win32_exceptions, [
884     AC_LANG_SAVE
885     AC_LANG_CPLUSPLUS
886     AC_TRY_RUN([
887     #define HAVE_WIN32_EXCEPTIONS 1
888     #define CONFIGURE_TEST_SIGSEGV_RECOVERY
889     #include "vm_alloc.cpp"
890     #include "sigsegv.cpp"
891     ], [
892     sigsegv_recovery=win32
893     ac_cv_have_win32_exceptions=yes
894     ],
895     ac_cv_have_win32_exceptions=no,
896     dnl When cross-compiling, do not assume anything.
897     ac_cv_have_win32_exceptions=no
898     )
899     AC_LANG_RESTORE
900     ]
901     )
902     AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
903     [Define if your system supports Windows exceptions.])
904    
905 gbeauche 1.21 dnl Otherwise, check if extended signals are supported.
906     if [[ -z "$sigsegv_recovery" ]]; then
907     AC_CACHE_CHECK([whether your system supports extended signal handlers],
908     ac_cv_have_extended_signals, [
909     AC_LANG_SAVE
910     AC_LANG_CPLUSPLUS
911     AC_TRY_RUN([
912     #define HAVE_SIGINFO_T 1
913     #define CONFIGURE_TEST_SIGSEGV_RECOVERY
914     #include "vm_alloc.cpp"
915     #include "sigsegv.cpp"
916     ], [
917     sigsegv_recovery=siginfo
918     ac_cv_have_extended_signals=yes
919     ],
920     ac_cv_have_extended_signals=no,
921     dnl When cross-compiling, do not assume anything.
922     ac_cv_have_extended_signals=no
923     )
924     AC_LANG_RESTORE
925     ]
926     )
927     AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
928     [Define if your system support extended signals.])
929     fi
930 gbeauche 1.1
931     dnl Otherwise, check for subterfuges.
932 gbeauche 1.21 if [[ -z "$sigsegv_recovery" ]]; then
933 gbeauche 1.1 AC_CACHE_CHECK([whether we then have a subterfuge for your system],
934     ac_cv_have_sigcontext_hack, [
935     AC_LANG_SAVE
936     AC_LANG_CPLUSPLUS
937     AC_TRY_RUN([
938     #define HAVE_SIGCONTEXT_SUBTERFUGE 1
939     #define CONFIGURE_TEST_SIGSEGV_RECOVERY
940     #include "vm_alloc.cpp"
941     #include "sigsegv.cpp"
942 gbeauche 1.21 ], [
943     sigsegv_recovery=sigcontext
944     ac_cv_have_sigcontext_hack=yes
945     ],
946     ac_cv_have_sigcontext_hack=no,
947 gbeauche 1.1 dnl When cross-compiling, do not assume anything.
948     ac_cv_have_sigcontext_hack=no
949     )
950     AC_LANG_RESTORE
951     ])
952     AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack",
953     [Define if we know a hack to replace siginfo_t->si_addr member.])
954     fi
955    
956     dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler)
957     AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler],
958     ac_cv_have_skip_instruction, [
959     AC_LANG_SAVE
960     AC_LANG_CPLUSPLUS
961     AC_TRY_RUN([
962     #define HAVE_SIGSEGV_SKIP_INSTRUCTION 1
963     #define CONFIGURE_TEST_SIGSEGV_RECOVERY
964     #include "vm_alloc.cpp"
965     #include "sigsegv.cpp"
966     ], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no,
967     dnl When cross-compiling, do not assume anything.
968     ac_cv_have_skip_instruction=no
969     )
970     AC_LANG_RESTORE
971     ]
972     )
973     AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction",
974     [Define if we can ignore the fault (instruction skipping in SIGSEGV handler).])
975    
976     dnl Can we do Video on SEGV Signals ?
977     CAN_VOSF=no
978 gbeauche 1.21 if [[ -n "$sigsegv_recovery" ]]; then
979 gbeauche 1.1 CAN_VOSF=yes
980     fi
981    
982 gbeauche 1.23 dnl A dummy program that returns always true
983 gbeauche 1.28 AC_PATH_PROG([BLESS], "true")
984 gbeauche 1.23
985 gbeauche 1.1 dnl Determine the addressing mode to use
986     if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
987     ADDRESSING_MODE="real"
988     else
989     ADDRESSING_MODE=""
990     AC_MSG_CHECKING([for the addressing mode to use])
991     for am in $ADDRESSING_TEST_ORDER; do
992     case $am in
993     real)
994     dnl Requires ability to mmap() Low Memory globals
995 gbeauche 1.23 if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then
996 gbeauche 1.1 continue
997     fi
998 gbeauche 1.23 dnl Requires VOSF screen updates
999 gbeauche 1.1 if [[ "x$CAN_VOSF" = "xno" ]]; then
1000     continue
1001     fi
1002     dnl Real addressing will probably work.
1003     ADDRESSING_MODE="real"
1004     WANT_VOSF=yes dnl we can use VOSF and we need it actually
1005     DEFINES="$DEFINES -DREAL_ADDRESSING"
1006 gbeauche 1.23 if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
1007     BLESS=Darwin/lowmem
1008     LDFLAGS="$LDFLAGS -pagezero_size 0x2000"
1009     fi
1010 gbeauche 1.1 break
1011     ;;
1012     direct)
1013     dnl Requires VOSF screen updates
1014     if [[ "x$CAN_VOSF" = "xyes" ]]; then
1015     ADDRESSING_MODE="direct"
1016     WANT_VOSF=yes dnl we can use VOSF and we need it actually
1017     DEFINES="$DEFINES -DDIRECT_ADDRESSING"
1018     break
1019     fi
1020     ;;
1021     banks)
1022     dnl Default addressing mode
1023     ADDRESSING_MODE="memory banks"
1024     break
1025     ;;
1026     *)
1027     AC_MSG_ERROR([Internal configure.in script error for $am addressing mode])
1028     esac
1029     done
1030     AC_MSG_RESULT($ADDRESSING_MODE)
1031     if [[ "x$ADDRESSING_MODE" = "x" ]]; then
1032     AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
1033     ADDRESSING_MODE="memory banks"
1034     fi
1035     fi
1036    
1037 gbeauche 1.5 dnl Banked Memory Addressing mode is not supported by the JIT compiler
1038     if [[ "x$WANT_JIT" = "xyes" -a "x$ADDRESSING_MODE" = "xmemory banks" ]]; then
1039     AC_MSG_ERROR([Sorry, the JIT Compiler requires Direct Addressing, at least])
1040     fi
1041    
1042 gbeauche 1.1 dnl Enable VOSF screen updates with this feature is requested and feasible
1043     if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then
1044     AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.])
1045     else
1046     WANT_VOSF=no
1047     fi
1048    
1049     dnl Check for GAS.
1050     HAVE_GAS=no
1051     AC_MSG_CHECKING(for GAS .p2align feature)
1052     cat >conftest.S << EOF
1053     .text
1054     .p2align 5
1055     EOF
1056     if $CC conftest.S -c -o conftest.o >/dev/null 2>&1 ; then HAVE_GAS=yes; fi
1057     AC_MSG_RESULT($HAVE_GAS)
1058    
1059     dnl Check for GCC 2.7 or higher.
1060     HAVE_GCC27=no
1061     AC_MSG_CHECKING(for GCC 2.7 or higher)
1062 cebix 1.17 AC_EGREP_CPP(xyes,
1063 gbeauche 1.1 [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1064 cebix 1.17 xyes
1065 gbeauche 1.1 #endif
1066     ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1067    
1068     dnl Check for GCC 3.0 or higher.
1069     HAVE_GCC30=no
1070     AC_MSG_CHECKING(for GCC 3.0 or higher)
1071 cebix 1.17 AC_EGREP_CPP(xyes,
1072 gbeauche 1.1 [#if __GNUC__ >= 3
1073 cebix 1.17 xyes
1074 gbeauche 1.1 #endif
1075     ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1076    
1077 gbeauche 1.39 dnl Check for ICC.
1078     AC_MSG_CHECKING(for ICC)
1079     HAVE_ICC=no
1080     if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
1081     HAVE_ICC=yes
1082     fi
1083     AC_MSG_RESULT($HAVE_ICC)
1084    
1085 gbeauche 1.1 dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
1086     dnl Also set "-fno-exceptions" for C++ because exception handling requires
1087     dnl the frame pointer.
1088     if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
1089     CFLAGS="$CFLAGS -fomit-frame-pointer"
1090     CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -fno-exceptions"
1091     fi
1092    
1093     dnl (gb) Do not merge constants since it breaks fpu/fpu_x86.cpp.
1094     dnl As of 2001/08/02, this affects the following compilers:
1095     dnl Official: probably gcc-3.1 (mainline CVS)
1096     dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
1097     dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
1098 gbeauche 1.39 if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1099 gbeauche 1.1 SAVED_CXXFLAGS="$CXXFLAGS"
1100     CXXFLAGS="$CXXFLAGS -fno-merge-constants"
1101     AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
1102     AC_LANG_SAVE
1103     AC_LANG_CPLUSPLUS
1104     AC_TRY_COMPILE([],[],[ac_cv_gcc_constants_merging=yes],[ac_cv_gcc_constants_merging=no])
1105     AC_LANG_RESTORE
1106     ])
1107     if [[ "x$ac_cv_gcc_constants_merging" != "xyes" ]]; then
1108     CXXFLAGS="$SAVED_CXXFLAGS"
1109     fi
1110     fi
1111    
1112 gbeauche 1.33 dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1113     dnl However, there are some corner cases exposed on x86-64
1114 gbeauche 1.39 if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1115 gbeauche 1.33 SAVED_CXXFLAGS="$CXXFLAGS"
1116     CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1117     AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
1118     AC_LANG_SAVE
1119     AC_LANG_CPLUSPLUS
1120     AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no])
1121     AC_LANG_RESTORE
1122     ])
1123     if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then
1124     CXXFLAGS="$SAVED_CXXFLAGS"
1125     fi
1126     fi
1127    
1128 gbeauche 1.39 dnl Add -fno-strict-aliasing for slirp sources
1129     if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1130 gbeauche 1.40 SAVED_CFLAGS="$CFLAGS"
1131 gbeauche 1.39 CFLAGS="$CFLAGS -fno-strict-aliasing"
1132     AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1133     ac_cv_gcc_no_strict_aliasing, [
1134     AC_TRY_COMPILE([],[],
1135     [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "$CFLAGS")],
1136     [ac_cv_gcc_no_strict_aliasing=no])
1137     ])
1138     CFLAGS="$SAVED_CFLAGS"
1139     fi
1140    
1141 gbeauche 1.1 dnl Select appropriate CPU source and REGPARAM define.
1142     ASM_OPTIMIZATIONS=none
1143     CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
1144 gbeauche 1.5
1145     dnl (gb) JITSRCS will be emptied later if the JIT is not available
1146     dnl Other platforms should define their own set of noflags file variants
1147     CAN_JIT=no
1148     JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp"
1149    
1150 gbeauche 1.11 if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
1151 gbeauche 1.1 dnl i386 CPU
1152 gbeauche 1.7 DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\""
1153 gbeauche 1.1 if [[ "x$HAVE_GAS" = "xyes" ]]; then
1154     ASM_OPTIMIZATIONS=i386
1155 gbeauche 1.7 DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE"
1156 gbeauche 1.10 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"
1157 gbeauche 1.11 CAN_JIT=yes
1158 gbeauche 1.13 fi
1159     elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then
1160     dnl x86-64 CPU
1161     DEFINES="$DEFINES -DUNALIGNED_PROFITABLE"
1162     if [[ "x$HAVE_GAS" = "xyes" ]]; then
1163     ASM_OPTIMIZATIONS="x86-64"
1164     DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
1165 gbeauche 1.32 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"
1166     CAN_JIT=yes
1167 gbeauche 1.34 WANT_33BIT_ADDRESSING=yes
1168 gbeauche 1.1 fi
1169     elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
1170     dnl SPARC CPU
1171     case "$target_os" in
1172     solaris*)
1173     AC_MSG_CHECKING(SPARC CPU architecture)
1174     SPARC_TYPE=`Solaris/which_sparc`
1175     AC_MSG_RESULT($SPARC_TYPE)
1176     case "$SPARC_TYPE" in
1177     SPARC_V8)
1178     ASM_OPTIMIZATIONS="SPARC V8 architecture"
1179     DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
1180     CFLAGS="$CFLAGS -Wa,-Av8"
1181     CXXFLAGS="$CXXFLAGS -Wa,-Av8"
1182     ;;
1183     SPARC_V9)
1184     ASM_OPTIMIZATIONS="SPARC V9 architecture"
1185     DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
1186     CFLAGS="$CFLAGS -Wa,-Av9"
1187     CXXFLAGS="$CXXFLAGS -Wa,-Av9"
1188     ;;
1189     esac
1190     ;;
1191     esac
1192     elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
1193     dnl Native m68k, no emulation
1194     CPUINCLUDES="-I../native_cpu"
1195     CPUSRCS="asm_support.s"
1196     fi
1197    
1198 gbeauche 1.5 dnl Enable JIT compiler, if possible.
1199     if [[ "x$WANT_JIT" = "xyes" -a "x$CAN_JIT" ]]; then
1200     JITSRCS="$JITSRCS ../uae_cpu/compiler/compemu_support.cpp ../uae_cpu/compiler/compemu_fpp.cpp compstbl.o cpustbl_nf.o"
1201     DEFINES="$DEFINES -DUSE_JIT -DUSE_JIT_FPU"
1202    
1203     if [[ "x$WANT_JIT_DEBUG" = "xyes" ]]; then
1204     if [[ "x$WANT_MON" = "xyes" ]]; then
1205     DEFINES="$DEFINES -DJIT_DEBUG=1"
1206     else
1207     AC_MSG_WARN([cxmon not found, ignoring --enable-jit-debug])
1208     WANT_JIT_DEBUG=no
1209     fi
1210     fi
1211 gbeauche 1.8
1212     dnl IEEE core is the only FPU emulator to use with the JIT compiler
1213     case $FPE_CORE_TEST_ORDER in
1214     ieee*) ;;
1215     *) AC_MSG_WARN([Forcing use of the IEEE FPU core, as the JIT compiler supports only this one.]) ;;
1216     esac
1217     FPE_CORE_TEST_ORDER="ieee"
1218 gbeauche 1.5 else
1219     WANT_JIT=no
1220     WANT_JIT_DEBUG=no
1221     JITSRCS=""
1222     fi
1223    
1224 gbeauche 1.34 dnl Use 33-bit memory addressing?
1225     if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then
1226     use_33bit_addressing=yes
1227     fi
1228     AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing",
1229     [Define to use 33-bit memory addressing on 64-bit JIT capable systems.])
1230    
1231 gbeauche 1.1 dnl Utility macro used by next two tests.
1232     dnl AC_EXAMINE_OBJECT(C source code,
1233     dnl commands examining object file,
1234     dnl [commands to run if compile failed]):
1235     dnl
1236     dnl Compile the source code to an object file; then convert it into a
1237     dnl printable representation. All unprintable characters and
1238     dnl asterisks (*) are replaced by dots (.). All white space is
1239     dnl deleted. Newlines (ASCII 0x10) in the input are preserved in the
1240     dnl output, but runs of newlines are compressed to a single newline.
1241     dnl Finally, line breaks are forcibly inserted so that no line is
1242     dnl longer than 80 columns and the file ends with a newline. The
1243     dnl result of all this processing is in the file conftest.dmp, which
1244     dnl may be examined by the commands in the second argument.
1245     dnl
1246     AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1247     [AC_LANG_SAVE
1248     AC_LANG_C
1249     dnl Next bit cribbed from AC_TRY_COMPILE.
1250     cat > conftest.$ac_ext <<EOF
1251     [#line __oline__ "configure"
1252     #include "confdefs.h"
1253     $1
1254     ]EOF
1255     if AC_TRY_EVAL(ac_compile); then
1256     od -c conftest.o |
1257     sed ['s/^[0-7]*[ ]*/ /
1258     s/\*/./g
1259     s/ \\n/*/g
1260     s/ [0-9][0-9][0-9]/./g
1261     s/ \\[^ ]/./g'] |
1262     tr -d '
1263     ' | tr -s '*' '
1264     ' | fold | sed '$a\
1265     ' > conftest.dmp
1266     $2
1267     ifelse($3, , , else
1268     $3
1269     )dnl
1270     fi
1271     rm -rf conftest*
1272     AC_LANG_RESTORE])
1273    
1274     dnl Floating point format probe.
1275     dnl The basic concept is the same as the above: grep the object
1276     dnl file for an interesting string. We have to watch out for
1277     dnl rounding changing the values in the object, however; this is
1278     dnl handled by ignoring the least significant byte of the float.
1279     dnl
1280     dnl Does not know about VAX G-float or C4x idiosyncratic format.
1281     dnl It does know about PDP-10 idiosyncratic format, but this is
1282     dnl not presently supported by GCC. S/390 "binary floating point"
1283     dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1284     dnl as ASCII?)
1285     dnl
1286     AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1287     [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1288     [gcc_AC_EXAMINE_OBJECT(
1289     [/* This will not work unless sizeof(double) == 8. */
1290     extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1291    
1292     /* This structure must have no internal padding. */
1293     struct possibility {
1294     char prefix[8];
1295     double candidate;
1296     char postfix[8];
1297     };
1298    
1299     #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1300     struct possibility table [] =
1301     {
1302     C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1303     C( 3.53802595280598432000e+18), /* D__float - VAX */
1304     C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1305     C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1306     C(-5.22995989424860458374e+10) /* IBMHEXFP - s/390 format, EBCDIC */
1307     };],
1308     [if grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1309     ac_cv_c_float_format='IEEE (big-endian)'
1310     elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1311     ac_cv_c_float_format='IEEE (big-endian)'
1312     elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1313     ac_cv_c_float_format='IEEE (little-endian)'
1314     elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1315     ac_cv_c_float_format='IEEE (little-endian)'
1316     elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1317     ac_cv_c_float_format='VAX D-float'
1318     elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1319     ac_cv_c_float_format='PDP-10'
1320     elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1321     ac_cv_c_float_format='IBM 370 hex'
1322     else
1323     AC_MSG_ERROR(Unknown floating point format)
1324     fi],
1325     [AC_MSG_ERROR(compile failed)])
1326     ])
1327     # IEEE is the default format. If the float endianness isn't the same
1328     # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1329     # (which is a tristate: yes, no, default). This is only an issue with
1330     # IEEE; the other formats are only supported by a few machines each,
1331     # all with the same endianness.
1332     format=IEEE_FLOAT_FORMAT
1333     fbigend=
1334     case $ac_cv_c_float_format in
1335     'IEEE (big-endian)' )
1336     if test $ac_cv_c_bigendian = no; then
1337     fbigend=1
1338     fi
1339     ;;
1340     'IEEE (little-endian)' )
1341     if test $ac_cv_c_bigendian = yes; then
1342     fbigend=0
1343     fi
1344     ;;
1345     'VAX D-float' )
1346     format=VAX_FLOAT_FORMAT
1347     ;;
1348     'PDP-10' )
1349     format=PDP10_FLOAT_FORMAT
1350     ;;
1351     'IBM 370 hex' )
1352     format=IBM_FLOAT_FORMAT
1353     ;;
1354     esac
1355     AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1356     [Define to the floating point format of the host machine.])
1357     if test -n "$fbigend"; then
1358     AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1359     [Define to 1 if the host machine stores floating point numbers in
1360     memory with the word containing the sign bit at the lowest address,
1361     or to 0 if it does it the other way around.
1362    
1363     This macro should not be defined if the ordering is the same as for
1364     multi-word integers.])
1365     fi
1366     ])
1367    
1368     dnl Select appropriate FPU source.
1369     gcc_AC_C_FLOAT_FORMAT
1370     AC_CHECK_HEADERS(ieee754.h ieeefp.h floatingpoint.h nan.h)
1371    
1372     for fpe in $FPE_CORE_TEST_ORDER; do
1373     case $fpe in
1374     ieee)
1375 gbeauche 1.2 case $ac_cv_c_float_format in
1376     IEEE*)
1377 gbeauche 1.1 FPE_CORE="IEEE fpu core"
1378     DEFINES="$DEFINES -DFPU_IEEE"
1379     FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp"
1380 gbeauche 1.4 dnl Math functions not mandated by C99 standard
1381     AC_CHECK_FUNCS(isnanl isinfl)
1382     dnl Math functions required by C99 standard, but probably not
1383     dnl implemented everywhere. In that case, we fall back to the
1384     dnl regular variant for doubles.
1385     AC_CHECK_FUNCS(logl log10l expl powl fabsl sqrtl)
1386     AC_CHECK_FUNCS(sinl cosl tanl sinhl coshl tanhl)
1387     AC_CHECK_FUNCS(asinl acosl atanl asinhl acoshl atanhl)
1388     AC_CHECK_FUNCS(floorl ceill)
1389 gbeauche 1.1 break
1390 gbeauche 1.2 ;;
1391     esac
1392 gbeauche 1.1 ;;
1393     x86)
1394     if [[ ":$HAVE_GCC27:$HAVE_I386:$HAVE_GAS:" = ":yes:yes:yes:" ]]; then
1395     FPE_CORE="i387 fpu core"
1396     DEFINES="$DEFINES -DFPU_X86"
1397     FPUSRCS="../uae_cpu/fpu/fpu_x86.cpp"
1398     break
1399     fi
1400     ;;
1401     uae)
1402     FPE_CORE="uae fpu core"
1403     DEFINES="$DEFINES -DFPU_UAE"
1404     FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp"
1405     break
1406     ;;
1407     *)
1408     AC_MSG_ERROR([Internal configure.in script error for $fpe fpu core])
1409     ;;
1410     esac
1411     done
1412     if [[ "x$FPE_CORE" = "x" ]]; then
1413     AC_MSG_ERROR([Sorry, no suitable FPU core found in $FPE_CORE_TEST_ORDER])
1414     fi
1415    
1416     dnl Check for certain math functions
1417     AC_CHECK_FUNCS(atanh)
1418 gbeauche 1.4 AC_CHECK_FUNCS(isnan isinf finite isnormal signbit)
1419 gbeauche 1.1
1420     dnl UAE CPU sources for all non-m68k-native architectures.
1421     if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then
1422     CPUINCLUDES="-I../uae_cpu"
1423 gbeauche 1.5 CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS $JITSRCS"
1424 gbeauche 1.1 fi
1425    
1426     dnl Remove the "-g" option if set for GCC.
1427     if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1428 gbeauche 1.33 CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
1429     CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
1430 gbeauche 1.1 fi
1431    
1432 gbeauche 1.14 dnl Or if we have -IPA (MIPSPro compilers)
1433     if [[ "x$HAVE_IPA" = "xyes" ]]; then
1434     CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1435     CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1436 gbeauche 1.1 CXXFLAGS="-LANG:std $CXXFLAGS"
1437 gbeauche 1.14 LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1438 gbeauche 1.1 fi
1439    
1440     dnl Generate Makefile.
1441     AC_SUBST(DEFINES)
1442     AC_SUBST(SYSSRCS)
1443     AC_SUBST(CPUINCLUDES)
1444     AC_SUBST(CPUSRCS)
1445 gbeauche 1.23 AC_SUBST(BLESS)
1446 gbeauche 1.29 AC_SUBST(KEYCODES)
1447 cebix 1.16 AC_CONFIG_FILES([Makefile])
1448     AC_OUTPUT
1449 gbeauche 1.1
1450     dnl Print summary.
1451     echo
1452     echo Basilisk II configuration summary:
1453     echo
1454 gbeauche 1.26 echo SDL support ............................ : $SDL_SUPPORT
1455 gbeauche 1.1 echo XFree86 DGA support .................... : $WANT_XF86_DGA
1456     echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE
1457     echo fbdev DGA support ...................... : $WANT_FBDEV_DGA
1458     echo Enable video on SEGV signals ........... : $WANT_VOSF
1459     echo ESD sound support ...................... : $WANT_ESD
1460     echo GTK user interface ..................... : $WANT_GTK
1461     echo mon debugger support ................... : $WANT_MON
1462     echo Running m68k code natively ............. : $WANT_NATIVE_M68K
1463 gbeauche 1.5 echo Use JIT compiler ....................... : $WANT_JIT
1464     echo JIT debug mode ......................... : $WANT_JIT_DEBUG
1465 gbeauche 1.1 echo Floating-Point emulation core .......... : $FPE_CORE
1466     echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
1467     echo Addressing mode ........................ : $ADDRESSING_MODE
1468 gbeauche 1.21 echo Bad memory access recovery type ........ : $sigsegv_recovery
1469 gbeauche 1.1 echo
1470     echo "Configuration done. Now type \"make\" (or \"gmake\")."