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.13 by gbeauche, 2003-12-04T22:28:40Z vs.
Revision 1.23 by gbeauche, 2004-04-13T22:13:19Z

# Line 13 | Line 13 | 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 34 | 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 48 | 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)
53  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 85 | 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 94 | Line 111 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
111      ])
112    ])
113    AC_CHECK_FUNCS(pthread_cancel)
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 < fi
121 <
122 < dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
103 < SEMSRC=
104 < AC_CHECK_FUNCS(sem_init, , [
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 130 | 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 182 | Line 202 | AC_TYPE_SIGNAL
202   AC_HEADER_TIME
203   AC_STRUCT_TM
204  
205 + dnl Check whether struct sigaction has sa_restorer member.
206 + AC_CACHE_CHECK([whether struct sigaction has sa_restorer],
207 +  ac_cv_signal_sa_restorer, [
208 +  AC_TRY_COMPILE([
209 +    #include <signal.h>
210 +  ], [struct sigaction sa; sa.sa_restorer = 0;],
211 +  ac_cv_signal_sa_restorer=yes, ac_cv_signal_sa_restorer=no,
212 +  dnl When cross-compiling, do not assume anything.
213 +  ac_cv_signal_sa_restorer=no
214 +  )
215 + ])
216 + if [[ "x$ac_cv_signal_sa_restorer" = "xyes" ]]; then
217 +  AC_DEFINE(HAVE_SIGNAL_SA_RESTORER)
218 + fi
219 +
220   dnl Checks for library functions.
221   AC_CHECK_FUNCS(strdup cfmakeraw)
222 < AC_CHECK_FUNCS(nanosleep clock_gettime timer_create)
222 > AC_CHECK_FUNCS(nanosleep)
223   AC_CHECK_FUNCS(sigaction signal)
224   AC_CHECK_FUNCS(mmap mprotect munmap)
225   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
226 + AC_CHECK_FUNCS(posix_memalign memalign valloc)
227 +
228 + dnl Darwin seems to define mach_task_self() instead of task_self().
229 + AC_CHECK_FUNCS(mach_task_self task_self)
230 +
231 + dnl We need clock_gettime() for better performance but it may drag
232 + dnl libpthread in, which we don't want for native ppc mode
233 + case $EMULATED_PPC:$target_os in
234 + no:linux*)
235 +  ;;
236 + *:*)
237 +  AC_SEARCH_LIBS(clock_gettime, [rt posix4])
238 +  AC_CHECK_FUNCS(clock_gettime)
239 +  ;;
240 + esac
241  
242   dnl Select system-dependant sources.
243 < if [[ "x$EMULATED_PPC" = "xno" ]]; then
244 <  SYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
245 < fi
246 < SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS"
243 > SERIALSRC=serial_unix.cpp
244 > ETHERSRC=../dummy/ether_dummy.cpp
245 > SCSISRC=../dummy/scsi_dummy.cpp
246 > AUDIOSRC=../dummy/audio_dummy.cpp
247 > EXTRASYSSRCS=
248 > case "$target_os" in
249 > linux*)
250 >  ETHERSRC=Linux/ether_linux.cpp
251 >  AUDIOSRC=audio_oss_esd.cpp
252 >  SCSISRC=Linux/scsi_linux.cpp
253 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
254 >    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
255 >  fi
256 >  ;;
257 > darwin*)
258 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
259 >    EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S"
260 >  fi
261 >  ;;
262 > esac
263 > SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
264  
265   dnl Define a macro that translates a yesno-variable into a C macro definition
266   dnl to be put into the config.h file
# Line 352 | Line 419 | AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_
419  
420   fi dnl HAVE_MMAP_VM
421  
422 < dnl Check if we can mmap 0x2000 bytes from 0x0000
423 < AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
422 > dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
423 > AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x3000],
424 >  ac_cv_pagezero_hack, [
425 >  ac_cv_pagezero_hack=no
426 >  if AC_TRY_COMMAND([Darwin/testlmem.sh 0x3000]); then
427 >    ac_cv_pagezero_hack=yes
428 >    dnl might as well skip the test for mmap-able low memory
429 >    ac_cv_can_map_lm=no
430 >  fi
431 > ])
432 > AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
433 >  [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
434 >
435 > dnl Check if we can mmap 0x3000 bytes from 0x0000
436 > AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x3000],
437    ac_cv_can_map_lm, [
438    AC_LANG_SAVE
439    AC_LANG_CPLUSPLUS
# Line 436 | Line 516 | AC_CACHE_CHECK([whether sigaction handle
516   AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
517    [Define if your system requires sigactions to be reinstalled.])
518  
519 < dnl Check if extended signals are supported.
520 < AC_CACHE_CHECK([whether your system supports extended signal handlers],
521 <  ac_cv_have_extended_signals, [
519 > dnl Check if Mach exceptions supported.
520 > AC_CACHE_CHECK([whether your system supports Mach exceptions],
521 >  ac_cv_have_mach_exceptions, [
522    AC_LANG_SAVE
523    AC_LANG_CPLUSPLUS
524    AC_TRY_RUN([
525 <    #define HAVE_SIGINFO_T 1
525 >    #define HAVE_MACH_EXCEPTIONS 1
526      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
527      #include "vm_alloc.cpp"
528      #include "sigsegv.cpp"
529 <  ], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
529 >  ],
530 >  ac_cv_have_mach_exceptions=yes,
531 >  ac_cv_have_mach_exceptions=no,
532    dnl When cross-compiling, do not assume anything.
533 <  ac_cv_have_extended_signals=no
533 >  ac_cv_have_mach_exceptions=no
534    )
535    AC_LANG_RESTORE
536    ]
537   )
538 < AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
539 <  [Define if your system support extended signals.])
538 > if [[ "$ac_cv_have_mach_exceptions" = "yes" ]]; then
539 >  sigsegv_recovery=mach
540 > fi
541 > AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
542 >  [Define if your system supports Mach exceptions.])
543 >
544 > dnl Otherwise, check if extended signals are supported.
545 > if [[ -z "$sigsegv_recovery" ]]; then
546 >  AC_CACHE_CHECK([whether your system supports extended signal handlers],
547 >    ac_cv_have_extended_signals, [
548 >    AC_LANG_SAVE
549 >    AC_LANG_CPLUSPLUS
550 >    AC_TRY_RUN([
551 >      #define HAVE_SIGINFO_T 1
552 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
553 >      #include "vm_alloc.cpp"
554 >      #include "sigsegv.cpp"
555 >    ],
556 >    ac_cv_have_extended_signals=yes,
557 >    ac_cv_have_extended_signals=no,
558 >    dnl When cross-compiling, do not assume anything.
559 >    ac_cv_have_extended_signals=no
560 >    )
561 >    AC_LANG_RESTORE
562 >    ]
563 >  )
564 >  if [[ "$ac_cv_have_extended_signals" = "yes" ]]; then
565 >    sigsegv_recovery=siginfo
566 >  fi
567 >  AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
568 >    [Define if your system support extended signals.])
569 > fi
570  
571   dnl Otherwise, check for subterfuges.
572 < if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
572 > if [[ -z "$sigsegv_recovery" ]]; then
573    AC_CACHE_CHECK([whether we then have a subterfuge for your system],
574    ac_cv_have_sigcontext_hack, [
575      AC_LANG_SAVE
# Line 467 | Line 579 | if [[ "x$ac_cv_have_extended_signals" =
579        #define CONFIGURE_TEST_SIGSEGV_RECOVERY
580        #include "vm_alloc.cpp"
581        #include "sigsegv.cpp"
582 <    ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
582 >    ],
583 >    ac_cv_have_sigcontext_hack=yes,
584 >    ac_cv_have_sigcontext_hack=no,
585      dnl When cross-compiling, do not assume anything.
586      ac_cv_have_sigcontext_hack=no
587      )
588      AC_LANG_RESTORE
589    ])
590 +  if [[ "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
591 +    sigsegv_recovery=sigcontext
592 +  fi
593    AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack",
594      [Define if we know a hack to replace siginfo_t->si_addr member.])
595   fi
# Line 499 | Line 616 | AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_IN
616  
617   dnl Can we do Video on SEGV Signals ?
618   CAN_VOSF=no
619 < if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
619 > if [[ -n "$sigsegv_recovery" ]]; then
620    CAN_VOSF=yes
621   fi
622  
# Line 510 | Line 627 | else
627      WANT_VOSF=no
628   fi
629  
630 + dnl Platform specific binary postprocessor
631 + BLESS=/bin/true
632 + if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
633 +  BLESS=Darwin/lowmem
634 +  LDFLAGS="$LDFLAGS -pagezero_size 0x3000"
635 + fi
636 +
637   dnl Check for GCC 2.7 or higher.
638   HAVE_GCC27=no
639   AC_MSG_CHECKING(for GCC 2.7 or higher)
# Line 528 | Line 652 | AC_EGREP_CPP(xyes,
652   #endif
653   ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
654  
655 + dnl Check for ICC.
656 + AC_MSG_CHECKING(for ICC)
657 + HAVE_ICC=no
658 + if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
659 +  HAVE_ICC=yes
660 + fi
661 + AC_MSG_RESULT($HAVE_ICC)
662 +
663   # Test if the compiler can generate ELF objects
664   AC_CACHE_CHECK([whether the compiler can generate ELF objects],
665    ac_cv_elf_objects, [
# Line 571 | Line 703 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
703          ac_cv_use_dyngen=no
704          ;;
705        esac
706 +      dnl Check for a suitable synthetic opcodes compiler (icc is faking itself as gcc 3.2.2)
707 +      if [[ -z "$DYNGEN_CC" ]]; then
708 +        if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
709 +          DYNGEN_CC=$CXX
710 +        else
711 +          for p in /usr/bin /usr/local/bin; do
712 +            gxx="$p/g++"
713 +            if [[ -x "$gxx" ]]; then
714 +              DYNGEN_CC="$gxx"
715 +            fi
716 +          done
717 +        fi
718 +      fi
719 +      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
720 +        ac_cv_use_dyngen=no
721 +      fi
722      ])
723      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
724        case $host_cpu in
# Line 581 | Line 729 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
729          else
730            DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
731          fi
732 +        saved_CPPFLAGS=$CPPFLAGS
733 +        CPPFLAGS="$CPPFLAGS -mmmx"
734 +        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
735 +        CPPFLAGS="$CPPFLAGS -msse"
736 +        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
737 +        CPPFLAGS="$CPPFLAGS -msse2"
738 +        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
739 +        CPPFLAGS=$saved_CPPFLAGS
740 +        ;;
741 +      x86_64)
742 +        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
743          ;;
744        esac
745        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
# Line 635 | Line 794 | fi
794  
795   dnl Generate Makefile.
796   AC_SUBST(DYNGENSRCS)
797 + AC_SUBST(DYNGEN_CC)
798   AC_SUBST(DYNGEN_OP_FLAGS)
799   AC_SUBST(SYSSRCS)
800   AC_SUBST(CPUSRCS)
801 + AC_SUBST(BLESS)
802   AC_OUTPUT(Makefile)
803  
804   dnl Print summary.
# Line 652 | Line 813 | echo Enable video on SEGV signals .....
813   echo ESD sound support ................ : $WANT_ESD
814   echo GTK user interface ............... : $WANT_GTK
815   echo mon debugger support ............. : $WANT_MON
816 + echo Bad memory access recovery type .. : $sigsegv_recovery
817   echo
818   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines