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.6 by gbeauche, 2004-07-10T07:38:51Z vs.
Revision 1.11 by gbeauche, 2004-11-25T19:14:15Z

# 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])
42 + AC_ARG_ENABLE(sdl-audio,    [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
43  
44   dnl Checks for programs.
45   AC_PROG_CC
# Line 36 | 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 92 | 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)
112  
113   dnl Do we need SDL?
114   WANT_SDL=no
101 SDL_SUPPORT="none"
115   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
116    WANT_SDL=yes
117    WANT_XF86_DGA=no
118    WANT_XF86_VIDMODE=no
119    WANT_FBDEV_DGA=no
120 <  SDL_SUPPORT="video"
120 >  SDL_SUPPORT="$SDL_SUPPORT video"
121 > fi
122 > if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
123 >  WANT_SDL=yes
124 >  SDL_SUPPORT="$SDL_SUPPORT audio"
125   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    fi
150 +  SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
151 + else
152 +  SDL_SUPPORT="none"
153   fi
154  
155   dnl We need X11, if not using SDL.
# Line 222 | 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 231 | 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 287 | Line 318 | no:linux*)
318    ;;
319   esac
320  
321 + dnl Check for headers and functions related to pty support (sshpty.c)
322 + dnl From openssh-3.2.2p1 configure.ac
323 + AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
324 + AC_CHECK_FUNCS(_getpty vhangup strlcpy)
325 +
326 + case "$host" in
327 + *-*-hpux10.26)
328 +        disable_ptmx_check=yes
329 +        ;;
330 + *-*-linux*)
331 +        no_dev_ptmx=1
332 +        ;;
333 + mips-sony-bsd|mips-sony-newsos4)
334 +        AC_DEFINE(HAVE_NEWS4, 1, [Define if you are on NEWS-OS (additions from openssh-3.2.2p1, for sshpty.c).])
335 +        ;;
336 + *-*-sco3.2v4*)
337 +        no_dev_ptmx=1
338 +        ;;
339 + *-*-sco3.2v5*)
340 +        no_dev_ptmx=1
341 +        ;;
342 + *-*-cygwin*)
343 +        no_dev_ptmx=1
344 +        ;;
345 + esac
346 +
347 + if test -z "$no_dev_ptmx" ; then
348 +        if test "x$disable_ptmx_check" != "xyes" ; then
349 +                AC_CHECK_FILE([/dev/ptmx],
350 +                        [
351 +                                AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx.])
352 +                                have_dev_ptmx=1
353 +                        ]
354 +                )
355 +        fi
356 + fi
357 + AC_CHECK_FILE([/dev/ptc],
358 +        [
359 +                AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, [Define if you have /dev/ptc.])
360 +                have_dev_ptc=1
361 +        ]
362 + )
363 + dnl (end of code from openssh-3.2.2p1 configure.ac)
364 +
365   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
366   AC_DEFUN(AC_CHECK_FRAMEWORK, [
367    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
# Line 336 | Line 411 | darwin*)
411      EXTFSSRC=../MacOSX/extfs_macosx.mm
412    fi
413    ;;
414 + cygwin*)
415 +  SERIALSRC="../dummy/serial_dummy.cpp"
416 +  ;;
417   esac
418  
419   dnl SDL overrides
# Line 343 | Line 421 | if [[ "x$WANT_SDL" = "xyes" ]]; then
421    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
422   fi
423   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
346  VIDEOSRCS="../SDL/video_sdl.cpp"
424    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
425 +  VIDEOSRCS="../SDL/video_sdl.cpp"
426    KEYCODES="../SDL/keycodes"
427    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
428      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
429    else
430 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
430 >    case "$target_os" in
431 >    cygwin*)
432 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
433 >      ;;
434 >    *)
435 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
436 >      ;;
437 >    esac
438    fi
439   else
440    VIDEOSRCS="video_x.cpp"
441    KEYCODES="keycodes"
442    EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
443   fi
444 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
445 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
446 +  AUDIOSRC="../SDL/audio_sdl.cpp"
447 + fi
448  
449 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
449 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
450  
451   dnl Define a macro that translates a yesno-variable into a C macro definition
452   dnl to be put into the config.h file
# Line 661 | Line 750 | fi
750   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
751    [Define if your system supports Mach exceptions.])
752  
753 + dnl Check if Windows exceptions are supported.
754 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
755 +  ac_cv_have_win32_exceptions, [
756 +  AC_LANG_SAVE
757 +  AC_LANG_CPLUSPLUS
758 +  AC_TRY_RUN([
759 +    #define HAVE_WIN32_EXCEPTIONS 1
760 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
761 +    #include "vm_alloc.cpp"
762 +    #include "sigsegv.cpp"
763 +  ], [
764 +  sigsegv_recovery=win32
765 +  ac_cv_have_win32_exceptions=yes
766 +  ],
767 +  ac_cv_have_win32_exceptions=no,
768 +  dnl When cross-compiling, do not assume anything.
769 +  ac_cv_have_win32_exceptions=no
770 +  )
771 +  AC_LANG_RESTORE
772 +  ]
773 + )
774 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
775 +  [Define if your system supports Windows exceptions.])
776 +
777   dnl Otherwise, check if extended signals are supported.
778   if [[ -z "$sigsegv_recovery" ]]; then
779    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 747 | Line 860 | else
860      WANT_VOSF=no
861   fi
862  
863 + dnl Check addressing mode to use
864 + AC_MSG_CHECKING([for addressing mode to use])
865 + case "$os_target" in
866 + cygwin*)
867 +  WANT_ADDRESSING_MODE="direct,cygwin-hack"
868 +  NATMEM_OFFSET=
869 +  ;;
870 + esac
871 + if [[ "$EMULATED_PPC" != "yes" ]]; then
872 +  if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
873 +    AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
874 +    WANT_ADDRESSING_MODE="real"
875 +  fi
876 + fi
877 + if [[ "$WANT_ADDRESSING_MODE" = "direct" ]]; then
878 +  if [[ -n "$NATMEM_OFFSET" ]]; then
879 +    NATMEM_OFFSET_DEF="-DNATMEM_OFFSET=$NATMEM_OFFSET"
880 +  fi
881 +  AC_LANG_SAVE
882 +  AC_LANG_CPLUSPLUS
883 +  cat confdefs.h > conftest.$ac_ext
884 +  cat >> conftest.$ac_ext << EOF
885 + #include <stdio.h>
886 + #include <string.h>
887 + #include "vm_alloc.cpp"
888 +
889 + int main(void)
890 + {
891 +        if (vm_init() < 0)
892 +                return 1;
893 +
894 +        static const struct {
895 +                unsigned long base;
896 +                unsigned int size;
897 +        } ranges[[]] = {
898 +                { 0x00000000, 0x0003000 },
899 +                { 0x10000000, 0x2000000 },
900 +                { 0x40800000, 0x0400000 },
901 +                { 0x68070000, 0x0010000 },
902 +                { 0x69000000, 0x0080000 },
903 +                { 0x68ffe000, 0x0002000 },
904 +                { 0x5fffe000, 0x0002000 },
905 +                { 0x60000000, 0x0040000 },
906 +        };
907 +        const int n_ranges = sizeof(ranges)/ sizeof(ranges[[0]]);
908 +
909 + #ifdef NATMEM_OFFSET
910 +        unsigned long ofs = NATMEM_OFFSET;
911 + #else
912 +        for (unsigned long ofs = 0x10000000; ofs <= 0x90000000; ofs += 0x10000000)
913 + #endif
914 +        for (int i = 0; i < n_ranges; i++) {
915 +                char *m = (char *)(ranges[[i]].base + ofs);
916 +                if (vm_acquire_fixed(m, ranges[[i]].size) != 0)
917 +                        break;
918 +                memset(m, 0, ranges[[i]].size);
919 +                vm_release(m, ranges[[i]].size);
920 +                if (i == n_ranges - 1) {
921 +                        printf("0x%08x\n", ofs);
922 +                        return 0;
923 +                }
924 +        }
925 +
926 +        vm_exit();
927 +        return 1;
928 + }
929 + EOF
930 +  doit='$CXX conftest.$ac_ext -o conftest.$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS $NATMEM_OFFSET_DEF >& AS_MESSAGE_LOG_FD'
931 +  if AC_TRY_EVAL(doit); then
932 +    NATMEM_OFFSET=`./conftest.$ac_exeext`
933 +  else
934 +    NATMEM_OFFSET=
935 +  fi
936 +  rm -f conftest*
937 +  AC_LANG_RESTORE
938 +
939 +  if [[ -z "$NATMEM_OFFSET" ]]; then
940 +    AC_MSG_ERROR([could not determine a sensible NATMEM_OFFSET value])
941 +  else
942 +    WANT_ADDRESSING_MODE="direct,$NATMEM_OFFSET"
943 +    AC_DEFINE_UNQUOTED(NATMEM_OFFSET, $NATMEM_OFFSET,
944 +      [Define constant offset for Mac address translation])
945 +  fi
946 + fi
947 + AC_MSG_RESULT($WANT_ADDRESSING_MODE)
948 +
949   dnl Platform specific binary postprocessor
950   AC_PATH_PROG(BLESS, "true")
951   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 780 | Line 979 | if $CXX -V -v 2>&1 | grep -q "Intel(R) C
979   fi
980   AC_MSG_RESULT($HAVE_ICC)
981  
982 < # Test if the compiler can generate ELF objects
982 > dnl Determine the generated object format
983   AC_CACHE_CHECK([whether the compiler can generate ELF objects],
984 <  ac_cv_elf_objects, [
984 >  ac_cv_object_format, [
985    echo 'int i;' > conftest.$ac_ext
986 <  ac_cv_elf_objects=no
986 >  ac_cv_object_format=no
987    if AC_TRY_EVAL(ac_compile); then
988      case `/usr/bin/file conftest.$ac_objext` in
989      *"ELF"*)
990 <      ac_cv_elf_objects=yes
990 >      ac_cv_object_format=elf
991 >      ;;
992 >    *)
993 >      ac_cv_object_format=unknown
994        ;;
995      esac
996    fi
997    rm -rf conftest*
998   ])
797 ELF_OBJECTS=$ac_cv_elf_objects
999  
1000   dnl CPU emulator sources
1001   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1002    CPUSRCS="\
1003 +    ../kpx_cpu/src/mathlib/ieeefp.cpp \
1004      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1005      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1006      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 809 | Line 1011 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1011    if [[ "x$WANT_JIT" = "xyes" ]]; then
1012      AC_CACHE_CHECK([whether dyngen can be used],
1013        ac_cv_use_dyngen, [
1014 <      case $host_cpu:$ELF_OBJECTS in
1015 <      powerpc:yes)
1014 >      case $host_cpu:$ac_cv_object_format in
1015 >      powerpc:elf)
1016          ac_cv_use_dyngen=yes
1017          ;;
1018 <      x86_64:yes)
1018 >      x86_64:elf)
1019          ac_cv_use_dyngen=yes
1020          ;;
1021 <      i?86:yes)
1021 >      i?86:elf)
1022          ac_cv_use_dyngen=yes
1023          ;;
1024        *:*)
# Line 938 | Line 1140 | echo Enable video on SEGV signals .....
1140   echo ESD sound support ................ : $WANT_ESD
1141   echo GTK user interface ............... : $WANT_GTK
1142   echo mon debugger support ............. : $WANT_MON
1143 + echo Addressing mode .................. : $WANT_ADDRESSING_MODE
1144   echo Bad memory access recovery type .. : $sigsegv_recovery
1145   echo
1146   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines