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.10 by gbeauche, 2003-11-27T00:26:33Z vs.
Revision 1.20 by gbeauche, 2004-02-20T17:33:27Z

# 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 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 163 | 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(mmintrin.h, [have_mmintrin_h=yes])
187 + AC_CHECK_HEADERS(xmmintrin.h, [have_xmmintrin_h=yes])
188 + AC_CHECK_HEADERS(emmintrin.h, [have_emmintrin_h=yes])
189  
190   dnl Checks for typedefs, structures, and compiler characteristics.
191   AC_C_BIGENDIAN
# Line 182 | Line 205 | AC_TYPE_SIGNAL
205   AC_HEADER_TIME
206   AC_STRUCT_TM
207  
208 + dnl Check whether struct sigaction has sa_restorer member.
209 + AC_CACHE_CHECK([whether struct sigaction has sa_restorer],
210 +  ac_cv_signal_sa_restorer, [
211 +  AC_TRY_COMPILE([
212 +    #include <signal.h>
213 +  ], [struct sigaction sa; sa.sa_restorer = 0;],
214 +  ac_cv_signal_sa_restorer=yes, ac_cv_signal_sa_restorer=no,
215 +  dnl When cross-compiling, do not assume anything.
216 +  ac_cv_signal_sa_restorer=no
217 +  )
218 + ])
219 + if [[ "x$ac_cv_signal_sa_restorer" = "xyes" ]]; then
220 +  AC_DEFINE(HAVE_SIGNAL_SA_RESTORER)
221 + fi
222 +
223   dnl Checks for library functions.
224   AC_CHECK_FUNCS(strdup cfmakeraw)
225 < AC_CHECK_FUNCS(nanosleep clock_gettime timer_create)
225 > AC_CHECK_FUNCS(nanosleep)
226   AC_CHECK_FUNCS(sigaction signal)
227   AC_CHECK_FUNCS(mmap mprotect munmap)
228   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
229  
230 + dnl Darwin seems to define mach_task_self() instead of task_self().
231 + AC_CHECK_FUNCS(mach_task_self task_self)
232 +
233 + dnl We need clock_gettime() for better performance but it may drag
234 + dnl libpthread in, which we don't want for native ppc mode
235 + case $EMULATED_PPC:$target_os in
236 + no:linux*)
237 +  ;;
238 + *:*)
239 +  AC_SEARCH_LIBS(clock_gettime, [rt posix4])
240 +  AC_CHECK_FUNCS(clock_gettime)
241 +  ;;
242 + esac
243 +
244   dnl Select system-dependant sources.
245 < if [[ "x$EMULATED_PPC" = "xno" ]]; then
246 <  SYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
247 < fi
248 < SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS"
245 > SERIALSRC=serial_unix.cpp
246 > ETHERSRC=../dummy/ether_dummy.cpp
247 > SCSISRC=../dummy/scsi_dummy.cpp
248 > AUDIOSRC=../dummy/audio_dummy.cpp
249 > EXTRASYSSRCS=
250 > case "$target_os" in
251 > linux*)
252 >  ETHERSRC=Linux/ether_linux.cpp
253 >  AUDIOSRC=audio_oss_esd.cpp
254 >  SCSISRC=Linux/scsi_linux.cpp
255 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
256 >    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
257 >  fi
258 >  ;;
259 > darwin*)
260 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
261 >    EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S"
262 >  fi
263 >  ;;
264 > esac
265 > SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
266  
267   dnl Define a macro that translates a yesno-variable into a C macro definition
268   dnl to be put into the config.h file
# Line 352 | Line 421 | AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_
421  
422   fi dnl HAVE_MMAP_VM
423  
424 < dnl Check if we can mmap 0x2000 bytes from 0x0000
425 < AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
424 > dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
425 > AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x3000],
426 >  ac_cv_pagezero_hack, [
427 >  ac_cv_pagezero_hack=no
428 >  if AC_TRY_COMMAND([Darwin/testlmem.sh 0x3000]); then
429 >    ac_cv_pagezero_hack=yes
430 >    dnl might as well skip the test for mmap-able low memory
431 >    ac_cv_can_map_lm=no
432 >  fi
433 > ])
434 > AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
435 >  [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
436 >
437 > dnl Check if we can mmap 0x3000 bytes from 0x0000
438 > AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x3000],
439    ac_cv_can_map_lm, [
440    AC_LANG_SAVE
441    AC_LANG_CPLUSPLUS
# Line 436 | Line 518 | AC_CACHE_CHECK([whether sigaction handle
518   AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
519    [Define if your system requires sigactions to be reinstalled.])
520  
521 < dnl Check if extended signals are supported.
522 < AC_CACHE_CHECK([whether your system supports extended signal handlers],
523 <  ac_cv_have_extended_signals, [
521 > dnl Check if Mach exceptions supported.
522 > AC_CACHE_CHECK([whether your system supports Mach exceptions],
523 >  ac_cv_have_mach_exceptions, [
524    AC_LANG_SAVE
525    AC_LANG_CPLUSPLUS
526    AC_TRY_RUN([
527 <    #define HAVE_SIGINFO_T 1
527 >    #define HAVE_MACH_EXCEPTIONS 1
528      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
529      #include "vm_alloc.cpp"
530      #include "sigsegv.cpp"
531 <  ], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
531 >  ], [
532 >  sigsegv_recovery=mach
533 >  ac_cv_have_mach_exceptions=yes
534 >  ],
535 >  ac_cv_have_mach_exceptions=no,
536    dnl When cross-compiling, do not assume anything.
537 <  ac_cv_have_extended_signals=no
537 >  ac_cv_have_mach_exceptions=no
538    )
539    AC_LANG_RESTORE
540    ]
541   )
542 < AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
543 <  [Define if your system support extended signals.])
542 > AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
543 >  [Define if your system supports Mach exceptions.])
544 >
545 > dnl Otherwise, check if extended signals are supported.
546 > if [[ -z "$sigsegv_recovery" ]]; then
547 >  AC_CACHE_CHECK([whether your system supports extended signal handlers],
548 >    ac_cv_have_extended_signals, [
549 >    AC_LANG_SAVE
550 >    AC_LANG_CPLUSPLUS
551 >    AC_TRY_RUN([
552 >      #define HAVE_SIGINFO_T 1
553 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
554 >      #include "vm_alloc.cpp"
555 >      #include "sigsegv.cpp"
556 >    ], [
557 >    sigsegv_recovery=siginfo
558 >    ac_cv_have_extended_signals=yes
559 >    ],
560 >    ac_cv_have_extended_signals=no,
561 >    dnl When cross-compiling, do not assume anything.
562 >    ac_cv_have_extended_signals=no
563 >    )
564 >    AC_LANG_RESTORE
565 >    ]
566 >  )
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 >    sigsegv_recovery=sigcontext
584 >    ac_cv_have_sigcontext_hack=yes
585 >    ],
586 >    ac_cv_have_sigcontext_hack=no,
587      dnl When cross-compiling, do not assume anything.
588      ac_cv_have_sigcontext_hack=no
589      )
# Line 499 | Line 615 | AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_IN
615  
616   dnl Can we do Video on SEGV Signals ?
617   CAN_VOSF=no
618 < if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
618 > if [[ -n "$sigsegv_recovery" ]]; then
619    CAN_VOSF=yes
620   fi
621  
# Line 510 | Line 626 | else
626      WANT_VOSF=no
627   fi
628  
629 + dnl Platform specific binary postprocessor
630 + BLESS=/bin/true
631 + if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
632 +  BLESS=Darwin/lowmem
633 +  LDFLAGS="$LDFLAGS -pagezero_size 0x3000"
634 + fi
635 +
636   dnl Check for GCC 2.7 or higher.
637   HAVE_GCC27=no
638   AC_MSG_CHECKING(for GCC 2.7 or higher)
# Line 528 | Line 651 | AC_EGREP_CPP(xyes,
651   #endif
652   ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
653  
654 + dnl Check for ICC.
655 + AC_MSG_CHECKING(for ICC)
656 + HAVE_ICC=no
657 + if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
658 +  HAVE_ICC=yes
659 + fi
660 + AC_MSG_RESULT($HAVE_ICC)
661 +
662   # Test if the compiler can generate ELF objects
663   AC_CACHE_CHECK([whether the compiler can generate ELF objects],
664    ac_cv_elf_objects, [
# Line 544 | Line 675 | AC_CACHE_CHECK([whether the compiler can
675   ])
676   ELF_OBJECTS=$ac_cv_elf_objects
677  
547 dnl FIXME: forcibly disable JIT for now
548 WANT_JIT=no
549
678   dnl CPU emulator sources
679   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
680    CPUSRCS="\
# Line 574 | Line 702 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
702          ac_cv_use_dyngen=no
703          ;;
704        esac
705 +      dnl Check for a suitable synthetic opcodes compiler (icc is faking itself as gcc 3.2.2)
706 +      if [[ -z "$DYNGEN_CC" ]]; then
707 +        if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
708 +          DYNGEN_CC=$CXX
709 +        else
710 +          for p in /usr/bin /usr/local/bin; do
711 +            gxx="$p/g++"
712 +            if [[ -x "$gxx" ]]; then
713 +              DYNGEN_CC="$gxx"
714 +            fi
715 +          done
716 +        fi
717 +      fi
718 +      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
719 +        ac_cv_use_dyngen=no
720 +      fi
721      ])
722      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
723        case $host_cpu in
724 <      i?86:yes)
724 >      i?86)
725          DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
726          if [[ "x$HAVE_GCC30" = "xyes" ]]; then
727            DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
728          else
729            DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
730          fi
731 +        if [[ "x$have_mmintrin_h" = "xyes" ]]; then
732 +          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"
733 +        fi
734 +        if [[ "x$have_xmmintrin_h" = "xyes" ]]; then
735 +          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"
736 +        fi
737 +        if [[ "x$have_emmintrin_h" = "xyes" ]]; then
738 +          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"
739 +        fi
740          ;;
741        esac
742 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=2000"
742 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
743        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
744          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
745        fi
# Line 605 | Line 758 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
758      fi
759    fi
760    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
761 + else
762 +  WANT_JIT=no
763   fi
764   if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
765    AC_CACHE_CHECK([whether static data regions are executable],
# Line 620 | Line 775 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
775        ((void (*)(void))p)();
776        return 0;
777   #endif
623 #if defined(__i386__)
624      static unsigned char p[] = {0xc3};
625      ((void (*)(void))p)();
626      return 0;
627 #endif
778        return 1;
779      }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
780      dnl When cross-compiling, do not assume anything.
# Line 635 | Line 785 | fi
785   AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
786    [Define if your system marks static data pages as executable.])
787  
788 + if [[ "x$WANT_JIT" = "xyes" ]]; then
789 +  CPPFLAGS="$CPPFLAGS -DUSE_JIT"
790 + 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 654 | 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