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.15 by gbeauche, 2004-01-04T18:38:00Z vs.
Revision 1.22 by gbeauche, 2004-02-24T14:09:11Z

# Line 18 | Line 18 | AC_ARG_ENABLE(vosf,         [  --enable-
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 93 | 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 102 | 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 < else
121 <  dnl We do have our own pthread_cancel() implementation
122 <  AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Define if you have the pthread_cancel function.])
111 < fi
112 <
113 < dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
114 < SEMSRC=
115 < 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 141 | 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 193 | 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 363 | 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 447 | 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 >  sigsegv_recovery=mach
531 >  ac_cv_have_mach_exceptions=yes
532 >  ],
533 >  ac_cv_have_mach_exceptions=no,
534    dnl When cross-compiling, do not assume anything.
535 <  ac_cv_have_extended_signals=no
535 >  ac_cv_have_mach_exceptions=no
536    )
537    AC_LANG_RESTORE
538    ]
539   )
540 < AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
541 <  [Define if your system support extended signals.])
540 > AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
541 >  [Define if your system supports Mach exceptions.])
542 >
543 > dnl Otherwise, check if extended signals are supported.
544 > if [[ -z "$sigsegv_recovery" ]]; then
545 >  AC_CACHE_CHECK([whether your system supports extended signal handlers],
546 >    ac_cv_have_extended_signals, [
547 >    AC_LANG_SAVE
548 >    AC_LANG_CPLUSPLUS
549 >    AC_TRY_RUN([
550 >      #define HAVE_SIGINFO_T 1
551 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
552 >      #include "vm_alloc.cpp"
553 >      #include "sigsegv.cpp"
554 >    ], [
555 >    sigsegv_recovery=siginfo
556 >    ac_cv_have_extended_signals=yes
557 >    ],
558 >    ac_cv_have_extended_signals=no,
559 >    dnl When cross-compiling, do not assume anything.
560 >    ac_cv_have_extended_signals=no
561 >    )
562 >    AC_LANG_RESTORE
563 >    ]
564 >  )
565 >  AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
566 >    [Define if your system support extended signals.])
567 > fi
568  
569   dnl Otherwise, check for subterfuges.
570 < if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
570 > if [[ -z "$sigsegv_recovery" ]]; then
571    AC_CACHE_CHECK([whether we then have a subterfuge for your system],
572    ac_cv_have_sigcontext_hack, [
573      AC_LANG_SAVE
# Line 478 | Line 577 | if [[ "x$ac_cv_have_extended_signals" =
577        #define CONFIGURE_TEST_SIGSEGV_RECOVERY
578        #include "vm_alloc.cpp"
579        #include "sigsegv.cpp"
580 <    ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
580 >    ], [
581 >    sigsegv_recovery=sigcontext
582 >    ac_cv_have_sigcontext_hack=yes
583 >    ],
584 >    ac_cv_have_sigcontext_hack=no,
585      dnl When cross-compiling, do not assume anything.
586      ac_cv_have_sigcontext_hack=no
587      )
# Line 510 | Line 613 | AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_IN
613  
614   dnl Can we do Video on SEGV Signals ?
615   CAN_VOSF=no
616 < if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
616 > if [[ -n "$sigsegv_recovery" ]]; then
617    CAN_VOSF=yes
618   fi
619  
# Line 521 | Line 624 | else
624      WANT_VOSF=no
625   fi
626  
627 + dnl Platform specific binary postprocessor
628 + BLESS=/bin/true
629 + if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
630 +  BLESS=Darwin/lowmem
631 +  LDFLAGS="$LDFLAGS -pagezero_size 0x3000"
632 + fi
633 +
634   dnl Check for GCC 2.7 or higher.
635   HAVE_GCC27=no
636   AC_MSG_CHECKING(for GCC 2.7 or higher)
# Line 539 | Line 649 | AC_EGREP_CPP(xyes,
649   #endif
650   ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
651  
652 + dnl Check for ICC.
653 + AC_MSG_CHECKING(for ICC)
654 + HAVE_ICC=no
655 + if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
656 +  HAVE_ICC=yes
657 + fi
658 + AC_MSG_RESULT($HAVE_ICC)
659 +
660   # Test if the compiler can generate ELF objects
661   AC_CACHE_CHECK([whether the compiler can generate ELF objects],
662    ac_cv_elf_objects, [
# Line 582 | Line 700 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
700          ac_cv_use_dyngen=no
701          ;;
702        esac
703 +      dnl Check for a suitable synthetic opcodes compiler (icc is faking itself as gcc 3.2.2)
704 +      if [[ -z "$DYNGEN_CC" ]]; then
705 +        if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
706 +          DYNGEN_CC=$CXX
707 +        else
708 +          for p in /usr/bin /usr/local/bin; do
709 +            gxx="$p/g++"
710 +            if [[ -x "$gxx" ]]; then
711 +              DYNGEN_CC="$gxx"
712 +            fi
713 +          done
714 +        fi
715 +      fi
716 +      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
717 +        ac_cv_use_dyngen=no
718 +      fi
719      ])
720      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
721        case $host_cpu in
# Line 592 | Line 726 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
726          else
727            DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
728          fi
729 +        saved_CPPFLAGS=$CPPFLAGS
730 +        CPPFLAGS="$CPPFLAGS -mmmx"
731 +        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
732 +        CPPFLAGS="$CPPFLAGS -msse"
733 +        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
734 +        CPPFLAGS="$CPPFLAGS -msse2"
735 +        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
736 +        CPPFLAGS=$saved_CPPFLAGS
737 +        ;;
738 +      x86_64)
739 +        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
740          ;;
741        esac
742        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
# Line 646 | Line 791 | fi
791  
792   dnl Generate Makefile.
793   AC_SUBST(DYNGENSRCS)
794 + AC_SUBST(DYNGEN_CC)
795   AC_SUBST(DYNGEN_OP_FLAGS)
796   AC_SUBST(SYSSRCS)
797   AC_SUBST(CPUSRCS)
798 + AC_SUBST(BLESS)
799   AC_OUTPUT(Makefile)
800  
801   dnl Print summary.
# Line 663 | Line 810 | echo Enable video on SEGV signals .....
810   echo ESD sound support ................ : $WANT_ESD
811   echo GTK user interface ............... : $WANT_GTK
812   echo mon debugger support ............. : $WANT_MON
813 + echo Bad memory access recovery type .. : $sigsegv_recovery
814   echo
815   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines