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.15 by gbeauche, 2005-01-19T20:26:01Z

# 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]]*\([[UuLl]]\{1,2\}\)\?\)$/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"
147    else
148      WANT_SDL=no
149 +    WANT_SDL_VIDEO=no
150 +    WANT_SDL_AUDIO=no
151    fi
152    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
153   else
# Line 131 | Line 155 | else
155   fi
156  
157   dnl We need X11, if not using SDL.
158 < if [[ "x$WANT_SDL" = "xno" ]]; then
158 > if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; then
159    AC_PATH_XTRA
160    if [[ "x$no_x" = "xyes" ]]; then
161      AC_MSG_ERROR([You need X11 to run SheepShaver.])
# Line 229 | Line 253 | AC_SYS_LARGEFILE
253   dnl Checks for header files.
254   AC_HEADER_STDC
255   AC_HEADER_SYS_WAIT
256 + AC_CHECK_HEADERS(malloc.h)
257   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
258   AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
259   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
# Line 238 | Line 263 | AC_CHECK_HEADERS(linux/if.h, [], [], [
263   #endif
264   ])
265   AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
266 + AC_CHECK_HEADERS(fenv.h)
267  
268   dnl Checks for typedefs, structures, and compiler characteristics.
269   AC_C_BIGENDIAN
# Line 279 | Line 305 | AC_CHECK_FUNCS(sigaction signal)
305   AC_CHECK_FUNCS(mmap mprotect munmap)
306   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
307   AC_CHECK_FUNCS(posix_memalign memalign valloc)
308 + AC_CHECK_FUNCS(exp2f log2f exp2 log2)
309  
310   dnl Darwin seems to define mach_task_self() instead of task_self().
311   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 294 | Line 321 | no:linux*)
321    ;;
322   esac
323  
324 + dnl Check for headers and functions related to pty support (sshpty.c)
325 + dnl From openssh-3.2.2p1 configure.ac
326 + AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
327 + AC_CHECK_FUNCS(_getpty vhangup strlcpy)
328 +
329 + case "$host" in
330 + *-*-hpux10.26)
331 +        disable_ptmx_check=yes
332 +        ;;
333 + *-*-linux*)
334 +        no_dev_ptmx=1
335 +        ;;
336 + mips-sony-bsd|mips-sony-newsos4)
337 +        AC_DEFINE(HAVE_NEWS4, 1, [Define if you are on NEWS-OS (additions from openssh-3.2.2p1, for sshpty.c).])
338 +        ;;
339 + *-*-sco3.2v4*)
340 +        no_dev_ptmx=1
341 +        ;;
342 + *-*-sco3.2v5*)
343 +        no_dev_ptmx=1
344 +        ;;
345 + *-*-cygwin*)
346 +        no_dev_ptmx=1
347 +        ;;
348 + esac
349 +
350 + if test -z "$no_dev_ptmx" ; then
351 +        if test "x$disable_ptmx_check" != "xyes" ; then
352 +                AC_CHECK_FILE([/dev/ptmx],
353 +                        [
354 +                                AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx.])
355 +                                have_dev_ptmx=1
356 +                        ]
357 +                )
358 +        fi
359 + fi
360 + AC_CHECK_FILE([/dev/ptc],
361 +        [
362 +                AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, [Define if you have /dev/ptc.])
363 +                have_dev_ptc=1
364 +        ]
365 + )
366 + dnl (end of code from openssh-3.2.2p1 configure.ac)
367 +
368   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
369   AC_DEFUN(AC_CHECK_FRAMEWORK, [
370    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
# Line 343 | Line 414 | darwin*)
414      EXTFSSRC=../MacOSX/extfs_macosx.mm
415    fi
416    ;;
417 + cygwin*)
418 +  SERIALSRC="../dummy/serial_dummy.cpp"
419 +  ;;
420   esac
421  
422   dnl SDL overrides
# Line 356 | Line 430 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
430    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
431      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
432    else
433 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
433 >    case "$target_os" in
434 >    cygwin*)
435 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
436 >      ;;
437 >    *)
438 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
439 >      ;;
440 >    esac
441    fi
442   else
443    VIDEOSRCS="video_x.cpp"
# Line 368 | Line 449 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
449    AUDIOSRC="../SDL/audio_sdl.cpp"
450   fi
451  
452 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
452 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
453  
454   dnl Define a macro that translates a yesno-variable into a C macro definition
455   dnl to be put into the config.h file
# Line 672 | Line 753 | fi
753   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
754    [Define if your system supports Mach exceptions.])
755  
756 + dnl Check if Windows exceptions are supported.
757 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
758 +  ac_cv_have_win32_exceptions, [
759 +  AC_LANG_SAVE
760 +  AC_LANG_CPLUSPLUS
761 +  AC_TRY_RUN([
762 +    #define HAVE_WIN32_EXCEPTIONS 1
763 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
764 +    #include "vm_alloc.cpp"
765 +    #include "sigsegv.cpp"
766 +  ], [
767 +  sigsegv_recovery=win32
768 +  ac_cv_have_win32_exceptions=yes
769 +  ],
770 +  ac_cv_have_win32_exceptions=no,
771 +  dnl When cross-compiling, do not assume anything.
772 +  ac_cv_have_win32_exceptions=no
773 +  )
774 +  AC_LANG_RESTORE
775 +  ]
776 + )
777 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
778 +  [Define if your system supports Windows exceptions.])
779 +
780   dnl Otherwise, check if extended signals are supported.
781   if [[ -z "$sigsegv_recovery" ]]; then
782    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 758 | Line 863 | else
863      WANT_VOSF=no
864   fi
865  
866 + dnl Check addressing mode to use
867 + AC_MSG_CHECKING([for addressing mode to use])
868 + case "$os_target" in
869 + cygwin*)
870 +  WANT_ADDRESSING_MODE="direct,cygwin-hack"
871 +  NATMEM_OFFSET=
872 +  ;;
873 + esac
874 + if [[ "$EMULATED_PPC" != "yes" ]]; then
875 +  if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
876 +    AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
877 +    WANT_ADDRESSING_MODE="real"
878 +  fi
879 + fi
880 + if [[ "$WANT_ADDRESSING_MODE" = "direct" ]]; then
881 +  if [[ -n "$NATMEM_OFFSET" ]]; then
882 +    NATMEM_OFFSET_DEF="-DNATMEM_OFFSET=$NATMEM_OFFSET"
883 +  fi
884 +  AC_LANG_SAVE
885 +  AC_LANG_CPLUSPLUS
886 +  cat confdefs.h > conftest.$ac_ext
887 +  cat >> conftest.$ac_ext << EOF
888 + #include <stdio.h>
889 + #include <string.h>
890 + #include "vm_alloc.cpp"
891 +
892 + int main(void)
893 + {
894 +        if (vm_init() < 0)
895 +                return 1;
896 +
897 +        static const struct {
898 +                unsigned long base;
899 +                unsigned int size;
900 +        } ranges[[]] = {
901 +                { 0x00000000, 0x0003000 },
902 +                { 0x10000000, 0x2000000 },
903 +                { 0x40800000, 0x0400000 },
904 +                { 0x68070000, 0x0010000 },
905 +                { 0x69000000, 0x0080000 },
906 +                { 0x68ffe000, 0x0002000 },
907 +                { 0x5fffe000, 0x0002000 },
908 +                { 0x60000000, 0x0040000 },
909 +        };
910 +        const int n_ranges = sizeof(ranges)/ sizeof(ranges[[0]]);
911 +
912 + #ifdef NATMEM_OFFSET
913 +        unsigned long ofs = NATMEM_OFFSET;
914 + #else
915 +        for (unsigned long ofs = 0x10000000; ofs <= 0x90000000; ofs += 0x10000000)
916 + #endif
917 +        for (int i = 0; i < n_ranges; i++) {
918 +                char *m = (char *)(ranges[[i]].base + ofs);
919 +                if (vm_acquire_fixed(m, ranges[[i]].size) != 0)
920 +                        break;
921 +                memset(m, 0, ranges[[i]].size);
922 +                vm_release(m, ranges[[i]].size);
923 +                if (i == n_ranges - 1) {
924 +                        if (sizeof(void *) == 8 && ofs > 0xffffffff)
925 +                                printf("0x%lxul\n", ofs);
926 +                        else
927 +                                printf("0x%08x\n", ofs);
928 +                        return 0;
929 +                }
930 +        }
931 +
932 +        vm_exit();
933 +        return 1;
934 + }
935 + EOF
936 +  doit='$CXX conftest.$ac_ext -o conftest.$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS $NATMEM_OFFSET_DEF >& AS_MESSAGE_LOG_FD'
937 +  if AC_TRY_EVAL(doit); then
938 +    NATMEM_OFFSET=`./conftest.$ac_exeext`
939 +  else
940 +    NATMEM_OFFSET=
941 +  fi
942 +  rm -f conftest*
943 +  AC_LANG_RESTORE
944 +
945 +  if [[ -z "$NATMEM_OFFSET" ]]; then
946 +    AC_MSG_ERROR([could not determine a sensible NATMEM_OFFSET value])
947 +  else
948 +    WANT_ADDRESSING_MODE="direct,$NATMEM_OFFSET"
949 +    AC_DEFINE_UNQUOTED(NATMEM_OFFSET, $NATMEM_OFFSET,
950 +      [Define constant offset for Mac address translation])
951 +  fi
952 + fi
953 + AC_MSG_RESULT($WANT_ADDRESSING_MODE)
954 +
955   dnl Platform specific binary postprocessor
956   AC_PATH_PROG(BLESS, "true")
957   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 791 | Line 985 | if $CXX -V -v 2>&1 | grep -q "Intel(R) C
985   fi
986   AC_MSG_RESULT($HAVE_ICC)
987  
988 < # Test if the compiler can generate ELF objects
988 > dnl Determine the generated object format
989   AC_CACHE_CHECK([whether the compiler can generate ELF objects],
990 <  ac_cv_elf_objects, [
990 >  ac_cv_object_format, [
991    echo 'int i;' > conftest.$ac_ext
992 <  ac_cv_elf_objects=no
992 >  ac_cv_object_format=no
993    if AC_TRY_EVAL(ac_compile); then
994      case `/usr/bin/file conftest.$ac_objext` in
995      *"ELF"*)
996 <      ac_cv_elf_objects=yes
996 >      ac_cv_object_format=elf
997 >      ;;
998 >    *)
999 >      ac_cv_object_format=unknown
1000        ;;
1001      esac
1002    fi
1003    rm -rf conftest*
1004   ])
808 ELF_OBJECTS=$ac_cv_elf_objects
1005  
1006   dnl CPU emulator sources
1007   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1008    CPUSRCS="\
1009 +    ../kpx_cpu/src/mathlib/ieeefp.cpp \
1010      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1011      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1012      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 820 | Line 1017 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1017    if [[ "x$WANT_JIT" = "xyes" ]]; then
1018      AC_CACHE_CHECK([whether dyngen can be used],
1019        ac_cv_use_dyngen, [
1020 <      case $host_cpu:$ELF_OBJECTS in
1021 <      powerpc:yes)
1020 >      case $host_cpu:$ac_cv_object_format in
1021 >      powerpc:elf)
1022          ac_cv_use_dyngen=yes
1023          ;;
1024 <      x86_64:yes)
1024 >      x86_64:elf)
1025          ac_cv_use_dyngen=yes
1026          ;;
1027 <      i?86:yes)
1027 >      i?86:elf)
1028          ac_cv_use_dyngen=yes
1029          ;;
1030        *:*)
# Line 915 | Line 1112 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1112      ac_cv_have_static_data_exec=no
1113      )
1114    ])
1115 + else
1116 +  ac_cv_use_dyngen=no
1117   fi
1118   AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1119    [Define if your system marks static data pages as executable.])
# Line 924 | Line 1123 | if [[ "x$WANT_JIT" = "xyes" ]]; then
1123   fi
1124  
1125   dnl Generate Makefile.
1126 + AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1127   AC_SUBST(DYNGENSRCS)
1128   AC_SUBST(DYNGEN_CC)
1129   AC_SUBST(DYNGEN_OP_FLAGS)
# Line 949 | Line 1149 | echo Enable video on SEGV signals .....
1149   echo ESD sound support ................ : $WANT_ESD
1150   echo GTK user interface ............... : $WANT_GTK
1151   echo mon debugger support ............. : $WANT_MON
1152 + echo Addressing mode .................. : $WANT_ADDRESSING_MODE
1153   echo Bad memory access recovery type .. : $sigsegv_recovery
1154   echo
1155   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines