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.4 by gbeauche, 2004-07-03T10:39:06Z vs.
Revision 1.16 by gbeauche, 2005-02-13T15:32:10Z

# 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])
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_PATH_PROGS(FILE, [file false])
52 + AC_PATH_PROG(PERL, [perl])
53  
54   dnl Check for PowerPC target CPU.
55   HAVE_PPC=no
# Line 92 | Line 106 | if [[ "x$WANT_MON" = "xyes" ]]; then
106      WANT_MON=no
107    fi
108   fi
109 + AC_SUBST(MONSRCS)
110  
111   dnl Checks for libraries.
112   AC_CHECK_LIB(posix4, sem_init)
113  
114   dnl Do we need SDL?
115   WANT_SDL=no
101 SDL_SUPPORT="none"
116   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
117    WANT_SDL=yes
118    WANT_XF86_DGA=no
119    WANT_XF86_VIDMODE=no
120    WANT_FBDEV_DGA=no
121 <  SDL_SUPPORT="video"
121 >  SDL_SUPPORT="$SDL_SUPPORT video"
122 > fi
123 > if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
124 >  WANT_SDL=yes
125 >  SDL_SUPPORT="$SDL_SUPPORT audio"
126   fi
127   if [[ "x$WANT_SDL" = "xyes" ]]; then
128    AC_PATH_PROG(sdl_config, "sdl-config")
129    if [[ -n "$sdl_config" ]]; then
130 <    sdl_cflags=`$sdl_config --cflags`
131 <    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
132 <      sdl_libs=`$sdl_config --static-libs`
133 <    else
134 <      sdl_libs=`$sdl_config --libs`
135 <    fi
130 >    case $target_os in
131 >    # Special treatment for Cygwin so that we can still use the POSIX layer
132 >    *cygwin*)
133 >      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
134 >      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
135 >      ;;
136 >    *)
137 >      sdl_cflags=`$sdl_config --cflags`
138 >      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
139 >        sdl_libs=`$sdl_config --static-libs`
140 >      else
141 >        sdl_libs=`$sdl_config --libs`
142 >      fi
143 >      ;;
144 >    esac
145      CFLAGS="$CFLAGS $sdl_cflags"
146      CXXFLAGS="$CXXFLAGS $sdl_cflags"
147      LIBS="$LIBS $sdl_libs"
148    else
149      WANT_SDL=no
150 +    WANT_SDL_VIDEO=no
151 +    WANT_SDL_AUDIO=no
152    fi
153 +  SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
154 + else
155 +  SDL_SUPPORT="none"
156   fi
157  
158   dnl We need X11, if not using SDL.
159 < if [[ "x$WANT_SDL" = "xno" ]]; then
159 > if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; then
160    AC_PATH_XTRA
161    if [[ "x$no_x" = "xyes" ]]; then
162      AC_MSG_ERROR([You need X11 to run SheepShaver.])
# Line 222 | Line 254 | AC_SYS_LARGEFILE
254   dnl Checks for header files.
255   AC_HEADER_STDC
256   AC_HEADER_SYS_WAIT
257 + AC_CHECK_HEADERS(malloc.h)
258   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
259   AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
260   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
# Line 231 | Line 264 | AC_CHECK_HEADERS(linux/if.h, [], [], [
264   #endif
265   ])
266   AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
267 + AC_CHECK_HEADERS(fenv.h)
268  
269   dnl Checks for typedefs, structures, and compiler characteristics.
270   AC_C_BIGENDIAN
# Line 272 | Line 306 | AC_CHECK_FUNCS(sigaction signal)
306   AC_CHECK_FUNCS(mmap mprotect munmap)
307   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
308   AC_CHECK_FUNCS(posix_memalign memalign valloc)
309 + AC_CHECK_FUNCS(exp2f log2f exp2 log2 trunc)
310  
311   dnl Darwin seems to define mach_task_self() instead of task_self().
312   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 287 | Line 322 | no:linux*)
322    ;;
323   esac
324  
325 + dnl Check for headers and functions related to pty support (sshpty.c)
326 + dnl From openssh-3.2.2p1 configure.ac
327 + AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
328 + AC_CHECK_FUNCS(_getpty vhangup strlcpy)
329 +
330 + case "$host" in
331 + *-*-hpux10.26)
332 +        disable_ptmx_check=yes
333 +        ;;
334 + *-*-linux*)
335 +        no_dev_ptmx=1
336 +        ;;
337 + mips-sony-bsd|mips-sony-newsos4)
338 +        AC_DEFINE(HAVE_NEWS4, 1, [Define if you are on NEWS-OS (additions from openssh-3.2.2p1, for sshpty.c).])
339 +        ;;
340 + *-*-sco3.2v4*)
341 +        no_dev_ptmx=1
342 +        ;;
343 + *-*-sco3.2v5*)
344 +        no_dev_ptmx=1
345 +        ;;
346 + *-*-cygwin*)
347 +        no_dev_ptmx=1
348 +        ;;
349 + esac
350 +
351 + if test -z "$no_dev_ptmx" ; then
352 +        if test "x$disable_ptmx_check" != "xyes" ; then
353 +                AC_CHECK_FILE([/dev/ptmx],
354 +                        [
355 +                                AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx.])
356 +                                have_dev_ptmx=1
357 +                        ]
358 +                )
359 +        fi
360 + fi
361 + AC_CHECK_FILE([/dev/ptc],
362 +        [
363 +                AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, [Define if you have /dev/ptc.])
364 +                have_dev_ptc=1
365 +        ]
366 + )
367 + dnl (end of code from openssh-3.2.2p1 configure.ac)
368 +
369   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
370   AC_DEFUN(AC_CHECK_FRAMEWORK, [
371    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
# Line 314 | Line 393 | SERIALSRC=serial_unix.cpp
393   ETHERSRC=../dummy/ether_dummy.cpp
394   SCSISRC=../dummy/scsi_dummy.cpp
395   AUDIOSRC=../dummy/audio_dummy.cpp
396 + EXTFSSRC=extfs_unix.cpp
397   EXTRASYSSRCS=
398   case "$target_os" in
399   linux*)
# Line 331 | Line 411 | darwin*)
411    if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
412      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
413    fi
414 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
415 +    EXTFSSRC=../MacOSX/extfs_macosx.mm
416 +  fi
417 +  ;;
418 + cygwin*)
419 +  SERIALSRC="../dummy/serial_dummy.cpp"
420    ;;
421   esac
422  
# Line 339 | Line 425 | if [[ "x$WANT_SDL" = "xyes" ]]; then
425    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
426   fi
427   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
342  VIDEOSRCS="../SDL/video_sdl.cpp"
428    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
429 +  VIDEOSRCS="../SDL/video_sdl.cpp"
430    KEYCODES="../SDL/keycodes"
431    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
432      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
433    else
434 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
434 >    case "$target_os" in
435 >    cygwin*)
436 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
437 >      ;;
438 >    *)
439 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
440 >      ;;
441 >    esac
442    fi
443   else
444    VIDEOSRCS="video_x.cpp"
445    KEYCODES="keycodes"
446    EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
447   fi
448 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
449 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
450 +  AUDIOSRC="../SDL/audio_sdl.cpp"
451 + fi
452  
453 < SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
453 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
454  
455   dnl Define a macro that translates a yesno-variable into a C macro definition
456   dnl to be put into the config.h file
# Line 657 | Line 754 | fi
754   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
755    [Define if your system supports Mach exceptions.])
756  
757 + dnl Check if Windows exceptions are supported.
758 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
759 +  ac_cv_have_win32_exceptions, [
760 +  AC_LANG_SAVE
761 +  AC_LANG_CPLUSPLUS
762 +  AC_TRY_RUN([
763 +    #define HAVE_WIN32_EXCEPTIONS 1
764 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
765 +    #include "vm_alloc.cpp"
766 +    #include "sigsegv.cpp"
767 +  ], [
768 +  sigsegv_recovery=win32
769 +  ac_cv_have_win32_exceptions=yes
770 +  ],
771 +  ac_cv_have_win32_exceptions=no,
772 +  dnl When cross-compiling, do not assume anything.
773 +  ac_cv_have_win32_exceptions=no
774 +  )
775 +  AC_LANG_RESTORE
776 +  ]
777 + )
778 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
779 +  [Define if your system supports Windows exceptions.])
780 +
781   dnl Otherwise, check if extended signals are supported.
782   if [[ -z "$sigsegv_recovery" ]]; then
783    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 743 | Line 864 | else
864      WANT_VOSF=no
865   fi
866  
867 + dnl Check addressing mode to use
868 + AC_MSG_CHECKING([for addressing mode to use])
869 + case "$os_target" in
870 + cygwin*)
871 +  WANT_ADDRESSING_MODE="direct,cygwin-hack"
872 +  NATMEM_OFFSET=
873 +  ;;
874 + esac
875 + if [[ "$EMULATED_PPC" != "yes" ]]; then
876 +  if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
877 +    AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
878 +    WANT_ADDRESSING_MODE="real"
879 +  fi
880 + fi
881 + if [[ "$WANT_ADDRESSING_MODE" = "direct" ]]; then
882 +  if [[ -n "$NATMEM_OFFSET" ]]; then
883 +    NATMEM_OFFSET_DEF="-DNATMEM_OFFSET=$NATMEM_OFFSET"
884 +  fi
885 +  AC_LANG_SAVE
886 +  AC_LANG_CPLUSPLUS
887 +  cat confdefs.h > conftest.$ac_ext
888 +  cat >> conftest.$ac_ext << EOF
889 + #include <stdio.h>
890 + #include <string.h>
891 + #include "vm_alloc.cpp"
892 +
893 + int main(void)
894 + {
895 +        if (vm_init() < 0)
896 +                return 1;
897 +
898 +        static const struct {
899 +                unsigned long base;
900 +                unsigned int size;
901 +        } ranges[[]] = {
902 +                { 0x00000000, 0x0003000 },
903 +                { 0x10000000, 0x2000000 },
904 +                { 0x40800000, 0x0400000 },
905 +                { 0x68070000, 0x0010000 },
906 +                { 0x69000000, 0x0080000 },
907 +                { 0x68ffe000, 0x0002000 },
908 +                { 0x5fffe000, 0x0002000 },
909 +                { 0x60000000, 0x0040000 },
910 +        };
911 +        const int n_ranges = sizeof(ranges)/ sizeof(ranges[[0]]);
912 +
913 + #ifdef NATMEM_OFFSET
914 +        unsigned long ofs = NATMEM_OFFSET;
915 + #else
916 +        for (unsigned long ofs = 0x10000000; ofs <= 0x90000000; ofs += 0x10000000)
917 + #endif
918 +        for (int i = 0; i < n_ranges; i++) {
919 +                char *m = (char *)(ranges[[i]].base + ofs);
920 +                if (vm_acquire_fixed(m, ranges[[i]].size) != 0)
921 +                        break;
922 +                memset(m, 0, ranges[[i]].size);
923 +                vm_release(m, ranges[[i]].size);
924 +                if (i == n_ranges - 1) {
925 +                        if (sizeof(void *) == 8 && ofs > 0xffffffff)
926 +                                printf("0x%lxul\n", ofs);
927 +                        else
928 +                                printf("0x%08x\n", ofs);
929 +                        return 0;
930 +                }
931 +        }
932 +
933 +        vm_exit();
934 +        return 1;
935 + }
936 + EOF
937 +  doit='$CXX conftest.$ac_ext -o conftest.$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS $NATMEM_OFFSET_DEF >& AS_MESSAGE_LOG_FD'
938 +  if AC_TRY_EVAL(doit); then
939 +    NATMEM_OFFSET=`./conftest.$ac_exeext`
940 +  else
941 +    NATMEM_OFFSET=
942 +  fi
943 +  rm -f conftest*
944 +  AC_LANG_RESTORE
945 +
946 +  if [[ -z "$NATMEM_OFFSET" ]]; then
947 +    AC_MSG_ERROR([could not determine a sensible NATMEM_OFFSET value])
948 +  else
949 +    WANT_ADDRESSING_MODE="direct,$NATMEM_OFFSET"
950 +    AC_DEFINE_UNQUOTED(NATMEM_OFFSET, $NATMEM_OFFSET,
951 +      [Define constant offset for Mac address translation])
952 +  fi
953 + fi
954 + AC_MSG_RESULT($WANT_ADDRESSING_MODE)
955 +
956   dnl Platform specific binary postprocessor
957   AC_PATH_PROG(BLESS, "true")
958   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 776 | Line 986 | if $CXX -V -v 2>&1 | grep -q "Intel(R) C
986   fi
987   AC_MSG_RESULT($HAVE_ICC)
988  
989 < # Test if the compiler can generate ELF objects
989 > dnl Determine the generated object format
990   AC_CACHE_CHECK([whether the compiler can generate ELF objects],
991 <  ac_cv_elf_objects, [
991 >  ac_cv_object_format, [
992    echo 'int i;' > conftest.$ac_ext
993 <  ac_cv_elf_objects=no
993 >  ac_cv_object_format=no
994    if AC_TRY_EVAL(ac_compile); then
995      case `/usr/bin/file conftest.$ac_objext` in
996      *"ELF"*)
997 <      ac_cv_elf_objects=yes
997 >      ac_cv_object_format=elf
998 >      ;;
999 >    *)
1000 >      ac_cv_object_format=unknown
1001        ;;
1002      esac
1003    fi
1004    rm -rf conftest*
1005   ])
793 ELF_OBJECTS=$ac_cv_elf_objects
1006  
1007   dnl CPU emulator sources
1008   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1009    CPUSRCS="\
1010 +    ../kpx_cpu/src/mathlib/ieeefp.cpp \
1011      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1012      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1013      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 805 | Line 1018 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1018    if [[ "x$WANT_JIT" = "xyes" ]]; then
1019      AC_CACHE_CHECK([whether dyngen can be used],
1020        ac_cv_use_dyngen, [
1021 <      case $host_cpu:$ELF_OBJECTS in
1022 <      powerpc:yes)
1021 >      case $host_cpu:$ac_cv_object_format in
1022 >      powerpc:elf)
1023          ac_cv_use_dyngen=yes
1024          ;;
1025 <      x86_64:yes)
1025 >      x86_64:elf)
1026          ac_cv_use_dyngen=yes
1027          ;;
1028 <      i?86:yes)
1028 >      i?86:elf)
1029          ac_cv_use_dyngen=yes
1030          ;;
1031        *:*)
# Line 858 | Line 1071 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1071          AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1072          ;;
1073        esac
1074 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
1074 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -g0"
1075        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1076          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1077        fi
# Line 900 | Line 1113 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1113      ac_cv_have_static_data_exec=no
1114      )
1115    ])
1116 + else
1117 +  ac_cv_use_dyngen=no
1118   fi
1119   AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1120    [Define if your system marks static data pages as executable.])
# Line 909 | Line 1124 | if [[ "x$WANT_JIT" = "xyes" ]]; then
1124   fi
1125  
1126   dnl Generate Makefile.
1127 + AC_SUBST(PERL)
1128 + AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1129   AC_SUBST(DYNGENSRCS)
1130   AC_SUBST(DYNGEN_CC)
1131   AC_SUBST(DYNGEN_OP_FLAGS)
# Line 916 | Line 1133 | AC_SUBST(SYSSRCS)
1133   AC_SUBST(CPUSRCS)
1134   AC_SUBST(BLESS)
1135   AC_SUBST(KEYCODES)
1136 < AC_OUTPUT(Makefile)
1136 > AC_OUTPUT([
1137 > Makefile
1138 > ../MacOSX/Info.plist
1139 > ])
1140  
1141   dnl Print summary.
1142   echo
# Line 931 | Line 1151 | echo Enable video on SEGV signals .....
1151   echo ESD sound support ................ : $WANT_ESD
1152   echo GTK user interface ............... : $WANT_GTK
1153   echo mon debugger support ............. : $WANT_MON
1154 + echo Addressing mode .................. : $WANT_ADDRESSING_MODE
1155   echo Bad memory access recovery type .. : $sigsegv_recovery
1156   echo
1157   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines