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.12 by gbeauche, 2004-12-18T23:45:33Z

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines