ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/MacOSX/configure.in
Revision: 1.13
Committed: 2004-01-27T04:35:30Z (20 years, 4 months ago) by nigel
Branch: MAIN
CVS Tags: nigel-build-15
Changes since 1.12: +44 -31 lines
Log Message:
Some latest changes from Unix version, add subterfuge test back in
(even though it will still hang - it is not needed on OS X),
use DIRECT/REAL_ADDRESSING/FPU_IEEE/UAE from config

File Contents

# User Rev Content
1 nigel 1.10 dnl Mac OS X configuration driver
2 nigel 1.13 dnl $Id: configure.in,v 1.12 2003/11/18 11:17:55 nigel Exp $
3 nigel 1.1 dnl Process this file with autoconf to produce a configure script.
4     dnl Based on Unix/configure.in
5     dnl Written in 1999 by Christian Bauer et al.
6    
7 nigel 1.11 dnl autoconf on 10.1 doesn't understand these
8     dnl AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII)
9     dnl AC_CONFIG_SRCDIR(main_macosx.mm)
10 nigel 1.1 AC_INIT(main_macosx.mm)
11     AC_PREREQ(2.12)
12     AC_CONFIG_HEADER(config.h)
13    
14 nigel 1.13 dnl Aliases for PACKAGE and VERSION macros.
15     AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.])
16     AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.])
17    
18     dnl Some systems do not put corefiles in the currect directory, avoid saving
19     dnl cores for the configure tests since some are intended to dump core.
20     ulimit -c 0
21    
22 nigel 1.5 dnl Video options.
23 nigel 1.1 AC_ARG_ENABLE(multiwin,
24 nigel 1.8 [ --enable-multiwin allow multiple emulator windows [default=no]], [ENABLE_MULTIPLE=$enableval], [ENABLE_MULTIPLE=no])
25 nigel 1.1
26 nigel 1.5 dnl JIT compiler options.
27     AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no])
28     AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
29    
30 nigel 1.1 dnl FPU emulation core.
31     AC_ARG_ENABLE(fpe,
32 nigel 1.5 [ --enable-fpe=FPE specify which fpu emulator to use [default=auto]],
33 nigel 1.1 [ case "$enableval" in
34 nigel 1.5 dnl default is always ieee, if architecture has this fp format
35     auto) FPE_CORE_TEST_ORDER="ieee uae";;
36     ieee) FPE_CORE_TEST_ORDER="ieee";;
37     uae) FPE_CORE_TEST_ORDER="uae";;
38     x86) FPE_CORE_TEST_ORDER="x86";;
39 nigel 1.10 *) AC_MSG_ERROR([--enable-fpe takes only one of the following values: auto, x86, ieee, uae]);;
40 nigel 1.1 esac
41     ],
42 nigel 1.5 [ FPE_CORE_TEST_ORDER="ieee uae"
43 nigel 1.1 ])
44    
45     dnl Addressing modes.
46     AC_ARG_ENABLE(addressing,
47     [ --enable-addressing=AM specify the addressing mode to use [default=fastest]],
48     [ case "$enableval" in
49     real) ADDRESSING_TEST_ORDER="real";;
50     direct) ADDRESSING_TEST_ORDER="direct";;
51     banks) ADDRESSING_TEST_ORDER="banks";;
52     fastest)ADDRESSING_TEST_ORDER="direct banks";;
53     *) AC_MSG_ERROR([--enable-addressing takes only one of the following values: fastest, real, direct, banks]);;
54     esac
55     ],
56     [ ADDRESSING_TEST_ORDER="direct banks"
57     ])
58    
59     dnl External packages.
60     AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
61    
62     dnl Canonical system information.
63     AC_CANONICAL_HOST
64     AC_CANONICAL_TARGET
65    
66     dnl Target OS type
67     OS_TYPE=darwin
68     DEFINES="$DEFINES -DOS_$OS_TYPE"
69    
70     dnl Target CPU type.
71     HAVE_I386=no
72     HAVE_M68K=no
73     HAVE_SPARC=no
74     HAVE_POWERPC=no
75 nigel 1.10 HAVE_X86_64=no
76 nigel 1.1 case "$target_cpu" in
77 nigel 1.10 i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;;
78     m68k* ) HAVE_M68K=yes;;
79     sparc* ) HAVE_SPARC=yes;;
80     powerpc* ) HAVE_POWERPC=yes;;
81     x86_64* ) HAVE_X86_64=yes;;
82 nigel 1.1 esac
83    
84     dnl Checks for programs.
85     AC_PROG_CC
86     AC_PROG_CC_C_O
87     AC_PROG_CPP
88     AC_PROG_CXX
89     AC_PROG_MAKE_SET
90     AC_PROG_INSTALL
91    
92 nigel 1.8 dnl MacOS 10.2 (and later?) have a particular header for defining the OS version
93 nigel 1.7 AC_CHECK_HEADER(AvailabilityMacros.h)
94     if [[ "x$ac_cv_header_AvailabilityMacros_h" = "xyes" ]]; then
95 nigel 1.8 AC_DEFINE(AVAILABILITYMACROS, 1, [Header specific to 10.2 and later.])
96 nigel 1.7 fi
97    
98 nigel 1.1 dnl We use mon if possible.
99     MONSRCS=
100     if [[ "x$WANT_MON" = "xyes" ]]; then
101     AC_MSG_CHECKING(for mon)
102     mon_srcdir=../../../mon/src
103     if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
104     AC_MSG_RESULT(yes)
105 nigel 1.5 AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
106     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"
107 nigel 1.1 CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
108 nigel 1.10 AC_CHECK_LIB(ncurses, tgetent, ,
109     AC_CHECK_LIB(termcap, tgetent, ,
110     AC_CHECK_LIB(termlib, tgetent, ,
111     AC_CHECK_LIB(terminfo, tgetent, ,
112     AC_CHECK_LIB(Hcurses, tgetent, ,
113     AC_CHECK_LIB(curses, tgetent))))))
114 nigel 1.1 AC_CHECK_LIB(readline, readline)
115     else
116     AC_MSG_RESULT(no)
117     AC_MSG_WARN([Could not find mon, ignoring --with-mon.])
118     WANT_MON=no
119     fi
120     fi
121    
122     dnl We want pthreads.
123     HAVE_PTHREADS=yes
124     AC_CHECK_FUNCS(pthread_cancel)
125 nigel 1.3 AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
126     AC_CHECK_FUNCS(pthread_mutexattr_settype)
127 nigel 1.5 AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
128 nigel 1.1
129     dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
130     SEMSRC=
131     AC_CHECK_FUNCS(sem_init, , [
132     if test "x$HAVE_PTHREADS" = "xyes"; then
133     SEMSRC=posix_sem.cpp
134     fi
135     ])
136    
137 nigel 1.5 dnl We want to enable multiple window support if possible
138 nigel 1.1 if [[ "x$WANT_MWIN" = "xyes" ]]; then
139     WANT_MWIN=yes
140     DEFINES="$DEFINES -DENABLE_MULTIPLE"
141     fi
142    
143 nigel 1.5 dnl We use 64-bit file size support if possible.
144     AC_SYS_LARGEFILE
145    
146 nigel 1.1 dnl Checks for header files.
147     AC_HEADER_STDC
148 nigel 1.13 AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
149 nigel 1.12 AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
150 nigel 1.1
151     dnl Checks for typedefs, structures, and compiler characteristics.
152     AC_C_BIGENDIAN
153     AC_C_CONST
154     AC_C_INLINE
155     AC_CHECK_SIZEOF(short, 2)
156     AC_CHECK_SIZEOF(int, 4)
157     AC_CHECK_SIZEOF(long, 4)
158     AC_CHECK_SIZEOF(long long, 8)
159 nigel 1.5 AC_CHECK_SIZEOF(float, 4)
160     AC_CHECK_SIZEOF(double, 8)
161     AC_CHECK_SIZEOF(long double, 12)
162 nigel 1.1 AC_CHECK_SIZEOF(void *, 4)
163 nigel 1.10 AC_TYPE_OFF_T
164 nigel 1.13 dnl These two symbols are not defined in 10.1's autoconf:
165 nigel 1.8 dnl AC_CHECK_TYPE(loff_t, off_t)
166     dnl AC_CHECK_TYPE(caddr_t, [char *])
167     dnl We define loff_t as a typedef of off_t in sysdeps.h if we don't have LOFF_T
168 nigel 1.13 dnl OS X does have caddr_t, but the above check doesn't work, so we have to do:
169     AC_DEFINE(HAVE_CADDR_T, 1, [The type "caddr_t" does exist on MacOS X.])
170 nigel 1.1 AC_TYPE_SIZE_T
171     AC_TYPE_SIGNAL
172     AC_HEADER_TIME
173     AC_STRUCT_TM
174    
175 nigel 1.5 dnl Check whether sys/socket.h defines type socklen_t.
176     dnl (extracted from ac-archive/Miscellaneous)
177     AC_CACHE_CHECK([for socklen_t],
178     ac_cv_type_socklen_t, [
179     AC_TRY_COMPILE([
180     #include <sys/types.h>
181     #include <sys/socket.h>
182     ], [socklen_t len = 42; return 0;],
183     ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
184     dnl When cross-compiling, do not assume anything.
185     ac_cv_type_socklen_t="guessing no"
186     )
187     ])
188     if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
189     AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
190     fi
191    
192 nigel 1.1 dnl Checks for library functions.
193     AC_CHECK_FUNCS(strdup cfmakeraw)
194     AC_CHECK_FUNCS(clock_gettime timer_create)
195     AC_CHECK_FUNCS(sigaction signal)
196     AC_CHECK_FUNCS(mmap mprotect munmap)
197     AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
198    
199     dnl Darwin seems to define mach_task_self() instead of task_self().
200     AC_CHECK_FUNCS(mach_task_self task_self)
201    
202     dnl Select system-dependant source files.
203 nigel 1.13 DEFINES="$DEFINES -DBSD_COMP"
204     CXXFLAGS="$CXXFLAGS -fpermissive"
205 nigel 1.1 dnl Check for the CAM library
206 nigel 1.5 AC_CHECK_LIB(cam, cam_open_btl, HAVE_LIBCAM=yes, HAVE_LIBCAM=no)
207 nigel 1.1 if [[ "x$HAVE_LIBCAM" = "xno" ]]; then
208     AC_MSG_WARN([Cannot find libcam for SCSI management, disabling SCSI support.])
209 nigel 1.5 else
210     dnl Check for the sys kernel includes
211 nigel 1.1 AC_CHECK_HEADER(camlib.h)
212     if [[ "x$ac_cv_header_camlib_h" = "xno" ]]; then
213     dnl In this case I should fix this thing including a "patch"
214     dnl to access directly to the functions in the kernel :) --Orlando
215     AC_MSG_WARN([Cannot find includes for CAM library, disabling SCSI support.])
216     else
217     SCSISRC=FreeBSD/scsi_freebsd.cpp
218     LIBS="$LIBS -lcam"
219     DEFINES="$DEFINES -DCAM"
220     fi
221     fi
222    
223     dnl Use 68k CPU natively?
224     WANT_NATIVE_M68K=no
225    
226    
227     dnl Define a macro that translates a yesno-variable into a C macro definition
228     dnl to be put into the config.h file
229     dnl $1 -- the macro to define
230     dnl $2 -- the value to translate
231 nigel 1.5 dnl $3 -- template name
232 nigel 1.1 AC_DEFUN(AC_TRANSLATE_DEFINE, [
233     if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
234 nigel 1.5 AC_DEFINE($1, 1, $3)
235 nigel 1.1 fi
236     ])
237    
238     dnl Various checks if the system supports vm_allocate() and the like functions.
239     have_mach_vm=no
240     if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
241     "x$ac_cv_func_vm_protect" = "xyes" ]]; then
242     have_mach_vm=yes
243     fi
244 nigel 1.5 AC_TRANSLATE_DEFINE(HAVE_MACH_VM, "$have_mach_vm",
245     [Define if your system has a working vm_allocate()-based memory allocator.])
246 nigel 1.1
247     dnl Check that vm_allocate(), vm_protect() work
248     if [[ "x$have_mach_vm" = "xyes" ]]; then
249    
250 nigel 1.5 AC_CACHE_CHECK([whether vm_protect works],
251 nigel 1.1 ac_cv_vm_protect_works, [
252     AC_LANG_SAVE
253     AC_LANG_CPLUSPLUS
254     ac_cv_vm_protect_works=yes
255     dnl First the tests that should segfault
256     for test_def in NONE_READ NONE_WRITE READ_WRITE; do
257     AC_TRY_RUN([
258     #define CONFIGURE_TEST_VM_MAP
259     #define TEST_VM_PROT_$test_def
260 nigel 1.6 #include "../Unix/vm_alloc.cpp"
261 nigel 1.1 ], ac_cv_vm_protect_works=no, rm -f core,
262     dnl When cross-compiling, do not assume anything
263     ac_cv_vm_protect_works="guessing no"
264     )
265     done
266     AC_TRY_RUN([
267     #define CONFIGURE_TEST_VM_MAP
268     #define TEST_VM_PROT_RDWR_WRITE
269 nigel 1.6 #include "../Unix/vm_alloc.cpp"
270 nigel 1.1 ], , ac_cv_vm_protect_works=no,
271     dnl When cross-compiling, do not assume anything
272     ac_cv_vm_protect_works="guessing no"
273     )
274     AC_LANG_RESTORE
275     ]
276     )
277    
278     dnl Remove support for vm_allocate() if vm_protect() does not work
279     if [[ "x$have_mach_vm" = "xyes" ]]; then
280     case $ac_cv_vm_protect_works in
281     *yes) have_mach_vm=yes;;
282     *no) have_mach_vm=no;;
283     esac
284     fi
285 nigel 1.5 AC_TRANSLATE_DEFINE(HAVE_MACH_VM, "$have_mach_vm",
286     [Define if your system has a working vm_allocate()-based memory allocator.])
287 nigel 1.1
288     fi dnl HAVE_MACH_VM
289    
290     dnl Various checks if the system supports mmap() and the like functions.
291     dnl ... and Mach memory allocators are not supported
292     have_mmap_vm=no
293     if [[ "x$ac_cv_func_mmap" = "xyes" -a "x$ac_cv_func_munmap" = "xyes" -a \
294     "x$ac_cv_func_mprotect" = "xyes" ]]; then
295     if [[ "x$have_mach_vm" = "xno" ]]; then
296     have_mmap_vm=yes
297     fi
298     fi
299 nigel 1.5 AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, "$have_mmap_vm",
300     [Define if your system has a working mmap()-based memory allocator.])
301 nigel 1.1
302     dnl Check that mmap() and associated functions work.
303     if [[ "x$have_mmap_vm" = "xyes" ]]; then
304    
305     dnl Check if we have a working anonymous mmap()
306 nigel 1.5 AC_CACHE_CHECK([whether mmap supports MAP_ANON],
307 nigel 1.1 ac_cv_mmap_anon, [
308     AC_LANG_SAVE
309     AC_LANG_CPLUSPLUS
310     AC_TRY_RUN([
311     #define HAVE_MMAP_ANON
312     #define CONFIGURE_TEST_VM_MAP
313     #define TEST_VM_MMAP_ANON
314 nigel 1.6 #include "../Unix/vm_alloc.cpp"
315 nigel 1.1 ], ac_cv_mmap_anon=yes, ac_cv_mmap_anon=no,
316     dnl When cross-compiling, do not assume anything.
317     ac_cv_mmap_anon="guessing no"
318     )
319     AC_LANG_RESTORE
320     ]
321     )
322 nigel 1.5 AC_TRANSLATE_DEFINE(HAVE_MMAP_ANON, "$ac_cv_mmap_anon",
323     [Define if <sys/mman.h> defines MAP_ANON and mmap()'ing with MAP_ANON works.])
324 nigel 1.1
325 nigel 1.5 AC_CACHE_CHECK([whether mmap supports MAP_ANONYMOUS],
326 nigel 1.1 ac_cv_mmap_anonymous, [
327     AC_LANG_SAVE
328     AC_LANG_CPLUSPLUS
329     AC_TRY_RUN([
330     #define HAVE_MMAP_ANONYMOUS
331     #define CONFIGURE_TEST_VM_MAP
332     #define TEST_VM_MMAP_ANON
333 nigel 1.6 #include "../Unix/vm_alloc.cpp"
334 nigel 1.1 ], ac_cv_mmap_anonymous=yes, ac_cv_mmap_anonymous=no,
335     dnl When cross-compiling, do not assume anything.
336     ac_cv_mmap_anonymous="guessing no"
337     )
338     AC_LANG_RESTORE
339     ]
340     )
341 nigel 1.5 AC_TRANSLATE_DEFINE(HAVE_MMAP_ANONYMOUS, "$ac_cv_mmap_anonymous",
342     [Define if <sys/mman.h> defines MAP_ANONYMOUS and mmap()'ing with MAP_ANONYMOUS works.])
343 nigel 1.1
344 nigel 1.5 AC_CACHE_CHECK([whether mprotect works],
345 nigel 1.1 ac_cv_mprotect_works, [
346     AC_LANG_SAVE
347     AC_LANG_CPLUSPLUS
348     ac_cv_mprotect_works=yes
349     dnl First the tests that should segfault
350     for test_def in NONE_READ NONE_WRITE READ_WRITE; do
351     AC_TRY_RUN([
352     #define CONFIGURE_TEST_VM_MAP
353     #define TEST_VM_PROT_$test_def
354 nigel 1.6 #include "../Unix/vm_alloc.cpp"
355 nigel 1.1 ], ac_cv_mprotect_works=no, rm -f core,
356     dnl When cross-compiling, do not assume anything
357     ac_cv_mprotect_works="guessing no"
358     )
359     done
360     AC_TRY_RUN([
361     #define CONFIGURE_TEST_VM_MAP
362     #define TEST_VM_PROT_RDWR_WRITE
363 nigel 1.6 #include "../Unix/vm_alloc.cpp"
364 nigel 1.1 ], , ac_cv_mprotect_works=no,
365     dnl When cross-compiling, do not assume anything
366     ac_cv_mprotect_works="guessing no"
367     )
368     AC_LANG_RESTORE
369     ]
370     )
371    
372     dnl Remove support for mmap() if mprotect() does not work
373     if [[ "x$have_mmap_vm" = "xyes" ]]; then
374     case $ac_cv_mprotect_works in
375     *yes) have_mmap_vm=yes;;
376     *no) have_mmap_vm=no;;
377     esac
378     fi
379 nigel 1.5 AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_mmap_vm,
380     [Define if your system has a working mmap()-based memory allocator.])
381 nigel 1.1
382     fi dnl HAVE_MMAP_VM
383    
384 nigel 1.12 dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
385     AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000],
386     ac_cv_pagezero_hack, [
387     ac_cv_pagezero_hack=no
388     if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then
389     ac_cv_pagezero_hack=yes
390     dnl might as well skip the test for mmap-able low memory
391     ac_cv_can_map_lm=no
392     fi
393     ])
394     AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
395     [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
396    
397 nigel 1.1 dnl Check if we can mmap 0x2000 bytes from 0x0000
398 nigel 1.5 AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
399 nigel 1.1 ac_cv_can_map_lm, [
400     AC_LANG_SAVE
401     AC_LANG_CPLUSPLUS
402     AC_TRY_RUN([
403 nigel 1.6 #include "../Unix/vm_alloc.cpp"
404 nigel 1.1 int main(void) { /* returns 0 if we could map the lowmem globals */
405 nigel 1.11 volatile char * lm = 0;
406 nigel 1.1 if (vm_init() < 0) exit(1);
407 nigel 1.12 if (vm_acquire_fixed(0, 0x2000) < 0) exit(1);
408 nigel 1.1 lm[0] = 'z';
409     if (vm_release((char *)lm, 0x2000) < 0) exit(1);
410     vm_exit(); exit(0);
411     }
412     ], ac_cv_can_map_lm=yes, ac_cv_can_map_lm=no,
413     dnl When cross-compiling, do not assume anything.
414     ac_cv_can_map_lm="guessing no"
415     )
416     AC_LANG_RESTORE
417     ]
418     )
419    
420     dnl Check signal handlers need to be reinstalled
421 nigel 1.5 AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
422 nigel 1.1 ac_cv_signal_need_reinstall, [
423     AC_LANG_SAVE
424     AC_LANG_CPLUSPLUS
425     AC_TRY_RUN([
426     #include <stdlib.h>
427     #ifdef HAVE_UNISTD_H
428     #include <unistd.h>
429     #endif
430     #include <signal.h>
431     static int handled_signal = 0;
432     RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
433     int main(void) { /* returns 0 if signals need not to be reinstalled */
434     signal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
435     exit(handled_signal == 2);
436     }
437     ], ac_cv_signal_need_reinstall=yes, ac_cv_signal_need_reinstall=no,
438     dnl When cross-compiling, do not assume anything.
439     ac_cv_signal_need_reinstall="guessing yes"
440     )
441     AC_LANG_RESTORE
442     ]
443     )
444 nigel 1.5 AC_TRANSLATE_DEFINE(SIGNAL_NEED_REINSTALL, "$ac_cv_signal_need_reinstall",
445     [Define if your system requires signals to be reinstalled.])
446 nigel 1.1
447     dnl Check if sigaction handlers need to be reinstalled
448 nigel 1.5 AC_CACHE_CHECK([whether sigaction handlers need to be reinstalled],
449 nigel 1.1 ac_cv_sigaction_need_reinstall, [
450     AC_LANG_SAVE
451     AC_LANG_CPLUSPLUS
452     AC_TRY_RUN([
453     #include <stdlib.h>
454     #ifdef HAVE_UNISTD_H
455     #include <unistd.h>
456     #endif
457     #include <signal.h>
458     static int handled_signal = 0;
459     RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
460     typedef RETSIGTYPE (*signal_handler)(int);
461     static signal_handler mysignal(int sig, signal_handler handler) {
462     struct sigaction old_sa;
463     struct sigaction new_sa;
464     new_sa.sa_handler = handler;
465     return ((sigaction(sig,&new_sa,&old_sa) < 0) ? SIG_IGN : old_sa.sa_handler);
466     }
467     int main(void) { /* returns 0 if signals need not to be reinstalled */
468     mysignal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
469     exit(handled_signal == 2);
470     }
471     ], ac_cv_sigaction_need_reinstall=yes, ac_cv_sigaction_need_reinstall=no,
472     dnl When cross-compiling, do not assume anything.
473     ac_cv_sigaction_need_reinstall="guessing yes"
474     )
475     AC_LANG_RESTORE
476     ]
477     )
478 nigel 1.5 AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
479     [Define if your system requires sigactions to be reinstalled.])
480 nigel 1.1
481 nigel 1.12 dnl Check if Mach exceptions supported.
482     AC_CACHE_CHECK([whether your system supports Mach exceptions],
483     ac_cv_have_mach_exceptions, [
484 nigel 1.1 AC_LANG_SAVE
485     AC_LANG_CPLUSPLUS
486     AC_TRY_RUN([
487 nigel 1.12 #define HAVE_MACH_EXCEPTIONS 1
488 nigel 1.1 #define CONFIGURE_TEST_SIGSEGV_RECOVERY
489 nigel 1.13 #include "../Unix/vm_alloc.cpp"
490     #include "../Unix/sigsegv.cpp"
491 nigel 1.12 ], [
492     sigsegv_recovery=mach
493     ac_cv_have_mach_exceptions=yes
494     ],
495     ac_cv_have_mach_exceptions=no,
496 nigel 1.1 dnl When cross-compiling, do not assume anything.
497 nigel 1.12 ac_cv_have_mach_exceptions=no
498 nigel 1.1 )
499     AC_LANG_RESTORE
500     ]
501     )
502 nigel 1.12 AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
503     [Define if your system supports Mach exceptions.])
504    
505     dnl Otherwise, check if extended signals are supported.
506     if [[ -z "$sigsegv_recovery" ]]; then
507     AC_CACHE_CHECK([whether your system supports extended signal handlers],
508     ac_cv_have_extended_signals, [
509     AC_LANG_SAVE
510     AC_LANG_CPLUSPLUS
511     AC_TRY_RUN([
512     #define HAVE_SIGINFO_T 1
513     #define CONFIGURE_TEST_SIGSEGV_RECOVERY
514     #include "../Unix/vm_alloc.cpp"
515     #include "../Unix/sigsegv.cpp"
516     ], [
517     sigsegv_recovery=siginfo
518     ac_cv_have_extended_signals=yes
519     ],
520     ac_cv_have_extended_signals=no,
521     dnl When cross-compiling, do not assume anything.
522     ac_cv_have_extended_signals=no
523     )
524     AC_LANG_RESTORE
525     ]
526     )
527     AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
528     [Define if your system support extended signals.])
529     fi
530 nigel 1.5
531 nigel 1.1 dnl Otherwise, check for subterfuges.
532 nigel 1.13 if [[ -z "$sigsegv_recovery" ]]; then
533     AC_CACHE_CHECK([whether we then have a subterfuge for your system],
534     ac_cv_have_sigcontext_hack, [
535     AC_LANG_SAVE
536     AC_LANG_CPLUSPLUS
537     AC_TRY_RUN([
538     #define HAVE_SIGCONTEXT_SUBTERFUGE 1
539     #define CONFIGURE_TEST_SIGSEGV_RECOVERY
540     #include "../Unix/vm_alloc.cpp"
541     #include "../Unix/sigsegv.cpp"
542     ], [
543     sigsegv_recovery=sigcontext
544     ac_cv_have_sigcontext_hack=yes
545     ],
546     ac_cv_have_sigcontext_hack=no,
547     dnl When cross-compiling, do not assume anything.
548     ac_cv_have_sigcontext_hack=no
549     )
550     AC_LANG_RESTORE
551     ])
552     AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack",
553     [Define if we know a hack to replace siginfo_t->si_addr member.])
554     fi
555 nigel 1.1
556 nigel 1.5 dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler)
557     AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler],
558     ac_cv_have_skip_instruction, [
559     AC_LANG_SAVE
560     AC_LANG_CPLUSPLUS
561     AC_TRY_RUN([
562     #define HAVE_SIGSEGV_SKIP_INSTRUCTION 1
563     #define CONFIGURE_TEST_SIGSEGV_RECOVERY
564 nigel 1.6 #include "../Unix/vm_alloc.cpp"
565     #include "../Unix/sigsegv.cpp"
566 nigel 1.5 ], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no,
567     dnl When cross-compiling, do not assume anything.
568     ac_cv_have_skip_instruction=no
569     )
570     AC_LANG_RESTORE
571     ]
572     )
573     AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction",
574     [Define if we can ignore the fault (instruction skipping in SIGSEGV handler).])
575    
576 nigel 1.1 dnl Can we do Video on SEGV Signals ?
577     CAN_VOSF=no
578 nigel 1.12 if [[ -n "$sigsegv_recovery" ]]; then
579 nigel 1.1 CAN_VOSF=yes
580     fi
581    
582 nigel 1.12 dnl A dummy program that returns always true
583     BLESS=/bin/true
584    
585 nigel 1.1 dnl Determine the addressing mode to use
586     if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
587     ADDRESSING_MODE="real"
588     else
589     ADDRESSING_MODE=""
590     AC_MSG_CHECKING([for the addressing mode to use])
591     for am in $ADDRESSING_TEST_ORDER; do
592     case $am in
593     real)
594     dnl Requires ability to mmap() Low Memory globals
595 nigel 1.12 if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then
596 nigel 1.1 continue
597     fi
598 nigel 1.12 dnl Requires VOSF screen updates
599 nigel 1.1 if [[ "x$CAN_VOSF" = "xno" ]]; then
600     continue
601     fi
602     dnl Real addressing will probably work.
603     ADDRESSING_MODE="real"
604     WANT_VOSF=yes dnl we can use VOSF and we need it actually
605     DEFINES="$DEFINES -DREAL_ADDRESSING"
606 nigel 1.13 AC_DEFINE(REAL_ADDRESSING, 1, [Emulated memory is memory mapped to actual address.])
607 nigel 1.12 if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
608     BLESS=Darwin/lowmem
609     LDFLAGS="$LDFLAGS -pagezero_size 0x2000"
610     fi
611 nigel 1.1 break
612     ;;
613     direct)
614     dnl Requires VOSF screen updates
615     if [[ "x$CAN_VOSF" = "xyes" ]]; then
616     ADDRESSING_MODE="direct"
617     WANT_VOSF=yes dnl we can use VOSF and we need it actually
618     DEFINES="$DEFINES -DDIRECT_ADDRESSING"
619 nigel 1.13 AC_DEFINE(DIRECT_ADDRESSING, 1, [Emulated memory is an offset from actual address.])
620 nigel 1.1 break
621     fi
622     ;;
623     banks)
624     dnl Default addressing mode
625     ADDRESSING_MODE="memory banks"
626     break
627     ;;
628     *)
629     AC_MSG_ERROR([Internal configure.in script error for $am addressing mode])
630     esac
631     done
632     AC_MSG_RESULT($ADDRESSING_MODE)
633     if [[ "x$ADDRESSING_MODE" = "x" ]]; then
634     AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
635     ADDRESSING_MODE="memory banks"
636     fi
637     fi
638    
639 nigel 1.5 dnl Banked Memory Addressing mode is not supported by the JIT compiler
640     if [[ "x$WANT_JIT" = "xyes" -a "x$ADDRESSING_MODE" = "xmemory banks" ]]; then
641     AC_MSG_ERROR([Sorry, the JIT Compiler requires Direct Addressing, at least])
642     fi
643    
644 nigel 1.1 dnl Enable VOSF screen updates with this feature is requested and feasible
645     if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then
646 nigel 1.5 AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.])
647 nigel 1.1 else
648     WANT_VOSF=no
649     fi
650    
651     dnl Check for GAS.
652     HAVE_GAS=no
653     AC_MSG_CHECKING(for GAS .p2align feature)
654     cat >conftest.S << EOF
655     .text
656     .p2align 5
657     EOF
658     if $CC conftest.S -c -o conftest.o >/dev/null 2>&1 ; then HAVE_GAS=yes; fi
659     AC_MSG_RESULT($HAVE_GAS)
660    
661     dnl Check for GCC 2.7 or higher.
662     HAVE_GCC27=no
663     AC_MSG_CHECKING(for GCC 2.7 or higher)
664 nigel 1.11 AC_EGREP_CPP(xyes,
665 nigel 1.1 [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
666 nigel 1.11 xyes
667 nigel 1.1 #endif
668     ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
669    
670     dnl Check for GCC 3.0 or higher.
671     HAVE_GCC30=no
672     AC_MSG_CHECKING(for GCC 3.0 or higher)
673 nigel 1.11 AC_EGREP_CPP(xyes,
674 nigel 1.1 [#if __GNUC__ >= 3
675 nigel 1.11 xyes
676 nigel 1.1 #endif
677     ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
678    
679     dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
680 nigel 1.3 dnl Also set "-fno-exceptions" for C++ because exception handling requires
681     dnl the frame pointer.
682 nigel 1.1 if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
683     CFLAGS="$CFLAGS -fomit-frame-pointer"
684 nigel 1.3 CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -fno-exceptions"
685 nigel 1.1 fi
686    
687     dnl (gb) Do not merge constants since it breaks fpu/fpu_x86.cpp.
688     dnl As of 2001/08/02, this affects the following compilers:
689     dnl Official: probably gcc-3.1 (mainline CVS)
690     dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
691     dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
692     if [[ "x$HAVE_GCC27" = "xyes" ]]; then
693     SAVED_CXXFLAGS="$CXXFLAGS"
694     CXXFLAGS="$CXXFLAGS -fno-merge-constants"
695     AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
696     AC_LANG_SAVE
697     AC_LANG_CPLUSPLUS
698     AC_TRY_COMPILE([],[],[ac_cv_gcc_constants_merging=yes],[ac_cv_gcc_constants_merging=no])
699     AC_LANG_RESTORE
700     ])
701     if [[ "x$ac_cv_gcc_constants_merging" != "xyes" ]]; then
702     CXXFLAGS="$SAVED_CXXFLAGS"
703     fi
704     fi
705    
706     dnl Select appropriate CPU source and REGPARAM define.
707     ASM_OPTIMIZATIONS=none
708     CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
709 nigel 1.5
710     dnl (gb) JITSRCS will be emptied later if the JIT is not available
711     dnl Other platforms should define their own set of noflags file variants
712     CAN_JIT=no
713     JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp"
714    
715 nigel 1.10 if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
716 nigel 1.1 dnl i386 CPU
717 nigel 1.5 DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\""
718 nigel 1.1 if [[ "x$HAVE_GAS" = "xyes" ]]; then
719     ASM_OPTIMIZATIONS=i386
720 nigel 1.5 DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE"
721 nigel 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"
722     CAN_JIT=yes
723     fi
724     elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then
725     dnl x86-64 CPU
726     DEFINES="$DEFINES -DUNALIGNED_PROFITABLE"
727     if [[ "x$HAVE_GAS" = "xyes" ]]; then
728     ASM_OPTIMIZATIONS="x86-64"
729     DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
730 nigel 1.1 fi
731     elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
732     dnl SPARC CPU
733     case "$target_os" in
734     solaris*)
735     AC_MSG_CHECKING(SPARC CPU architecture)
736     SPARC_TYPE=`Solaris/which_sparc`
737     AC_MSG_RESULT($SPARC_TYPE)
738     case "$SPARC_TYPE" in
739     SPARC_V8)
740     ASM_OPTIMIZATIONS="SPARC V8 architecture"
741     DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
742     CFLAGS="$CFLAGS -Wa,-Av8"
743     CXXFLAGS="$CXXFLAGS -Wa,-Av8"
744     ;;
745     SPARC_V9)
746     ASM_OPTIMIZATIONS="SPARC V9 architecture"
747     DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
748     CFLAGS="$CFLAGS -Wa,-Av9"
749     CXXFLAGS="$CXXFLAGS -Wa,-Av9"
750     ;;
751     esac
752     ;;
753     esac
754     elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
755     dnl Native m68k, no emulation
756     CPUINCLUDES="-I../native_cpu"
757     CPUSRCS="asm_support.s"
758     fi
759    
760 nigel 1.5 dnl Enable JIT compiler, if possible.
761     if [[ "x$WANT_JIT" = "xyes" -a "x$CAN_JIT" ]]; then
762     JITSRCS="$JITSRCS ../uae_cpu/compiler/compemu_support.cpp ../uae_cpu/compiler/compemu_fpp.cpp compstbl.o cpustbl_nf.o"
763     DEFINES="$DEFINES -DUSE_JIT -DUSE_JIT_FPU"
764    
765     if [[ "x$WANT_JIT_DEBUG" = "xyes" ]]; then
766     if [[ "x$WANT_MON" = "xyes" ]]; then
767     DEFINES="$DEFINES -DJIT_DEBUG=1"
768     else
769     AC_MSG_WARN([cxmon not found, ignoring --enable-jit-debug])
770     WANT_JIT_DEBUG=no
771     fi
772     fi
773    
774     dnl IEEE core is the only FPU emulator to use with the JIT compiler
775     case $FPE_CORE_TEST_ORDER in
776     ieee*) ;;
777     *) AC_MSG_WARN([Forcing use of the IEEE FPU core, as the JIT compiler supports only this one.]) ;;
778     esac
779     FPE_CORE_TEST_ORDER="ieee"
780     else
781     WANT_JIT=no
782     WANT_JIT_DEBUG=no
783     JITSRCS=""
784     fi
785    
786     dnl Utility macro used by next two tests.
787     dnl AC_EXAMINE_OBJECT(C source code,
788     dnl commands examining object file,
789     dnl [commands to run if compile failed]):
790     dnl
791     dnl Compile the source code to an object file; then convert it into a
792     dnl printable representation. All unprintable characters and
793     dnl asterisks (*) are replaced by dots (.). All white space is
794     dnl deleted. Newlines (ASCII 0x10) in the input are preserved in the
795     dnl output, but runs of newlines are compressed to a single newline.
796     dnl Finally, line breaks are forcibly inserted so that no line is
797     dnl longer than 80 columns and the file ends with a newline. The
798     dnl result of all this processing is in the file conftest.dmp, which
799     dnl may be examined by the commands in the second argument.
800     dnl
801     AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
802     [AC_LANG_SAVE
803     AC_LANG_C
804     dnl Next bit cribbed from AC_TRY_COMPILE.
805     cat > conftest.$ac_ext <<EOF
806     [#line __oline__ "configure"
807     #include "confdefs.h"
808     $1
809     ]EOF
810     if AC_TRY_EVAL(ac_compile); then
811     od -c conftest.o |
812     sed ['s/^[0-7]*[ ]*/ /
813     s/\*/./g
814     s/ \\n/*/g
815     s/ [0-9][0-9][0-9]/./g
816     s/ \\[^ ]/./g'] |
817     tr -d '
818     ' | tr -s '*' '
819     ' | fold | sed '$a\
820     ' > conftest.dmp
821     $2
822     ifelse($3, , , else
823     $3
824     )dnl
825     fi
826     rm -rf conftest*
827     AC_LANG_RESTORE])
828    
829     dnl Floating point format probe.
830     dnl The basic concept is the same as the above: grep the object
831     dnl file for an interesting string. We have to watch out for
832     dnl rounding changing the values in the object, however; this is
833     dnl handled by ignoring the least significant byte of the float.
834     dnl
835     dnl Does not know about VAX G-float or C4x idiosyncratic format.
836     dnl It does know about PDP-10 idiosyncratic format, but this is
837     dnl not presently supported by GCC. S/390 "binary floating point"
838     dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
839     dnl as ASCII?)
840     dnl
841     AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
842     [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
843     [gcc_AC_EXAMINE_OBJECT(
844     [/* This will not work unless sizeof(double) == 8. */
845     extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
846    
847     /* This structure must have no internal padding. */
848     struct possibility {
849     char prefix[8];
850     double candidate;
851     char postfix[8];
852     };
853    
854     #define C(cand) { "\nformat:", cand, ":tamrof\n" }
855     struct possibility table [] =
856     {
857     C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
858     C( 3.53802595280598432000e+18), /* D__float - VAX */
859     C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
860     C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
861     C(-5.22995989424860458374e+10) /* IBMHEXFP - s/390 format, EBCDIC */
862     };],
863     [if grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
864     ac_cv_c_float_format='IEEE (big-endian)'
865     elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
866     ac_cv_c_float_format='IEEE (big-endian)'
867     elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
868     ac_cv_c_float_format='IEEE (little-endian)'
869     elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
870     ac_cv_c_float_format='IEEE (little-endian)'
871     elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
872     ac_cv_c_float_format='VAX D-float'
873     elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
874     ac_cv_c_float_format='PDP-10'
875     elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
876     ac_cv_c_float_format='IBM 370 hex'
877 nigel 1.1 else
878 nigel 1.5 AC_MSG_ERROR(Unknown floating point format)
879     fi],
880     [AC_MSG_ERROR(compile failed)])
881     ])
882     # IEEE is the default format. If the float endianness isn't the same
883     # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
884     # (which is a tristate: yes, no, default). This is only an issue with
885     # IEEE; the other formats are only supported by a few machines each,
886     # all with the same endianness.
887     format=IEEE_FLOAT_FORMAT
888     fbigend=
889     case $ac_cv_c_float_format in
890     'IEEE (big-endian)' )
891     if test $ac_cv_c_bigendian = no; then
892     fbigend=1
893     fi
894     ;;
895     'IEEE (little-endian)' )
896     if test $ac_cv_c_bigendian = yes; then
897     fbigend=0
898     fi
899     ;;
900     'VAX D-float' )
901     format=VAX_FLOAT_FORMAT
902     ;;
903     'PDP-10' )
904     format=PDP10_FLOAT_FORMAT
905     ;;
906     'IBM 370 hex' )
907     format=IBM_FLOAT_FORMAT
908     ;;
909     esac
910     AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
911     [Define to the floating point format of the host machine.])
912     if test -n "$fbigend"; then
913     AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
914     [Define to 1 if the host machine stores floating point numbers in
915     memory with the word containing the sign bit at the lowest address,
916     or to 0 if it does it the other way around.
917    
918     This macro should not be defined if the ordering is the same as for
919     multi-word integers.])
920 nigel 1.1 fi
921 nigel 1.5 ])
922 nigel 1.1
923 nigel 1.5 dnl Select appropriate FPU source.
924     gcc_AC_C_FLOAT_FORMAT
925     AC_CHECK_HEADERS(ieee754.h ieeefp.h floatingpoint.h nan.h)
926    
927     for fpe in $FPE_CORE_TEST_ORDER; do
928     case $fpe in
929     ieee)
930     case $ac_cv_c_float_format in
931     IEEE*)
932     FPE_CORE="IEEE fpu core"
933     DEFINES="$DEFINES -DFPU_IEEE"
934 nigel 1.13 AC_DEFINE(FPU_IEEE, 1, [Floating Point Core emulation method is IEEE.])
935 nigel 1.5 FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp"
936     dnl Math functions not mandated by C99 standard
937     AC_CHECK_FUNCS(isnanl isinfl)
938     dnl Math functions required by C99 standard, but probably not
939     dnl implemented everywhere. In that case, we fall back to the
940     dnl regular variant for doubles.
941     AC_CHECK_FUNCS(logl log10l expl powl fabsl sqrtl)
942     AC_CHECK_FUNCS(sinl cosl tanl sinhl coshl tanhl)
943     AC_CHECK_FUNCS(asinl acosl atanl asinhl acoshl atanhl)
944     AC_CHECK_FUNCS(floorl ceill)
945     break
946     ;;
947     esac
948     ;;
949     x86)
950     if [[ ":$HAVE_GCC27:$HAVE_I386:$HAVE_GAS:" = ":yes:yes:yes:" ]]; then
951     FPE_CORE="i387 fpu core"
952     DEFINES="$DEFINES -DFPU_X86"
953     FPUSRCS="../uae_cpu/fpu/fpu_x86.cpp"
954     break
955     fi
956     ;;
957     uae)
958     FPE_CORE="uae fpu core"
959     DEFINES="$DEFINES -DFPU_UAE"
960 nigel 1.13 AC_DEFINE(FPU_UAE, 1, [Floating Point Core emulation is standard UAE.])
961 nigel 1.5 FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp"
962     break
963     ;;
964     *)
965     AC_MSG_ERROR([Internal configure.in script error for $fpe fpu core])
966     ;;
967     esac
968     done
969     if [[ "x$FPE_CORE" = "x" ]]; then
970     AC_MSG_ERROR([Sorry, no suitable FPU core found in $FPE_CORE_TEST_ORDER])
971 nigel 1.1 fi
972    
973     dnl Check for certain math functions
974     AC_CHECK_FUNCS(atanh)
975 nigel 1.5 AC_CHECK_FUNCS(isnan isinf finite isnormal signbit)
976 nigel 1.1
977     dnl UAE CPU sources for all non-m68k-native architectures.
978     if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then
979     CPUINCLUDES="-I../uae_cpu"
980 nigel 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"
981 nigel 1.1 fi
982    
983     dnl Remove the "-g" option if set for GCC.
984     if [[ "x$HAVE_GCC27" = "xyes" ]]; then
985     CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'`
986     CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'`
987     fi
988    
989 nigel 1.10 dnl Or if we have -IPA (MIPSPro compilers)
990     if [[ "x$HAVE_IPA" = "xyes" ]]; then
991     CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
992     CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
993 nigel 1.1 CXXFLAGS="-LANG:std $CXXFLAGS"
994 nigel 1.10 LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
995 nigel 1.1 fi
996    
997     dnl Generate Makefile.
998     AC_SUBST(DEFINES)
999     AC_SUBST(SYSSRCS)
1000     AC_SUBST(CPUINCLUDES)
1001     AC_SUBST(CPUSRCS)
1002 nigel 1.12 AC_SUBST(BLESS)
1003 nigel 1.11 dnl autoconf on 10.1 doesn't understand these
1004     dnl AC_CONFIG_FILES([Makefile])
1005     dnl AC_OUTPUT
1006 nigel 1.1 AC_OUTPUT(Makefile)
1007    
1008     dnl Print summary.
1009     echo
1010     echo Basilisk II configuration summary:
1011     echo
1012 nigel 1.8 echo Multiple emulator windows .............. : $ENABLE_MULTIPLE
1013 nigel 1.5 echo Enable video on SEGV signals ........... : $WANT_VOSF
1014     echo mon debugger support ................... : $WANT_MON
1015     echo Use JIT compiler ....................... : $WANT_JIT
1016     echo JIT debug mode ......................... : $WANT_JIT_DEBUG
1017     echo Floating-Point emulation core .......... : $FPE_CORE
1018     echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
1019     echo Addressing mode ........................ : $ADDRESSING_MODE
1020 nigel 1.12 echo Bad memory access recovery type ........ : $sigsegv_recovery
1021 nigel 1.1 echo
1022 nigel 1.2 echo "Configuration done. Now type \"make\" (or \"make ide\")."