ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/configure.in
(Generate patch)

Comparing BasiliskII/src/Unix/configure.in (file contents):
Revision 1.24 by cebix, 2000-09-25T17:54:01Z vs.
Revision 1.62 by gbeauche, 2002-09-13T12:51:24Z

# Line 1 | Line 1
1   dnl Process this file with autoconf to produce a configure script.
2 < dnl Written in 1999 by Christian Bauer et al.
2 > dnl Written in 2002 by Christian Bauer et al.
3  
4   AC_INIT(main_unix.cpp)
5   AC_PREREQ(2.12)
# Line 9 | Line 9 | dnl Options.
9   AC_ARG_ENABLE(xf86-dga,      [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
10   AC_ARG_ENABLE(xf86-vidmode,  [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
11   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])
12 < AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=no])
13 < AC_ARG_ENABLE(16bit-vidmode, [  --enable-16bit-vidmode  enable 16-bit video if possible [default=yes]], [WANT_16BIT_VIDMODE=$enableval], [WANT_16BIT_VIDMODE=yes])
12 > AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
13 >
14 > dnl FPU emulation core.
15 > AC_ARG_ENABLE(fpe,
16 > [  --enable-fpe=which      specify which fpu emulator to use [default=opt]],
17 > [ case "$enableval" in
18 >    dnl default is fpu_x86.cpp if i386 architecture, fpu_uae.cpp otherwise
19 >    default)    FPE_CORE="default";;
20 >    ieee)               FPE_CORE="ieee";;
21 >        uae)            FPE_CORE="uae";;
22 >        *)                      AC_MSG_ERROR([--enable-fpe takes only one of the following values: default, uae, ieee]);;
23 >  esac
24 > ],
25 > [ FPE_CORE="default"
26 > ])
27 >
28 > dnl Addressing modes.
29   AC_ARG_ENABLE(addressing,
30 < [  --enable-addressing=mode specify the addressing mode to use [default=fastest]],
30 > [  --enable-addressing=AM  specify the addressing mode to use [default=fastest]],
31   [ case "$enableval" in
32      real)       ADDRESSING_TEST_ORDER="real";;
33      direct)     ADDRESSING_TEST_ORDER="direct";;
34      banks)      ADDRESSING_TEST_ORDER="banks";;
35 < dnl fastest)    ADDRESSING_TEST_ORDER="real direct banks";; gb-- will enable later...
36 <    fastest)    ADDRESSING_TEST_ORDER="direct banks";;
22 <    *)          AC_MSG_ERROR([--enable-mem-addressing takes only one of the following values: fastest, real, direct, banks]);;
35 >    fastest)ADDRESSING_TEST_ORDER="direct banks";;
36 >    *)          AC_MSG_ERROR([--enable-addressing takes only one of the following values: fastest, real, direct, banks]);;
37    esac
38   ],
25 dnl [ ADDRESSING_TEST_ORDER="real direct banks" gb-- will probably reactivate later
39   [ ADDRESSING_TEST_ORDER="direct banks"
40   ])
41 +
42 + dnl External packages.
43   AC_ARG_WITH(esd,             [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
44   AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
45   AC_ARG_WITH(mon,             [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
# Line 39 | Line 54 | case "$target_os" in
54    netbsd*)      OS_TYPE=netbsd;;
55    freebsd*)     OS_TYPE=freebsd;;
56    solaris*)     OS_TYPE=solaris;;
57 <  *)            OS_TYPE=`echo $target_os | sed -e 's/-/_/'`;;
57 >  darwin*)      OS_TYPE=darwin;;
58 >  *)            OS_TYPE=`echo $target_os | sed -e 's/-/_/g' | sed -e 's/\./_/g'`;;
59   esac
60   DEFINES="$DEFINES -DOS_$OS_TYPE"
61  
# Line 47 | Line 63 | dnl Target CPU type.
63   HAVE_I386=no
64   HAVE_M68K=no
65   HAVE_SPARC=no
66 + HAVE_POWERPC=no
67   case "$target_cpu" in
68    i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;;
69    m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;;
70    sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;;
71 <  *) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/'`;;
71 >  powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;;
72 >  *) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/g'`;;
73   esac
74   DEFINES="$DEFINES -DCPU_$CPU_TYPE"
75  
# Line 71 | Line 89 | if [[ "x$WANT_MON" = "xyes" ]]; then
89    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
90      AC_MSG_RESULT(yes)
91      AC_DEFINE(ENABLE_MON)
92 <    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_8080.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c"
92 >    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"
93      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
94 +    AC_CHECK_LIB(ncurses, tgetent, ,
95 +      AC_CHECK_LIB(termcap, tgetent, ,
96 +        AC_CHECK_LIB(termlib, tgetent, ,
97 +          AC_CHECK_LIB(terminfo, tgetent, ,
98 +            AC_CHECK_LIB(Hcurses, tgetent, ,
99 +              AC_CHECK_LIB(curses, tgetent))))))
100      AC_CHECK_LIB(readline, readline)
77    AC_CHECK_LIB(termcap, tputs)
101      AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
102    else
103      AC_MSG_RESULT(no)
# Line 85 | Line 108 | fi
108  
109   dnl Checks for libraries.
110   AC_CHECK_LIB(posix4, sem_init)
111 + AC_CHECK_LIB(rt, timer_create)
112  
113   dnl We need X11.
114   AC_PATH_XTRA
# Line 108 | Line 132 | if [[ "x$HAVE_PTHREADS" = "xyes" ]]; the
132    AC_DEFINE(HAVE_PTHREADS)
133   fi
134   AC_CHECK_FUNCS(pthread_cancel)
135 + AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
136 + AC_CHECK_FUNCS(pthread_mutexattr_settype)
137  
138   dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
139   SEMSRC=
140   AC_CHECK_FUNCS(sem_init, , [
141 <  if [ "x$HAVE_PTHREADS" = "xyes" ]; then
141 >  if test "x$HAVE_PTHREADS" = "xyes"; then
142      SEMSRC=posix_sem.cpp
143    fi
144   ])
# Line 151 | Line 177 | UISRCS=../dummy/prefs_editor_dummy.cpp
177   if [[ "x$WANT_GTK" = "xyes" ]]; then
178    AM_PATH_GTK(1.2.0, [
179      AC_DEFINE(ENABLE_GTK)
154    CFLAGS="$CFLAGS $GTK_CFLAGS"
180      CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
181      LIBS="$LIBS $GTK_LIBS"
182      UISRCS=prefs_editor_gtk.cpp
183 +    B2_PATH_GNOMEUI([
184 +      AC_DEFINE(HAVE_GNOMEUI)
185 +      CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
186 +      LIBS="$LIBS $GNOMEUI_LIBS"
187 +    ], [])
188    ], [
189      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
190      WANT_GTK=no
# Line 174 | Line 204 | if [[ "x$WANT_ESD" = "xyes" ]]; then
204    ])
205   fi
206  
207 + dnl We use 64-bit file size support if possible.
208 + dnl FIXME: Use AC_SYS_LARGEFILE from autoconf 2.5+
209 + if [[ "x$OS_TYPE" = "xlinux" ]]; then
210 +  AC_DEFINE(_USE_LARGEFILE_SOURCE, 1, [Get more functions for correct standard I/O])
211 +  AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support])
212 + fi
213 +
214   dnl Checks for header files.
215   AC_HEADER_STDC
216 < AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h)
216 > AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h)
217  
218   dnl Checks for typedefs, structures, and compiler characteristics.
219   AC_C_BIGENDIAN
# Line 186 | Line 223 | AC_CHECK_SIZEOF(short, 2)
223   AC_CHECK_SIZEOF(int, 4)
224   AC_CHECK_SIZEOF(long, 4)
225   AC_CHECK_SIZEOF(long long, 8)
226 + AC_CHECK_SIZEOF(float, 4)
227 + AC_CHECK_SIZEOF(double, 8)
228 + AC_CHECK_SIZEOF(long double, 12)
229   AC_CHECK_SIZEOF(void *, 4)
230   AC_TYPE_OFF_T
231   AC_CHECK_TYPE(loff_t, off_t)
232 + AC_CHECK_TYPE(caddr_t, [char *])
233   AC_TYPE_SIZE_T
234   AC_TYPE_SIGNAL
235   AC_HEADER_TIME
236   AC_STRUCT_TM
237  
238 + dnl Check whether sys/socket.h defines type socklen_t.
239 + dnl (extracted from ac-archive/Miscellaneous)
240 + AC_CACHE_CHECK("for socklen_t",
241 +  ac_cv_type_socklen_t, [
242 +  AC_TRY_COMPILE([
243 +    #include <sys/types.h>
244 +    #include <sys/socket.h>
245 +  ], [socklen_t len = 42; return 0;],
246 +  ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
247 +  dnl When cross-compiling, do not assume anything.
248 +  ac_cv_type_socklen_t="guessing no"
249 +  )
250 + ])
251 + if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
252 +  AC_DEFINE(socklen_t, int)
253 + fi
254 +
255   dnl Checks for library functions.
256   AC_CHECK_FUNCS(strdup cfmakeraw)
257   AC_CHECK_FUNCS(clock_gettime timer_create)
258 + AC_CHECK_FUNCS(sigaction signal)
259 + AC_CHECK_FUNCS(mmap mprotect munmap)
260 + AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
261 +
262 + dnl Darwin seems to define mach_task_self() instead of task_self().
263 + AC_CHECK_FUNCS(mach_task_self task_self)
264 +
265 + dnl Check for headers and functions related to pty support (sshpty.c)
266 + dnl From openssh-3.2.2p1 configure.ac
267 +
268 + AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
269 + AC_CHECK_FUNCS(_getpty vhangup strlcpy)
270 +
271 + case "$host" in
272 + *-*-hpux10.26)
273 +        disable_ptmx_check=yes
274 +        ;;
275 + *-*-linux*)
276 +        no_dev_ptmx=1
277 +        ;;
278 + mips-sony-bsd|mips-sony-newsos4)
279 +        AC_DEFINE(HAVE_NEWS4)
280 +        ;;
281 + *-*-sco3.2v4*)
282 +        no_dev_ptmx=1
283 +        ;;
284 + *-*-sco3.2v5*)
285 +        no_dev_ptmx=1
286 +        ;;
287 + esac
288 +
289 + if test -z "$no_dev_ptmx" ; then
290 +        if test "x$disable_ptmx_check" != "xyes" ; then
291 +                AC_CHECK_FILE("/dev/ptmx",
292 +                        [
293 +                                AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
294 +                                have_dev_ptmx=1
295 +                        ]
296 +                )
297 +        fi
298 + fi
299 + AC_CHECK_FILE("/dev/ptc",
300 +        [
301 +                AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
302 +                have_dev_ptc=1
303 +        ]
304 + )
305 +
306 + dnl (end of code from openssh-3.2.2p1 configure.ac)
307 +
308  
309   dnl Select system-dependant source files.
310   SERIALSRC=serial_unix.cpp
# Line 204 | Line 312 | ETHERSRC=../dummy/ether_dummy.cpp
312   SCSISRC=../dummy/scsi_dummy.cpp
313   AUDIOSRC=../dummy/audio_dummy.cpp
314   EXTRASYSSRCS=
315 < SUPPORTS_NATIVE_M68K=no
315 > CAN_NATIVE_M68K=no
316   case "$target_os" in
317   linux*)
318 <  ETHERSRC=Linux/ether_linux.cpp
211 <  SCSISRC=Linux/scsi_linux.cpp
318 >  ETHERSRC=ether_unix.cpp
319    AUDIOSRC=audio_oss_esd.cpp
320 +  SCSISRC=Linux/scsi_linux.cpp
321    ;;
322 < freebsd*3.*)
322 > freebsd*)
323 >  ETHERSRC=ether_unix.cpp
324    AUDIOSRC=audio_oss_esd.cpp
325    DEFINES="$DEFINES -DBSD_COMP"
326 +  CXXFLAGS="$CXXFLAGS -fpermissive"
327    dnl Check for the CAM library
328    AC_CHECK_LIB(cam, cam_open_btl, HAVE_LIBCAM=yes, HAVE_LIBCAM=no)
329    if [[ "x$HAVE_LIBCAM" = "xno" ]]; then
330      AC_MSG_WARN([Cannot find libcam for SCSI management, disabling SCSI support.])
331    else
332      dnl Check for the sys kernel includes
333 <    AC_CHECK_HEADER(/sys/cam/cam.h)
334 <    if [[ "x$ac_cv_header__sys_cam_cam_h" = "xno" ]]; then
333 >    AC_CHECK_HEADER(camlib.h)
334 >    if [[ "x$ac_cv_header_camlib_h" = "xno" ]]; then
335        dnl In this case I should fix this thing including a "patch"
336        dnl to access directly to the functions in the kernel :) --Orlando
337 <      AC_MSG_WARN([Cannot find kernel includes for CAM library, disabling SCSI support.])
337 >      AC_MSG_WARN([Cannot find includes for CAM library, disabling SCSI support.])
338      else
339        SCSISRC=FreeBSD/scsi_freebsd.cpp
230      CXXFLAGS="$CXXFLAGS -I/sys"
231      CFLAGS="$CFLAGS -I/sys"
340        LIBS="$LIBS -lcam"
341        DEFINES="$DEFINES -DCAM"
342      fi
343    fi
344    ;;
237 freebsd*)
238  DEFINES="$DEFINES -DBSD_COMP"
239  dnl Check for the SCSI library
240  AC_CHECK_LIB(scsi, scsi_open, HAVE_LIBSCSI=yes, HAVE_LIBSCSI=no)
241  if [[ "x$HAVE_LIBSCSI" = "xno" ]]; then
242    AC_MSG_WARN([Cannot find libscsi for SCSI management, disabling SCSI support.])
243  else
244    dnl Check for the sys kernel includes
245    AC_CHECK_HEADER(scsi.h sys/scsiio.h)
246    if [[ "x$ac_cv_header_scsi_h" = "xno" ]]; then
247      AC_MSG_WARN([Cannot find includes for the SCSI library, disabling SCSI support.])
248    else
249      SCSISRC=FreeBSD/scsi_freebsd.cpp
250      LIBS="$LIBS -lscsi"
251    fi
252  fi
253  ;;
345   netbsd*)
346 <  SUPPORTS_NATIVE_M68K=yes
346 >  CAN_NATIVE_M68K=yes
347    ;;
348   solaris*)
349    AUDIOSRC=Solaris/audio_solaris.cpp
350    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
351    ;;
352   irix*)
353 +  ETHERSRC=ether_unix.cpp
354 +  AUDIOSRC=Irix/audio_irix.cpp
355    EXTRASYSSRCS=Irix/unaligned.c
356 <  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200"
357 <  LIBS="$LIBS -lm"
356 >  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
357 >  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
358 >  LIBS="$LIBS -laudio"
359 >  WANT_ESD=no
360 >
361 >  dnl Check if our compiler supports -Ofast (MIPSPro)
362 >  HAVE_OFAST=no
363 >  ocflags="$CFLAGS"
364 >  CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'`
365 >  AC_MSG_CHECKING(if "-Ofast" works)
366 >  dnl Do a test compile of an empty function
367 >  AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no))
368 >  CFLAGS="$ocflags"
369 >
370    ;;
371   esac
372  
373 + dnl Use 68k CPU natively?
374 + WANT_NATIVE_M68K=no
375 + if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then
376 +  AC_DEFINE(ENABLE_NATIVE_M68K)
377 +  WANT_NATIVE_M68K=yes
378 + fi
379 +
380   if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
381    dnl Serial, ethernet and audio support needs pthreads
382    AC_MSG_WARN([You don't have pthreads, disabling serial, ethernet and audio support.])
# Line 279 | Line 391 | dnl to be put into the config.h file
391   dnl $1 -- the macro to define
392   dnl $2 -- the value to translate
393   AC_DEFUN(AC_TRANSLATE_DEFINE, [
394 <    if [[ "x$2" = "xyes" ]]; then
394 >    if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
395          AC_DEFINE($1)
396      fi
397   ])
398  
399 + dnl Various checks if the system supports vm_allocate() and the like functions.
400 + have_mach_vm=no
401 + if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
402 +      "x$ac_cv_func_vm_protect" = "xyes" ]]; then
403 +  have_mach_vm=yes
404 + fi
405 + AC_TRANSLATE_DEFINE(HAVE_MACH_VM, "$have_mach_vm")
406 +
407 + dnl Check that vm_allocate(), vm_protect() work
408 + if [[ "x$have_mach_vm" = "xyes" ]]; then
409 +
410 + AC_CACHE_CHECK("whether vm_protect works",
411 +  ac_cv_vm_protect_works, [
412 +  AC_LANG_SAVE
413 +  AC_LANG_CPLUSPLUS
414 +  ac_cv_vm_protect_works=yes
415 +  dnl First the tests that should segfault
416 +  for test_def in NONE_READ NONE_WRITE READ_WRITE; do
417 +    AC_TRY_RUN([
418 +      #define CONFIGURE_TEST_VM_MAP
419 +      #define TEST_VM_PROT_$test_def
420 +      #include "vm_alloc.cpp"
421 +    ], ac_cv_vm_protect_works=no, rm -f core,
422 +    dnl When cross-compiling, do not assume anything
423 +    ac_cv_vm_protect_works="guessing no"
424 +    )
425 +  done
426 +  AC_TRY_RUN([
427 +    #define CONFIGURE_TEST_VM_MAP
428 +    #define TEST_VM_PROT_RDWR_WRITE
429 +    #include "vm_alloc.cpp"
430 +  ], , ac_cv_vm_protect_works=no,
431 +  dnl When cross-compiling, do not assume anything
432 +  ac_cv_vm_protect_works="guessing no"
433 +  )
434 +  AC_LANG_RESTORE
435 +  ]
436 + )
437 +
438 + dnl Remove support for vm_allocate() if vm_protect() does not work
439 + if [[ "x$have_mach_vm" = "xyes" ]]; then
440 +  case $ac_cv_vm_protect_works in
441 +    *yes) have_mach_vm=yes;;
442 +    *no) have_mach_vm=no;;
443 +  esac
444 + fi
445 + AC_TRANSLATE_DEFINE(HAVE_MACH_VM, "$have_mach_vm")
446 +
447 + fi dnl HAVE_MACH_VM
448 +
449 + dnl Various checks if the system supports mmap() and the like functions.
450 + dnl ... and Mach memory allocators are not supported
451 + have_mmap_vm=no
452 + if [[ "x$ac_cv_func_mmap" = "xyes" -a "x$ac_cv_func_munmap" = "xyes" -a \
453 +      "x$ac_cv_func_mprotect" = "xyes" ]]; then
454 +  if [[ "x$have_mach_vm" = "xno" ]]; then
455 +    have_mmap_vm=yes
456 +  fi
457 + fi
458 + AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, "$have_mmap_vm")
459 +
460 + dnl Check that mmap() and associated functions work.
461 + if [[ "x$have_mmap_vm" = "xyes" ]]; then
462 +
463 + dnl Check if we have a working anonymous mmap()
464 + AC_CACHE_CHECK("whether mmap supports MAP_ANON",
465 +  ac_cv_mmap_anon, [
466 +  AC_LANG_SAVE
467 +  AC_LANG_CPLUSPLUS
468 +  AC_TRY_RUN([
469 +    #define HAVE_MMAP_ANON
470 +    #define CONFIGURE_TEST_VM_MAP
471 +    #define TEST_VM_MMAP_ANON
472 +    #include "vm_alloc.cpp"
473 +  ], ac_cv_mmap_anon=yes, ac_cv_mmap_anon=no,
474 +  dnl When cross-compiling, do not assume anything.
475 +  ac_cv_mmap_anon="guessing no"
476 +  )
477 +  AC_LANG_RESTORE
478 +  ]
479 + )
480 + AC_TRANSLATE_DEFINE(HAVE_MMAP_ANON, "$ac_cv_mmap_anon")
481 +
482 + AC_CACHE_CHECK("whether mmap supports MAP_ANONYMOUS",
483 +  ac_cv_mmap_anonymous, [
484 +  AC_LANG_SAVE
485 +  AC_LANG_CPLUSPLUS
486 +  AC_TRY_RUN([
487 +    #define HAVE_MMAP_ANONYMOUS
488 +    #define CONFIGURE_TEST_VM_MAP
489 +    #define TEST_VM_MMAP_ANON
490 +    #include "vm_alloc.cpp"
491 +  ], ac_cv_mmap_anonymous=yes, ac_cv_mmap_anonymous=no,
492 +  dnl When cross-compiling, do not assume anything.
493 +  ac_cv_mmap_anonymous="guessing no"
494 +  )
495 +  AC_LANG_RESTORE
496 +  ]
497 + )
498 + AC_TRANSLATE_DEFINE(HAVE_MMAP_ANONYMOUS, "$ac_cv_mmap_anonymous")
499 +
500 + AC_CACHE_CHECK("whether mprotect works",
501 +  ac_cv_mprotect_works, [
502 +  AC_LANG_SAVE
503 +  AC_LANG_CPLUSPLUS
504 +  ac_cv_mprotect_works=yes
505 +  dnl First the tests that should segfault
506 +  for test_def in NONE_READ NONE_WRITE READ_WRITE; do
507 +    AC_TRY_RUN([
508 +      #define CONFIGURE_TEST_VM_MAP
509 +      #define TEST_VM_PROT_$test_def
510 +      #include "vm_alloc.cpp"
511 +    ], ac_cv_mprotect_works=no, rm -f core,
512 +    dnl When cross-compiling, do not assume anything
513 +    ac_cv_mprotect_works="guessing no"
514 +    )
515 +  done
516 +  AC_TRY_RUN([
517 +    #define CONFIGURE_TEST_VM_MAP
518 +    #define TEST_VM_PROT_RDWR_WRITE
519 +    #include "vm_alloc.cpp"
520 +  ], , ac_cv_mprotect_works=no,
521 +  dnl When cross-compiling, do not assume anything
522 +  ac_cv_mprotect_works="guessing no"
523 +  )
524 +  AC_LANG_RESTORE
525 +  ]
526 + )
527 +
528 + dnl Remove support for mmap() if mprotect() does not work
529 + if [[ "x$have_mmap_vm" = "xyes" ]]; then
530 +  case $ac_cv_mprotect_works in
531 +    *yes) have_mmap_vm=yes;;
532 +    *no) have_mmap_vm=no;;
533 +  esac
534 + fi
535 + AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_mmap_vm)
536 +
537 + fi dnl HAVE_MMAP_VM
538 +
539   dnl Check if we can mmap 0x2000 bytes from 0x0000
540   AC_CACHE_CHECK("whether we can map Low Memory area 0x0000-0x2000",
541    ac_cv_can_map_lm, [
542    AC_LANG_SAVE
543    AC_LANG_CPLUSPLUS
544    AC_TRY_RUN([
545 <    #include <unistd.h>
546 <    #include <fcntl.h>
547 <    #include <sys/mman.h>
548 <    
549 <    int main()
550 <    { int zero_fd; char * lm;
551 <      if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1);
552 <      if ((lm = (char *)mmap((caddr_t)0x0000, 0x2000, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, zero_fd, 0)) == MAP_FAILED) exit(1);
301 <      lm[0] = 0x12;
302 <          munmap(lm, 0x2000);
303 <      close(zero_fd);
304 <      exit(0);
545 >    #include "vm_alloc.cpp"
546 >    int main(void) { /* returns 0 if we could map the lowmem globals */
547 >      volatile char * lm;
548 >      if (vm_init() < 0) exit(1);
549 >      if ((lm = (volatile char *)vm_acquire_fixed(0, 0x2000)) == VM_MAP_FAILED) exit(1);
550 >      lm[0] = 'z';
551 >      if (vm_release((char *)lm, 0x2000) < 0) exit(1);
552 >      vm_exit(); exit(0);
553      }
554 <  ],
555 <  [ac_cv_can_map_lm=yes],
556 <  [ac_cv_can_map_lm=no]
554 >  ], ac_cv_can_map_lm=yes, ac_cv_can_map_lm=no,
555 >  dnl When cross-compiling, do not assume anything.
556 >  ac_cv_can_map_lm="guessing no"
557    )
558    AC_LANG_RESTORE
559    ]
560   )
561  
562 < dnl Check if extended signals are supported.
563 < AC_CACHE_CHECK("whether your system supports extended signal handlers",
564 <  ac_cv_have_extended_signals, [
562 > dnl Check signal handlers need to be reinstalled
563 > AC_CACHE_CHECK("whether signal handlers need to be reinstalled",
564 >  ac_cv_signal_need_reinstall, [
565    AC_LANG_SAVE
566    AC_LANG_CPLUSPLUS
567    AC_TRY_RUN([
568 +    #include <stdlib.h>
569 +    #ifdef HAVE_UNISTD_H
570      #include <unistd.h>
571 +    #endif
572      #include <signal.h>
573 <    #include <fcntl.h>
574 <    #include <sys/mman.h>
575 <
576 <    static volatile caddr_t mem = 0;
577 <    static int zero_fd = -1;
573 >    static int handled_signal = 0;
574 >    RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
575 >    int main(void) { /* returns 0 if signals need not to be reinstalled */
576 >      signal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
577 >      exit(handled_signal == 2);
578 >    }
579 >  ], ac_cv_signal_need_reinstall=yes, ac_cv_signal_need_reinstall=no,
580 >  dnl When cross-compiling, do not assume anything.
581 >  ac_cv_signal_need_reinstall="guessing yes"
582 >  )
583 >  AC_LANG_RESTORE
584 >  ]
585 > )
586 > AC_TRANSLATE_DEFINE(SIGNAL_NEED_REINSTALL, "$ac_cv_signal_need_reinstall")
587  
588 <    static RETSIGTYPE segfault_handler(int, siginfo_t * sip, void *)
589 <    { if ((caddr_t)(sip->si_addr) != mem) exit(1);
590 <      munmap(mem, getpagesize()); close(zero_fd); exit(0); }
591 <
592 <    int main()
593 <    { if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1);
594 <      if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1);
595 <      struct sigaction sa; sa.sa_sigaction = segfault_handler; sa.sa_flags = 0;
596 <      sigaction(SIGSEGV, &sa, 0);
597 <      mem[0] = 0;
598 <      exit(1); // should not be reached
588 > dnl Check if sigaction handlers need to be reinstalled
589 > AC_CACHE_CHECK("whether sigaction handlers need to be reinstalled",
590 >  ac_cv_sigaction_need_reinstall, [
591 >  AC_LANG_SAVE
592 >  AC_LANG_CPLUSPLUS
593 >  AC_TRY_RUN([
594 >    #include <stdlib.h>
595 >    #ifdef HAVE_UNISTD_H
596 >    #include <unistd.h>
597 >    #endif
598 >    #include <signal.h>
599 >    static int handled_signal = 0;
600 >    RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
601 >    typedef RETSIGTYPE (*signal_handler)(int);
602 >    static signal_handler mysignal(int sig, signal_handler handler) {
603 >      struct sigaction old_sa;
604 >      struct sigaction new_sa;
605 >      new_sa.sa_handler = handler;
606 >      return ((sigaction(sig,&new_sa,&old_sa) < 0) ? SIG_IGN : old_sa.sa_handler);
607 >    }
608 >    int main(void) { /* returns 0 if signals need not to be reinstalled */
609 >      mysignal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
610 >      exit(handled_signal == 2);
611      }
612 <  ],
613 <  [ac_cv_have_extended_signals=yes],
614 <  [ac_cv_have_extended_signals=no]
612 >  ], ac_cv_sigaction_need_reinstall=yes, ac_cv_sigaction_need_reinstall=no,
613 >  dnl When cross-compiling, do not assume anything.
614 >  ac_cv_sigaction_need_reinstall="guessing yes"
615 >  )
616 >  AC_LANG_RESTORE
617 >  ]
618 > )
619 > AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall")
620 >
621 > dnl Check if extended signals are supported.
622 > AC_CACHE_CHECK("whether your system supports extended signal handlers",
623 >  ac_cv_have_extended_signals, [
624 >  AC_LANG_SAVE
625 >  AC_LANG_CPLUSPLUS
626 >  AC_TRY_RUN([
627 >    #define HAVE_SIGINFO_T 1
628 >    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
629 >    #include "vm_alloc.cpp"
630 >    #include "sigsegv.cpp"
631 >  ], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
632 >  dnl When cross-compiling, do not assume anything.
633 >  ac_cv_have_extended_signals=no
634    )
635    AC_LANG_RESTORE
636    ]
637   )
638   AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals")
639 <
639 >
640   dnl Otherwise, check for subterfuges.
641   if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
642 <  case "$target_os" in
643 <    linux*)
644 <      if [[ "x$HAVE_I386" = "xyes" ]]; then
645 <        AC_CACHE_CHECK("whether we then have a subterfuge for your system",
646 <                  ac_cv_have_sigcontext_hack, [
647 <          AC_LANG_SAVE
648 <          AC_LANG_CPLUSPLUS
649 <          AC_TRY_RUN([
650 <            #include <unistd.h>
651 <            #include <signal.h>
652 <            #include <fcntl.h>
653 <            #include <sys/mman.h>
654 <
655 <            static volatile caddr_t mem = 0;
656 <            static int zero_fd = -1;
657 <
367 <            static RETSIGTYPE segfault_handler(int, struct sigcontext scs)
368 <            { if ((caddr_t)(scs.cr2) != mem) exit(1);
369 <              munmap(mem, getpagesize()); close(zero_fd); exit(0); }
370 <
371 <            int main()
372 <            { if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1);
373 <              if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1);
374 <              struct sigaction sa; sa.sa_flags = 0;
375 <                          sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler;
376 <              sigaction(SIGSEGV, &sa, 0);
377 <              mem[0] = 0;
378 <              exit(1); // should not be reached
379 <            }
380 <          ],
381 <          [ac_cv_have_sigcontext_hack=yes],
382 <          [ac_cv_have_sigcontext_hack=no]
383 <          )
384 <          AC_LANG_RESTORE
385 <        ])
386 <                AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack)
387 <      fi
388 <    ;;
389 <  esac
642 >  AC_CACHE_CHECK("whether we then have a subterfuge for your system",
643 >  ac_cv_have_sigcontext_hack, [
644 >    AC_LANG_SAVE
645 >    AC_LANG_CPLUSPLUS
646 >    AC_TRY_RUN([
647 >      #define HAVE_SIGCONTEXT_SUBTERFUGE 1
648 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
649 >      #include "vm_alloc.cpp"
650 >      #include "sigsegv.cpp"
651 >    ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
652 >    dnl When cross-compiling, do not assume anything.
653 >    ac_cv_have_sigcontext_hack=no
654 >    )
655 >    AC_LANG_RESTORE
656 >  ])
657 >  AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack")
658   fi
659  
660 + dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler)
661 + AC_CACHE_CHECK("whether we can skip instruction in SIGSEGV handler",
662 +  ac_cv_have_skip_instruction, [
663 +  AC_LANG_SAVE
664 +  AC_LANG_CPLUSPLUS
665 +  AC_TRY_RUN([
666 +    #define HAVE_SIGSEGV_SKIP_INSTRUCTION 1
667 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
668 +    #include "vm_alloc.cpp"
669 +    #include "sigsegv.cpp"
670 +  ], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no,
671 +  dnl When cross-compiling, do not assume anything.
672 +  ac_cv_have_skip_instruction=no
673 +  )
674 +  AC_LANG_RESTORE
675 +  ]
676 + )
677 + AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction")
678 +
679   dnl Can we do Video on SEGV Signals ?
680   CAN_VOSF=no
681   if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
# Line 396 | Line 683 | if [[ "$ac_cv_have_extended_signals" = "
683   fi
684  
685   dnl Determine the addressing mode to use
686 < ADDRESSING_MODE=""
687 < AC_MSG_CHECKING([for the addressing mode to use])
688 < for am in $ADDRESSING_TEST_ORDER; do
689 <  case $am in
690 <  real)
691 <    dnl Requires ability to mmap Low Memory globals.
692 <    if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
693 <      continue
694 <    fi
695 <    if [[ "x$ac_cv_c_bigendian" = "xyes" ]]; then
696 <      dnl Requires only VOSF if 16-bit vidmode enable
410 <      if [[ "x$WANT_16BIT_VIDMODE" = "xyes" ]]; then
411 <        if [[ "x$CAN_VOSF" = "xno" ]]; then
412 <          continue
413 <        fi
414 <      else
415 <        DEFINES="$DEFINES -DDISABLE_16BIT_VIDMODE"
686 > if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
687 >  ADDRESSING_MODE="real"
688 > else
689 >  ADDRESSING_MODE=""
690 >  AC_MSG_CHECKING([for the addressing mode to use])
691 >  for am in $ADDRESSING_TEST_ORDER; do
692 >    case $am in
693 >    real)
694 >      dnl Requires ability to mmap() Low Memory globals
695 >      if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
696 >        continue
697        fi
698 <    else
418 <      dnl Requires VOSF
698 >          dnl Requires VOSF screen updates
699        if [[ "x$CAN_VOSF" = "xno" ]]; then
700          continue
701        fi
702 <    fi
703 <    dnl Real addressing will probably work
424 <    ADDRESSING_MODE="real"
425 <    WANT_VOSF=yes dnl we can use VOSF and we need it actually
426 <    DEFINES="$DEFINES -DREAL_ADDRESSING"
427 <    break
428 <    ;;
429 <  direct)
430 <    dnl Requires VOSF
431 <    if [[ "x$CAN_VOSF" = "xyes" ]]; then
432 <      ADDRESSING_MODE="direct"
702 >      dnl Real addressing will probably work.
703 >      ADDRESSING_MODE="real"
704        WANT_VOSF=yes dnl we can use VOSF and we need it actually
705 <      DEFINES="$DEFINES -DDIRECT_ADDRESSING"
705 >      DEFINES="$DEFINES -DREAL_ADDRESSING"
706        break
707 <    fi
708 <    ;;
709 <  banks)
710 <    dnl Default addressing mode
707 >      ;;
708 >    direct)
709 >      dnl Requires VOSF screen updates
710 >      if [[ "x$CAN_VOSF" = "xyes" ]]; then
711 >        ADDRESSING_MODE="direct"
712 >        WANT_VOSF=yes dnl we can use VOSF and we need it actually
713 >        DEFINES="$DEFINES -DDIRECT_ADDRESSING"
714 >        break
715 >      fi
716 >      ;;
717 >    banks)
718 >      dnl Default addressing mode
719 >      ADDRESSING_MODE="memory banks"
720 >      break
721 >      ;;
722 >    *)
723 >      AC_MSG_ERROR([Internal configure.in script error for $am addressing mode])
724 >    esac
725 >  done
726 >  AC_MSG_RESULT($ADDRESSING_MODE)
727 >  if [[ "x$ADDRESSING_MODE" = "x" ]]; then
728 >    AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
729      ADDRESSING_MODE="memory banks"
730 <    break
442 <    ;;
443 <  *)
444 <    AC_MSG_ERROR([Internal configure.in script error for $am addressing mode])
445 <  esac
446 < done
447 < AC_MSG_RESULT($ADDRESSING_MODE)
448 < if [[ "x$ADDRESSING_MODE" = "x" ]]; then
449 <  AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
450 <  ADDRESSING_MODE="memory banks"
730 >  fi
731   fi
732  
733 < dnl Since real and direct addressing modes automatically activate VOSF,
734 < dnl I put this test here.
455 < if [[ "x$WANT_VOSF" = "xyes" ]]; then
456 <  if [[ "x$CAN_VOSF" = "xno" ]]; then
457 <    AC_MSG_WARN([Sorry, your system does not support Video on SEGV signals])
458 <    WANT_VOSF=no
459 <  else
733 > dnl Enable VOSF screen updates with this feature is requested and feasible
734 > if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then
735      AC_DEFINE(ENABLE_VOSF)
736 <  fi
736 > else
737 >    WANT_VOSF=no
738   fi
739  
740   dnl Check for GAS.
# Line 480 | Line 756 | AC_EGREP_CPP(yes,
756   #endif
757   ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
758  
759 + dnl Check for GCC 3.0 or higher.
760 + HAVE_GCC30=no
761 + AC_MSG_CHECKING(for GCC 3.0 or higher)
762 + AC_EGREP_CPP(yes,
763 + [#if __GNUC__ >= 3
764 +  yes
765 + #endif
766 + ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
767 +
768   dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
769 + dnl Also set "-fno-exceptions" for C++ because exception handling requires
770 + dnl the frame pointer.
771   if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
772    CFLAGS="$CFLAGS -fomit-frame-pointer"
773 <  CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
773 >  CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -fno-exceptions"
774 > fi
775 >
776 > dnl (gb) Do not merge constants since it breaks fpu/fpu_x86.cpp.
777 > dnl As of 2001/08/02, this affects the following compilers:
778 > dnl Official: probably gcc-3.1 (mainline CVS)
779 > dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
780 > dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
781 > if [[ "x$HAVE_GCC27" = "xyes" ]]; then
782 >  SAVED_CXXFLAGS="$CXXFLAGS"
783 >  CXXFLAGS="$CXXFLAGS -fno-merge-constants"
784 >  AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
785 >    AC_LANG_SAVE
786 >    AC_LANG_CPLUSPLUS
787 >    AC_TRY_COMPILE([],[],[ac_cv_gcc_constants_merging=yes],[ac_cv_gcc_constants_merging=no])
788 >    AC_LANG_RESTORE
789 >  ])
790 >  if [[ "x$ac_cv_gcc_constants_merging" != "xyes" ]]; then
791 >    CXXFLAGS="$SAVED_CXXFLAGS"
792 >  fi
793   fi
794  
795   dnl Select appropriate CPU source and REGPARAM define.
796   ASM_OPTIMIZATIONS=none
491 WANT_NATIVE_M68K=no
797   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
798 < FPUSRCS="../uae_cpu/fpp.cpp"
799 < if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
798 > FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp"
799 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then
800    dnl i386 CPU
801    DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\""
802    if [[ "x$HAVE_GAS" = "xyes" ]]; then
803      ASM_OPTIMIZATIONS=i386
804 <    DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTFLAGS"
805 <    CPUSRCS="../uae_cpu/compiler.cpp cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
804 >    DEFINES="$DEFINES -DX86_ASSEMBLY -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS"
805 >    CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
806      FPUSRCS="../uae_cpu/fpu_x86.cpp"
807    fi
808   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
# Line 509 | Line 814 | elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HA
814      AC_MSG_RESULT($SPARC_TYPE)
815      case "$SPARC_TYPE" in
816      SPARC_V8)
817 <          ASM_OPTIMIZATIONS="SPARC V8 architecture"
818 <      DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTFLAGS"
817 >      ASM_OPTIMIZATIONS="SPARC V8 architecture"
818 >      DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
819        CFLAGS="$CFLAGS -Wa,-Av8"
820        CXXFLAGS="$CXXFLAGS -Wa,-Av8"
821        ;;
822      SPARC_V9)
823 <          ASM_OPTIMIZATIONS="SPARC V9 architecture"
824 <      DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTFLAGS"
823 >      ASM_OPTIMIZATIONS="SPARC V9 architecture"
824 >      DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTIMIZED_FLAGS"
825        CFLAGS="$CFLAGS -Wa,-Av9"
826        CXXFLAGS="$CXXFLAGS -Wa,-Av9"
827        ;;
828      esac
829      ;;
830    esac
831 < elif [[ "x$HAVE_M68K" = "xyes" -a "x$SUPPORTS_NATIVE_M68K" = "xyes" ]]; then
831 > elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
832    dnl Native m68k, no emulation
833 <  CPUSRCS=""
834 <  AC_DEFINE(ENABLE_NATIVE_M68K)
530 <  WANT_NATIVE_M68K=yes
833 >  CPUINCLUDES="-I../native_cpu"
834 >  CPUSRCS="asm_support.s"
835   fi
836  
837 + dnl Select appropriate FPU source.
838 + dnl 1. Optimized X86 assembly core if target is i386 architecture.
839 + SAVED_DEFINES=$DEFINES
840 + if [[ "x$FPE_CORE" = "xdefault" ]]; then
841 +  if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
842 +    DEFINES="$DEFINES -DFPU_X86"
843 +    FPE_CORE_STR="i386 optimized core"
844 +    FPUSRCS="../uae_cpu/fpu/fpu_x86.cpp"
845 +    FPE_CORE="i386"
846 +  else
847 +    FPE_CORE="uae"
848 +  fi
849 + fi
850 +
851 + dnl 2. JIT-FPU only supports IEEE-based implementation.
852 + if [[ "x$WANT_JIT_FPU" = "xyes" -a "x$FPE_CORE" != "xieee" ]]; then
853 +  AC_MSG_WARN([Sorry, JIT-FPU supports only the "ieee" FPE implementation])
854 +  FPE_CORE="ieee"
855 +  dnl Restore previous variables. FPE_CORE_STR and FPUSRCS are overwritten
856 +  DEFINES=$SAVED_DEFINES
857 + fi
858 +
859 + dnl 3. Choose either IEEE-based implementation or the old UAE core.
860 + if [[ "x$FPE_CORE" = "xieee" ]]; then
861 +  AC_CHECK_HEADERS(fenv.h)
862 +  AC_CHECK_FUNCS(feclearexcept fegetexceptflag feraiseexcept fesetexceptflag fetestexcept)
863 +  AC_CHECK_FUNCS(fegetround fesetround)
864 +  DEFINES="$DEFINES -DFPU_IEEE"
865 +  FPE_CORE_STR="ieee-based fpu core"
866 +  FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp"
867 + elif [[ "x$FPE_CORE" = "xuae" ]]; then
868 +  DEFINES="$DEFINES -DFPU_UAE"
869 +  FPE_CORE_STR="original uae core"
870 +  FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp"
871 + fi
872 +
873 + dnl Check for certain math functions
874 + AC_CHECK_FUNCS(atanh)
875 + AC_CHECK_FUNCS(isnan isinf)             dnl C99
876 + AC_CHECK_FUNCS(isnanl isinfl)   dnl IEEE ?
877 +
878   dnl UAE CPU sources for all non-m68k-native architectures.
879   if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then
880    CPUINCLUDES="-I../uae_cpu"
881    CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS"
537 else
538  CPUINCLUDES="-I../native_cpu"
539  CPUSRCS="asm_support.s"
882   fi
883  
884   dnl Remove the "-g" option if set for GCC.
885   if [[ "x$HAVE_GCC27" = "xyes" ]]; then
886 <        dnl gb-- Probably not the cleanest way to take
887 <        CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'`
888 <        CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'`
886 >  CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'`
887 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'`
888 > fi
889 >
890 > dnl Or if we have -Ofast
891 > if [[ "x$HAVE_OFAST" = "xyes" ]]; then
892 >  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast"
893 >  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast"
894 >  CXXFLAGS="-LANG:std $CXXFLAGS"
895 >  LDFLAGS="$LDFLAGS -ipa"
896   fi
897  
898   dnl Generate Makefile.
# Line 557 | Line 906 | dnl Print summary.
906   echo
907   echo Basilisk II configuration summary:
908   echo
909 < echo XFree86 DGA support .............. : $WANT_XF86_DGA
910 < echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
911 < echo fbdev DGA support ................ : $WANT_FBDEV_DGA
912 < echo Enable video on SEGV signals ..... : $WANT_VOSF
913 < echo ESD sound support ................ : $WANT_ESD
914 < echo GTK user interface ............... : $WANT_GTK
915 < echo mon debugger support ............. : $WANT_MON
916 < echo Running m68k code natively ....... : $WANT_NATIVE_M68K
917 < echo Assembly optimizations ........... : $ASM_OPTIMIZATIONS
918 < echo Addressing mode .................. : $ADDRESSING_MODE
909 > echo XFree86 DGA support .................... : $WANT_XF86_DGA
910 > echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE
911 > echo fbdev DGA support ...................... : $WANT_FBDEV_DGA
912 > echo Enable video on SEGV signals ........... : $WANT_VOSF
913 > echo ESD sound support ...................... : $WANT_ESD
914 > echo GTK user interface ..................... : $WANT_GTK
915 > echo mon debugger support ................... : $WANT_MON
916 > echo Running m68k code natively ............. : $WANT_NATIVE_M68K
917 > echo Floating-Point emulation core .......... : $FPE_CORE_STR
918 > echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
919 > echo Addressing mode ........................ : $ADDRESSING_MODE
920   echo
921   echo "Configuration done. Now type \"make\" (or \"gmake\")."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines