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

Comparing SheepShaver/src/Unix/configure.ac (file contents):
Revision 1.7 by gbeauche, 2004-07-19T19:42:21Z vs.
Revision 1.10 by gbeauche, 2004-11-24T22:48:02Z

# Line 25 | Line 25 | AC_ARG_WITH(gtk,            [  --with-gt
25   AC_ARG_WITH(mon,            [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
26   AC_ARG_WITH(dgcc,           [  --with-dgcc=COMPILER    use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval])
27  
28 + dnl Addressing mode
29 + AC_ARG_ENABLE(addressing,
30 +  [  --enable-addressing=AM  set the addressing mode to use [default=real]],
31 +  [case "$enableval" in
32 +   real)        WANT_ADDRESSING_MODE="real";;
33 +   direct)      WANT_ADDRESSING_MODE="direct";;
34 +   direct,0x*)  WANT_ADDRESSING_MODE="direct"; NATMEM_OFFSET=`echo "$enableval" | sed -n '/direct,\(0[[xX]][[0-9A-Fa-f]]*\)/s//\1/p'`;;
35 +   esac],
36 +  [WANT_ADDRESSING_MODE="real"]
37 + )
38 +
39   dnl SDL options.
40   AC_ARG_ENABLE(sdl-static,   [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
41   AC_ARG_ENABLE(sdl-video,    [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
# Line 37 | Line 48 | AC_PROG_CXX
48   AC_PROG_MAKE_SET
49   AC_PROG_INSTALL
50   AC_PROG_EGREP
51 + AC_CHECK_PROGS(FILE, [file false])
52  
53   dnl Check for PowerPC target CPU.
54   HAVE_PPC=no
# Line 113 | Line 125 | fi
125   if [[ "x$WANT_SDL" = "xyes" ]]; then
126    AC_PATH_PROG(sdl_config, "sdl-config")
127    if [[ -n "$sdl_config" ]]; then
128 <    sdl_cflags=`$sdl_config --cflags`
129 <    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
130 <      sdl_libs=`$sdl_config --static-libs`
131 <    else
132 <      sdl_libs=`$sdl_config --libs`
133 <    fi
128 >    case $target_os in
129 >    # Special treatment for Cygwin so that we can still use the POSIX layer
130 >    *cygwin*)
131 >      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
132 >      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
133 >      ;;
134 >    *)
135 >      sdl_cflags=`$sdl_config --cflags`
136 >      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
137 >        sdl_libs=`$sdl_config --static-libs`
138 >      else
139 >        sdl_libs=`$sdl_config --libs`
140 >      fi
141 >      ;;
142 >    esac
143      CFLAGS="$CFLAGS $sdl_cflags"
144      CXXFLAGS="$CXXFLAGS $sdl_cflags"
145      LIBS="$LIBS $sdl_libs"
# Line 229 | Line 250 | AC_SYS_LARGEFILE
250   dnl Checks for header files.
251   AC_HEADER_STDC
252   AC_HEADER_SYS_WAIT
253 + AC_CHECK_HEADERS(malloc.h)
254   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
255   AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
256   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
# Line 238 | Line 260 | AC_CHECK_HEADERS(linux/if.h, [], [], [
260   #endif
261   ])
262   AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
263 + AC_CHECK_HEADERS(fenv.h)
264  
265   dnl Checks for typedefs, structures, and compiler characteristics.
266   AC_C_BIGENDIAN
# Line 294 | Line 317 | no:linux*)
317    ;;
318   esac
319  
320 + dnl Check for headers and functions related to pty support (sshpty.c)
321 + dnl From openssh-3.2.2p1 configure.ac
322 + AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
323 + AC_CHECK_FUNCS(_getpty vhangup strlcpy)
324 +
325 + case "$host" in
326 + *-*-hpux10.26)
327 +        disable_ptmx_check=yes
328 +        ;;
329 + *-*-linux*)
330 +        no_dev_ptmx=1
331 +        ;;
332 + mips-sony-bsd|mips-sony-newsos4)
333 +        AC_DEFINE(HAVE_NEWS4, 1, [Define if you are on NEWS-OS (additions from openssh-3.2.2p1, for sshpty.c).])
334 +        ;;
335 + *-*-sco3.2v4*)
336 +        no_dev_ptmx=1
337 +        ;;
338 + *-*-sco3.2v5*)
339 +        no_dev_ptmx=1
340 +        ;;
341 + *-*-cygwin*)
342 +        no_dev_ptmx=1
343 +        ;;
344 + esac
345 +
346 + if test -z "$no_dev_ptmx" ; then
347 +        if test "x$disable_ptmx_check" != "xyes" ; then
348 +                AC_CHECK_FILE([/dev/ptmx],
349 +                        [
350 +                                AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx.])
351 +                                have_dev_ptmx=1
352 +                        ]
353 +                )
354 +        fi
355 + fi
356 + AC_CHECK_FILE([/dev/ptc],
357 +        [
358 +                AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, [Define if you have /dev/ptc.])
359 +                have_dev_ptc=1
360 +        ]
361 + )
362 + dnl (end of code from openssh-3.2.2p1 configure.ac)
363 +
364   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
365   AC_DEFUN(AC_CHECK_FRAMEWORK, [
366    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
# Line 343 | Line 410 | darwin*)
410      EXTFSSRC=../MacOSX/extfs_macosx.mm
411    fi
412    ;;
413 + cygwin*)
414 +  SERIALSRC="../dummy/serial_dummy.cpp"
415 +  ;;
416   esac
417  
418   dnl SDL overrides
# Line 356 | Line 426 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
426    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
427      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
428    else
429 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
429 >    case "$target_os" in
430 >    cygwin*)
431 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
432 >      ;;
433 >    *)
434 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
435 >      ;;
436 >    esac
437    fi
438   else
439    VIDEOSRCS="video_x.cpp"
# Line 672 | Line 749 | fi
749   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
750    [Define if your system supports Mach exceptions.])
751  
752 + dnl Check if Windows exceptions are supported.
753 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
754 +  ac_cv_have_win32_exceptions, [
755 +  AC_LANG_SAVE
756 +  AC_LANG_CPLUSPLUS
757 +  AC_TRY_RUN([
758 +    #define HAVE_WIN32_EXCEPTIONS 1
759 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
760 +    #include "vm_alloc.cpp"
761 +    #include "sigsegv.cpp"
762 +  ], [
763 +  sigsegv_recovery=win32
764 +  ac_cv_have_win32_exceptions=yes
765 +  ],
766 +  ac_cv_have_win32_exceptions=no,
767 +  dnl When cross-compiling, do not assume anything.
768 +  ac_cv_have_win32_exceptions=no
769 +  )
770 +  AC_LANG_RESTORE
771 +  ]
772 + )
773 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
774 +  [Define if your system supports Windows exceptions.])
775 +
776   dnl Otherwise, check if extended signals are supported.
777   if [[ -z "$sigsegv_recovery" ]]; then
778    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 758 | Line 859 | else
859      WANT_VOSF=no
860   fi
861  
862 + dnl Check addressing mode to use
863 + AC_MSG_CHECKING([for addressing mode to use])
864 + case "$os_target" in
865 + cygwin*)
866 +  WANT_ADDRESSING_MODE="direct,cygwin-hack"
867 +  NATMEM_OFFSET=
868 +  ;;
869 + esac
870 + if [[ "$EMULATED_PPC" != "yes" ]]; then
871 +  if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
872 +    AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
873 +    WANT_ADDRESSING_MODE="real"
874 +  fi
875 + fi
876 + if [[ "$WANT_ADDRESSING_MODE" = "direct" ]]; then
877 +  if [[ -n "$NATMEM_OFFSET" ]]; then
878 +    NATMEM_OFFSET_DEF="-DNATMEM_OFFSET=$NATMEM_OFFSET"
879 +  fi
880 +  AC_LANG_SAVE
881 +  AC_LANG_CPLUSPLUS
882 +  cat confdefs.h > conftest.$ac_ext
883 +  cat >> conftest.$ac_ext << EOF
884 + #include <stdio.h>
885 + #include <string.h>
886 + #include "vm_alloc.cpp"
887 +
888 + int main(void)
889 + {
890 +        if (vm_init() < 0)
891 +                return 1;
892 +
893 +        static const struct {
894 +                unsigned long base;
895 +                unsigned int size;
896 +        } ranges[[]] = {
897 +                { 0x00000000, 0x0003000 },
898 +                { 0x10000000, 0x2000000 },
899 +                { 0x40800000, 0x0400000 },
900 +                { 0x68070000, 0x0010000 },
901 +                { 0x69000000, 0x0080000 },
902 +                { 0x68ffe000, 0x0002000 },
903 +                { 0x5fffe000, 0x0002000 },
904 +                { 0x60000000, 0x0040000 },
905 +        };
906 +        const int n_ranges = sizeof(ranges)/ sizeof(ranges[[0]]);
907 +
908 + #ifdef NATMEM_OFFSET
909 +        unsigned long ofs = NATMEM_OFFSET;
910 + #else
911 +        for (unsigned long ofs = 0x10000000; ofs <= 0x90000000; ofs += 0x10000000)
912 + #endif
913 +        for (int i = 0; i < n_ranges; i++) {
914 +                char *m = (char *)(ranges[[i]].base + ofs);
915 +                if (vm_acquire_fixed(m, ranges[[i]].size) != 0)
916 +                        break;
917 +                memset(m, 0, ranges[[i]].size);
918 +                vm_release(m, ranges[[i]].size);
919 +                if (i == n_ranges - 1) {
920 +                        printf("0x%08x\n", ofs);
921 +                        return 0;
922 +                }
923 +        }
924 +
925 +        vm_exit();
926 +        return 1;
927 + }
928 + EOF
929 +  doit='$CXX conftest.$ac_ext -o conftest.$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS $NATMEM_OFFSET_DEF >& AS_MESSAGE_LOG_FD'
930 +  if AC_TRY_EVAL(doit); then
931 +    NATMEM_OFFSET=`./conftest.$ac_exeext`
932 +  else
933 +    NATMEM_OFFSET=
934 +  fi
935 +  rm -f conftest*
936 +  AC_LANG_RESTORE
937 +
938 +  if [[ -z "$NATMEM_OFFSET" ]]; then
939 +    AC_MSG_ERROR([could not determine a sensible NATMEM_OFFSET value])
940 +  else
941 +    WANT_ADDRESSING_MODE="direct,$NATMEM_OFFSET"
942 +    AC_DEFINE_UNQUOTED(NATMEM_OFFSET, $NATMEM_OFFSET,
943 +      [Define constant offset for Mac address translation])
944 +  fi
945 + fi
946 + AC_MSG_RESULT($WANT_ADDRESSING_MODE)
947 +
948   dnl Platform specific binary postprocessor
949   AC_PATH_PROG(BLESS, "true")
950   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 791 | Line 978 | if $CXX -V -v 2>&1 | grep -q "Intel(R) C
978   fi
979   AC_MSG_RESULT($HAVE_ICC)
980  
981 < # Test if the compiler can generate ELF objects
981 > dnl Determine the generated object format
982   AC_CACHE_CHECK([whether the compiler can generate ELF objects],
983 <  ac_cv_elf_objects, [
983 >  ac_cv_object_format, [
984    echo 'int i;' > conftest.$ac_ext
985 <  ac_cv_elf_objects=no
985 >  ac_cv_object_format=no
986    if AC_TRY_EVAL(ac_compile); then
987      case `/usr/bin/file conftest.$ac_objext` in
988      *"ELF"*)
989 <      ac_cv_elf_objects=yes
989 >      ac_cv_object_format=elf
990 >      ;;
991 >    *)
992 >      ac_cv_object_format=unknown
993        ;;
994      esac
995    fi
996    rm -rf conftest*
997   ])
808 ELF_OBJECTS=$ac_cv_elf_objects
998  
999   dnl CPU emulator sources
1000   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1001    CPUSRCS="\
1002 +    ../kpx_cpu/src/mathlib/ieeefp.cpp \
1003      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1004      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1005      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 820 | Line 1010 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1010    if [[ "x$WANT_JIT" = "xyes" ]]; then
1011      AC_CACHE_CHECK([whether dyngen can be used],
1012        ac_cv_use_dyngen, [
1013 <      case $host_cpu:$ELF_OBJECTS in
1014 <      powerpc:yes)
1013 >      case $host_cpu:$ac_cv_object_format in
1014 >      powerpc:elf)
1015          ac_cv_use_dyngen=yes
1016          ;;
1017 <      x86_64:yes)
1017 >      x86_64:elf)
1018          ac_cv_use_dyngen=yes
1019          ;;
1020 <      i?86:yes)
1020 >      i?86:elf)
1021          ac_cv_use_dyngen=yes
1022          ;;
1023        *:*)
# Line 949 | Line 1139 | echo Enable video on SEGV signals .....
1139   echo ESD sound support ................ : $WANT_ESD
1140   echo GTK user interface ............... : $WANT_GTK
1141   echo mon debugger support ............. : $WANT_MON
1142 + echo Addressing mode .................. : $WANT_ADDRESSING_MODE
1143   echo Bad memory access recovery type .. : $sigsegv_recovery
1144   echo
1145   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines