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.12 by gbeauche, 2003-12-03T10:52:48Z vs.
Revision 1.24 by gbeauche, 2004-05-09T17:44:17Z

# 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 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(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 182 | 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 < fi
247 < 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 206 | 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 352 | 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 436 | 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 467 | 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 499 | 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   fi
646  
# Line 510 | Line 651 | else
651      WANT_VOSF=no
652   fi
653  
654 + dnl Platform specific binary postprocessor
655 + BLESS=/bin/true
656 + if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
657 +  BLESS=Darwin/lowmem
658 +  LDFLAGS="$LDFLAGS -pagezero_size 0x3000"
659 + fi
660 +
661   dnl Check for GCC 2.7 or higher.
662   HAVE_GCC27=no
663   AC_MSG_CHECKING(for GCC 2.7 or higher)
# Line 528 | Line 676 | AC_EGREP_CPP(xyes,
676   #endif
677   ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
678  
679 + dnl Check for ICC.
680 + AC_MSG_CHECKING(for ICC)
681 + HAVE_ICC=no
682 + if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
683 +  HAVE_ICC=yes
684 + fi
685 + AC_MSG_RESULT($HAVE_ICC)
686 +
687   # Test if the compiler can generate ELF objects
688   AC_CACHE_CHECK([whether the compiler can generate ELF objects],
689    ac_cv_elf_objects, [
# Line 571 | Line 727 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
727          ac_cv_use_dyngen=no
728          ;;
729        esac
730 +      dnl Check for a suitable synthetic opcodes compiler (icc is faking itself as gcc 3.2.2)
731 +      if [[ -z "$DYNGEN_CC" ]]; then
732 +        if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
733 +          DYNGEN_CC=$CXX
734 +        else
735 +          for p in /usr/bin /usr/local/bin; do
736 +            gxx="$p/g++"
737 +            if [[ -x "$gxx" ]]; then
738 +              DYNGEN_CC="$gxx"
739 +            fi
740 +          done
741 +        fi
742 +      fi
743 +      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
744 +        ac_cv_use_dyngen=no
745 +      fi
746      ])
747      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
748        case $host_cpu in
# Line 581 | Line 753 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
753          else
754            DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
755          fi
756 +        saved_CPPFLAGS=$CPPFLAGS
757 +        CPPFLAGS="$CPPFLAGS -mmmx"
758 +        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
759 +        CPPFLAGS="$CPPFLAGS -msse"
760 +        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
761 +        CPPFLAGS="$CPPFLAGS -msse2"
762 +        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
763 +        CPPFLAGS=$saved_CPPFLAGS
764 +        ;;
765 +      x86_64)
766 +        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
767          ;;
768        esac
769        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
# Line 602 | Line 785 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
785      fi
786    fi
787    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
788 + else
789 +  WANT_JIT=no
790   fi
791   if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
792    AC_CACHE_CHECK([whether static data regions are executable],
# Line 633 | Line 818 | fi
818  
819   dnl Generate Makefile.
820   AC_SUBST(DYNGENSRCS)
821 + AC_SUBST(DYNGEN_CC)
822   AC_SUBST(DYNGEN_OP_FLAGS)
823   AC_SUBST(SYSSRCS)
824   AC_SUBST(CPUSRCS)
825 + AC_SUBST(BLESS)
826   AC_OUTPUT(Makefile)
827  
828   dnl Print summary.
# Line 650 | Line 837 | echo Enable video on SEGV signals .....
837   echo ESD sound support ................ : $WANT_ESD
838   echo GTK user interface ............... : $WANT_GTK
839   echo mon debugger support ............. : $WANT_MON
840 + echo Bad memory access recovery type .. : $sigsegv_recovery
841   echo
842   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines