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

Comparing SheepShaver/src/Unix/configure.in (file contents):
Revision 1.6 by gbeauche, 2003-09-07T14:21:20Z vs.
Revision 1.25 by gbeauche, 2004-06-22T22:41:44Z

# Line 5 | Line 5 | AC_INIT(main_unix.cpp)
5   AC_PREREQ(2.12)
6   AC_CONFIG_HEADER(config.h)
7  
8 + dnl Canonical system information.
9 + AC_CANONICAL_HOST
10 + AC_CANONICAL_TARGET
11 +
12   dnl Options.
13 + AC_ARG_ENABLE(jit,          [  --enable-jit            enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
14   AC_ARG_ENABLE(ppc-emulator, [  --enable-ppc-emulator   use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto])
15   AC_ARG_ENABLE(xf86-dga,     [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
16 < AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
16 > AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=no]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=no])
17   AC_ARG_ENABLE(vosf,         [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
18   AC_ARG_WITH(esd,            [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
19   AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
20   AC_ARG_WITH(mon,            [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
21 + AC_ARG_WITH(dgcc,           [  --with-dgcc=COMPILER    use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval])
22  
23   dnl Checks for programs.
24   AC_PROG_CC
# Line 29 | Line 35 | AC_EGREP_CPP(yes,
35   #ifdef __powerpc__
36    yes
37   #endif
38 + #ifdef __ppc__
39 +  yes
40 + #endif
41   ], [AC_MSG_RESULT(yes); HAVE_PPC=yes], AC_MSG_RESULT(no))
42  
43   dnl We use native CPU if possible.
# Line 43 | Line 52 | fi
52  
53   dnl We use mon if possible.
54   MONSRCS=
55 + case "x$WANT_MON" in
56 + x/* | x.*)
57 +  mon_srcdir=$WANT_MON
58 +  WANT_MON=yes
59 +  ;;
60 + xyes)
61 +  mon_srcdir=../../../mon/src
62 +  ;;
63 + esac
64   if [[ "x$WANT_MON" = "xyes" ]]; then
65    AC_MSG_CHECKING(for mon)
48  mon_srcdir=../../../mon/src
66    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
67      AC_MSG_RESULT(yes)
68      AC_DEFINE(ENABLE_MON)
# Line 80 | Line 97 | LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -l
97  
98   dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
99   HAVE_PTHREADS=yes
100 < if [[ "x$EMULATED_PPC" = "xyes" ]]; then
100 > case $EMULATED_PPC:$target_os in
101 > no:linux*)
102 >  dnl We do have our own pthread_cancel() implementation
103 >  AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Define if you have the pthread_cancel function.])
104 >  ;;
105 > *:*)
106    AC_CHECK_LIB(pthread, pthread_create, , [
107      AC_CHECK_LIB(c_r, pthread_create, , [
108        AC_CHECK_LIB(PTL, pthread_create, , [
# Line 89 | Line 111 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
111      ])
112    ])
113    AC_CHECK_FUNCS(pthread_cancel)
114 < fi
115 <
116 < dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
117 < SEMSRC=
118 < AC_CHECK_FUNCS(sem_init, , [
114 >  AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
115 >  AC_CHECK_FUNCS(pthread_mutexattr_settype)
116 >  AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
117 >  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
118 >    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
119 >  fi
120 >  dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
121 >  SEMSRC=
122 >  AC_CHECK_FUNCS(sem_init, , [
123    if test "x$HAVE_PTHREADS" = "xyes"; then
124      SEMSRC=posix_sem.cpp
125    fi
126 < ])
126 >  ])
127 >  ;;
128 > esac
129  
130   dnl We use XFree86 DGA if possible.
131   if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
# Line 122 | Line 150 | if [[ "x$WANT_XF86_VIDMODE" = "xyes" ]];
150   fi
151  
152   dnl We use GTK+ if possible.
153 < UISRCS=
153 > UISRCS=../dummy/prefs_editor_dummy.cpp
154   if [[ "x$WANT_GTK" = "xyes" ]]; then
155    AM_PATH_GTK(1.2.0, [
156      AC_DEFINE(ENABLE_GTK)
# Line 155 | Line 183 | AC_HEADER_SYS_WAIT
183   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
184   AC_CHECK_HEADERS(sys/time.h sys/times.h)
185   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h)
186 + AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h)
187  
188   dnl Checks for typedefs, structures, and compiler characteristics.
189   AC_C_BIGENDIAN
# Line 174 | Line 203 | AC_TYPE_SIGNAL
203   AC_HEADER_TIME
204   AC_STRUCT_TM
205  
206 + dnl Check whether struct sigaction has sa_restorer member.
207 + AC_CACHE_CHECK([whether struct sigaction has sa_restorer],
208 +  ac_cv_signal_sa_restorer, [
209 +  AC_TRY_COMPILE([
210 +    #include <signal.h>
211 +  ], [struct sigaction sa; sa.sa_restorer = 0;],
212 +  ac_cv_signal_sa_restorer=yes, ac_cv_signal_sa_restorer=no,
213 +  dnl When cross-compiling, do not assume anything.
214 +  ac_cv_signal_sa_restorer=no
215 +  )
216 + ])
217 + if [[ "x$ac_cv_signal_sa_restorer" = "xyes" ]]; then
218 +  AC_DEFINE(HAVE_SIGNAL_SA_RESTORER)
219 + fi
220 +
221   dnl Checks for library functions.
222   AC_CHECK_FUNCS(strdup cfmakeraw)
223 < AC_CHECK_FUNCS(nanosleep clock_gettime timer_create)
223 > AC_CHECK_FUNCS(nanosleep)
224   AC_CHECK_FUNCS(sigaction signal)
225   AC_CHECK_FUNCS(mmap mprotect munmap)
226   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
227 + AC_CHECK_FUNCS(posix_memalign memalign valloc)
228 +
229 + dnl Darwin seems to define mach_task_self() instead of task_self().
230 + AC_CHECK_FUNCS(mach_task_self task_self)
231 +
232 + dnl We need clock_gettime() for better performance but it may drag
233 + dnl libpthread in, which we don't want for native ppc mode
234 + case $EMULATED_PPC:$target_os in
235 + no:linux*)
236 +  ;;
237 + *:*)
238 +  AC_SEARCH_LIBS(clock_gettime, [rt posix4])
239 +  AC_CHECK_FUNCS(clock_gettime)
240 +  ;;
241 + esac
242  
243   dnl Select system-dependant sources.
244 < if [[ "x$EMULATED_PPC" = "xno" ]]; then
245 <  SYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
246 < else
247 <  SYSSRCS="../kpx_cpu/sheepshaver_glue.cpp \
248 <        ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
249 <        ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
250 <        ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp"
251 <  CPPFLAGS="$CPPFLAGS -I../kpx_cpu -I../kpx_cpu/include -I../kpx_cpu/src -I../kpx_cpu/src/cpu"
252 < fi
253 < SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS"
244 > SERIALSRC=serial_unix.cpp
245 > ETHERSRC=../dummy/ether_dummy.cpp
246 > SCSISRC=../dummy/scsi_dummy.cpp
247 > AUDIOSRC=../dummy/audio_dummy.cpp
248 > EXTRASYSSRCS=
249 > case "$target_os" in
250 > linux*)
251 >  ETHERSRC=Linux/ether_linux.cpp
252 >  AUDIOSRC=audio_oss_esd.cpp
253 >  SCSISRC=Linux/scsi_linux.cpp
254 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
255 >    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
256 >  fi
257 >  ;;
258 > darwin*)
259 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
260 >    EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S"
261 >  fi
262 >  ;;
263 > esac
264 > SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
265  
266   dnl Define a macro that translates a yesno-variable into a C macro definition
267   dnl to be put into the config.h file
# Line 204 | Line 274 | AC_DEFUN(AC_TRANSLATE_DEFINE, [
274      fi
275   ])
276  
277 + dnl Check that the host supports TUN/TAP devices
278 + AC_CACHE_CHECK([whether TUN/TAP is supported],
279 +  ac_cv_tun_tap_support, [
280 +  AC_TRY_COMPILE([
281 +    #if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
282 +    #include <linux/if.h>
283 +    #include <linux/if_tun.h>
284 +    #endif
285 +    #if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H)
286 +    #include <net/if.h>
287 +    #include <net/if_tun.h>
288 +    #endif
289 +  ], [
290 +    struct ifreq ifr;
291 +    memset(&ifr, 0, sizeof(ifr));
292 +    ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
293 +  ],
294 +  ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no
295 +  )
296 + ])
297 + AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support",
298 +  [Define if your system supports TUN/TAP devices.])
299 +
300   dnl Various checks if the system supports vm_allocate() and the like functions.
301   have_mach_vm=no
302   if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
# Line 350 | Line 443 | AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_
443  
444   fi dnl HAVE_MMAP_VM
445  
446 < dnl Check if we can mmap 0x2000 bytes from 0x0000
447 < AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
446 > dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
447 > AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x3000],
448 >  ac_cv_pagezero_hack, [
449 >  ac_cv_pagezero_hack=no
450 >  if AC_TRY_COMMAND([Darwin/testlmem.sh 0x3000]); then
451 >    ac_cv_pagezero_hack=yes
452 >    dnl might as well skip the test for mmap-able low memory
453 >    ac_cv_can_map_lm=no
454 >  fi
455 > ])
456 > AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
457 >  [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
458 >
459 > dnl Check if we can mmap 0x3000 bytes from 0x0000
460 > AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x3000],
461    ac_cv_can_map_lm, [
462    AC_LANG_SAVE
463    AC_LANG_CPLUSPLUS
# Line 434 | Line 540 | AC_CACHE_CHECK([whether sigaction handle
540   AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
541    [Define if your system requires sigactions to be reinstalled.])
542  
543 < dnl Check if extended signals are supported.
544 < AC_CACHE_CHECK([whether your system supports extended signal handlers],
545 <  ac_cv_have_extended_signals, [
543 > dnl Check if Mach exceptions supported.
544 > AC_CACHE_CHECK([whether your system supports Mach exceptions],
545 >  ac_cv_have_mach_exceptions, [
546    AC_LANG_SAVE
547    AC_LANG_CPLUSPLUS
548    AC_TRY_RUN([
549 <    #define HAVE_SIGINFO_T 1
549 >    #define HAVE_MACH_EXCEPTIONS 1
550      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
551      #include "vm_alloc.cpp"
552      #include "sigsegv.cpp"
553 <  ], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
553 >  ],
554 >  ac_cv_have_mach_exceptions=yes,
555 >  ac_cv_have_mach_exceptions=no,
556    dnl When cross-compiling, do not assume anything.
557 <  ac_cv_have_extended_signals=no
557 >  ac_cv_have_mach_exceptions=no
558    )
559    AC_LANG_RESTORE
560    ]
561   )
562 < AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
563 <  [Define if your system support extended signals.])
562 > if [[ "$ac_cv_have_mach_exceptions" = "yes" ]]; then
563 >  sigsegv_recovery=mach
564 > fi
565 > AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
566 >  [Define if your system supports Mach exceptions.])
567 >
568 > dnl Otherwise, check if extended signals are supported.
569 > if [[ -z "$sigsegv_recovery" ]]; then
570 >  AC_CACHE_CHECK([whether your system supports extended signal handlers],
571 >    ac_cv_have_extended_signals, [
572 >    AC_LANG_SAVE
573 >    AC_LANG_CPLUSPLUS
574 >    AC_TRY_RUN([
575 >      #define HAVE_SIGINFO_T 1
576 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
577 >      #include "vm_alloc.cpp"
578 >      #include "sigsegv.cpp"
579 >    ],
580 >    ac_cv_have_extended_signals=yes,
581 >    ac_cv_have_extended_signals=no,
582 >    dnl When cross-compiling, do not assume anything.
583 >    ac_cv_have_extended_signals=no
584 >    )
585 >    AC_LANG_RESTORE
586 >    ]
587 >  )
588 >  if [[ "$ac_cv_have_extended_signals" = "yes" ]]; then
589 >    sigsegv_recovery=siginfo
590 >  fi
591 >  AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
592 >    [Define if your system support extended signals.])
593 > fi
594  
595   dnl Otherwise, check for subterfuges.
596 < if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
596 > if [[ -z "$sigsegv_recovery" ]]; then
597    AC_CACHE_CHECK([whether we then have a subterfuge for your system],
598    ac_cv_have_sigcontext_hack, [
599      AC_LANG_SAVE
# Line 465 | Line 603 | if [[ "x$ac_cv_have_extended_signals" =
603        #define CONFIGURE_TEST_SIGSEGV_RECOVERY
604        #include "vm_alloc.cpp"
605        #include "sigsegv.cpp"
606 <    ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
606 >    ],
607 >    ac_cv_have_sigcontext_hack=yes,
608 >    ac_cv_have_sigcontext_hack=no,
609      dnl When cross-compiling, do not assume anything.
610      ac_cv_have_sigcontext_hack=no
611      )
612      AC_LANG_RESTORE
613    ])
614 +  if [[ "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
615 +    sigsegv_recovery=sigcontext
616 +  fi
617    AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack",
618      [Define if we know a hack to replace siginfo_t->si_addr member.])
619   fi
# Line 497 | Line 640 | AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_IN
640  
641   dnl Can we do Video on SEGV Signals ?
642   CAN_VOSF=no
643 < if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
643 > if [[ -n "$sigsegv_recovery" ]]; then
644    CAN_VOSF=yes
645 +  case $target_os in
646 +  darwin*)
647 +    dnl Signal handlers in darwin are way too slow since the whole
648 +    dnl machine state (GPRs, FPRs, VRs) is forcibly saved.
649 +    dnl In other words, VOSF is slower than static window refreshes.
650 +    CAN_VOSF=no
651 +    ;;
652 +  esac
653   fi
654  
655   dnl Enable VOSF screen updates with this feature is requested and feasible
# Line 508 | Line 659 | else
659      WANT_VOSF=no
660   fi
661  
662 + dnl Platform specific binary postprocessor
663 + BLESS=/bin/true
664 + if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
665 +  BLESS=Darwin/lowmem
666 +  LDFLAGS="$LDFLAGS -pagezero_size 0x3000"
667 + fi
668 +
669 + dnl Check for GCC 2.7 or higher.
670 + HAVE_GCC27=no
671 + AC_MSG_CHECKING(for GCC 2.7 or higher)
672 + AC_EGREP_CPP(xyes,
673 + [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
674 +  xyes
675 + #endif
676 + ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
677 +
678 + dnl Check for GCC 3.0 or higher.
679 + HAVE_GCC30=no
680 + AC_MSG_CHECKING(for GCC 3.0 or higher)
681 + AC_EGREP_CPP(xyes,
682 + [#if __GNUC__ >= 3
683 +  xyes
684 + #endif
685 + ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
686 +
687 + dnl Check for ICC.
688 + AC_MSG_CHECKING(for ICC)
689 + HAVE_ICC=no
690 + if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
691 +  HAVE_ICC=yes
692 + fi
693 + AC_MSG_RESULT($HAVE_ICC)
694 +
695 + # Test if the compiler can generate ELF objects
696 + AC_CACHE_CHECK([whether the compiler can generate ELF objects],
697 +  ac_cv_elf_objects, [
698 +  echo 'int i;' > conftest.$ac_ext
699 +  ac_cv_elf_objects=no
700 +  if AC_TRY_EVAL(ac_compile); then
701 +    case `/usr/bin/file conftest.$ac_objext` in
702 +    *"ELF"*)
703 +      ac_cv_elf_objects=yes
704 +      ;;
705 +    esac
706 +  fi
707 +  rm -rf conftest*
708 + ])
709 + ELF_OBJECTS=$ac_cv_elf_objects
710 +
711 + dnl CPU emulator sources
712 + if [[ "x$EMULATED_PPC" = "xyes" ]]; then
713 +  CPUSRCS="\
714 +    ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
715 +    ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
716 +    ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
717 +    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
718 +  CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
719 +
720 +  dnl Enable JIT compiler, if possible
721 +  if [[ "x$WANT_JIT" = "xyes" ]]; then
722 +    AC_CACHE_CHECK([whether dyngen can be used],
723 +      ac_cv_use_dyngen, [
724 +      case $host_cpu:$ELF_OBJECTS in
725 +      powerpc:yes)
726 +        ac_cv_use_dyngen=yes
727 +        ;;
728 +      x86_64:yes)
729 +        ac_cv_use_dyngen=yes
730 +        ;;
731 +      i?86:yes)
732 +        ac_cv_use_dyngen=yes
733 +        ;;
734 +      *:*)
735 +        ac_cv_use_dyngen=no
736 +        ;;
737 +      esac
738 +      dnl Check for a suitable synthetic opcodes compiler (icc is faking itself as gcc 3.2.2)
739 +      if [[ -z "$DYNGEN_CC" ]]; then
740 +        if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
741 +          DYNGEN_CC=$CXX
742 +        else
743 +          for p in /usr/bin /usr/local/bin; do
744 +            gxx="$p/g++"
745 +            if [[ -x "$gxx" ]]; then
746 +              DYNGEN_CC="$gxx"
747 +            fi
748 +          done
749 +        fi
750 +      fi
751 +      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
752 +        ac_cv_use_dyngen=no
753 +      fi
754 +    ])
755 +    if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
756 +      case $host_cpu in
757 +      i?86)
758 +        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
759 +        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
760 +          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
761 +        else
762 +          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
763 +        fi
764 +        saved_CPPFLAGS=$CPPFLAGS
765 +        CPPFLAGS="$CPPFLAGS -mmmx"
766 +        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
767 +        CPPFLAGS="$CPPFLAGS -msse"
768 +        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
769 +        CPPFLAGS="$CPPFLAGS -msse2"
770 +        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
771 +        CPPFLAGS=$saved_CPPFLAGS
772 +        ;;
773 +      x86_64)
774 +        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
775 +        ;;
776 +      esac
777 +      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
778 +      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
779 +        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
780 +      fi
781 +    else
782 +      WANT_JIT=no
783 +    fi
784 +    AC_TRANSLATE_DEFINE(ENABLE_DYNGEN, $ac_cv_use_dyngen, [Define to enable dyngen engine])
785 +    if [[ "x$WANT_JIT" = "xyes" ]]; then
786 +      DYNGENSRCS="\
787 +        ../kpx_cpu/src/cpu/jit/dyngen.c \
788 +        ../kpx_cpu/src/cpu/jit/cxxdemangle.cpp"
789 +      CPUSRCS="\
790 +        ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
791 +        ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
792 +        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
793 +    fi
794 +  fi
795 +  CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
796 + else
797 +  WANT_JIT=no
798 + fi
799 + if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
800 +  AC_CACHE_CHECK([whether static data regions are executable],
801 +    ac_cv_have_static_data_exec, [
802 +    AC_TRY_RUN([int main(void) {
803 + #if defined(__powerpc__)
804 +      static unsigned int p[8] = {0x4e800020,};
805 +      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
806 +      asm volatile("sync" : : : "memory");
807 +      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
808 +      asm volatile("sync" : : : "memory");
809 +      asm volatile("isync" : : : "memory");
810 +      ((void (*)(void))p)();
811 +      return 0;
812 + #endif
813 +      return 1;
814 +    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
815 +    dnl When cross-compiling, do not assume anything.
816 +    ac_cv_have_static_data_exec=no
817 +    )
818 +  ])
819 + fi
820 + AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
821 +  [Define if your system marks static data pages as executable.])
822 +
823 + if [[ "x$WANT_JIT" = "xyes" ]]; then
824 +  CPPFLAGS="$CPPFLAGS -DUSE_JIT"
825 + fi
826 +
827   dnl Generate Makefile.
828 + AC_SUBST(DYNGENSRCS)
829 + AC_SUBST(DYNGEN_CC)
830 + AC_SUBST(DYNGEN_OP_FLAGS)
831   AC_SUBST(SYSSRCS)
832 + AC_SUBST(CPUSRCS)
833 + AC_SUBST(BLESS)
834   AC_OUTPUT(Makefile)
835  
836   dnl Print summary.
# Line 519 | Line 840 | echo
840   echo XFree86 DGA support .............. : $WANT_XF86_DGA
841   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
842   echo Using PowerPC emulator ........... : $EMULATED_PPC
843 + echo Enable JIT compiler .............. : $WANT_JIT
844   echo Enable video on SEGV signals ..... : $WANT_VOSF
845   echo ESD sound support ................ : $WANT_ESD
846   echo GTK user interface ............... : $WANT_GTK
847   echo mon debugger support ............. : $WANT_MON
848 + echo Bad memory access recovery type .. : $sigsegv_recovery
849   echo
850   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines