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.30 by gbeauche, 2005-06-30T10:17:58Z

# Line 17 | Line 17 | ulimit -c 0
17   dnl Options.
18   AC_ARG_ENABLE(jit,          [  --enable-jit            enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
19   AC_ARG_ENABLE(ppc-emulator, [  --enable-ppc-emulator   use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto])
20 + AC_ARG_ENABLE(fbdev-dga,    [  --enable-fbdev-dga      use direct frame buffer access via /dev/fb0 [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes])
21   AC_ARG_ENABLE(xf86-dga,     [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
22 < AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=no]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=no])
22 > AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
23   AC_ARG_ENABLE(vosf,         [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
24   AC_ARG_WITH(esd,            [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
25 < AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
25 > AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]],
26 >  [case "$withval" in
27 >   gtk1)      WANT_GTK="gtk";;
28 >   gtk|gtk2)  WANT_GTK="$withval";;
29 >   yes)       WANT_GTK="gtk2 gtk";;
30 >   *)         WANT_GTK="no";;
31 >   esac],
32 >  [WANT_GTK="gtk2 gtk"])
33   AC_ARG_WITH(mon,            [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
34   AC_ARG_WITH(dgcc,           [  --with-dgcc=COMPILER    use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval])
35  
36 + dnl Addressing mode
37 + AC_ARG_ENABLE(addressing,
38 +  [  --enable-addressing=AM  set the addressing mode to use [default=real]],
39 +  [case "$enableval" in
40 +   real)        WANT_ADDRESSING_MODE="real";;
41 +   direct)      WANT_ADDRESSING_MODE="direct";;
42 +   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'`;;
43 +   esac],
44 +  [WANT_ADDRESSING_MODE="real"]
45 + )
46 +
47   dnl SDL options.
48   AC_ARG_ENABLE(sdl-static,   [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
49   AC_ARG_ENABLE(sdl-video,    [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
50 + AC_ARG_ENABLE(sdl-audio,    [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
51  
52   dnl Checks for programs.
53   AC_PROG_CC
# Line 36 | Line 56 | AC_PROG_CXX
56   AC_PROG_MAKE_SET
57   AC_PROG_INSTALL
58   AC_PROG_EGREP
59 + AC_PATH_PROGS(FILE, [file false])
60 + AC_PATH_PROG(PERL, [perl])
61  
62   dnl Check for PowerPC target CPU.
63   HAVE_PPC=no
# Line 92 | Line 114 | if [[ "x$WANT_MON" = "xyes" ]]; then
114      WANT_MON=no
115    fi
116   fi
117 + AC_SUBST(MONSRCS)
118  
119   dnl Checks for libraries.
120   AC_CHECK_LIB(posix4, sem_init)
121  
122   dnl Do we need SDL?
123   WANT_SDL=no
101 SDL_SUPPORT="none"
124   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
125    WANT_SDL=yes
126    WANT_XF86_DGA=no
127    WANT_XF86_VIDMODE=no
128    WANT_FBDEV_DGA=no
129 <  SDL_SUPPORT="video"
129 >  SDL_SUPPORT="$SDL_SUPPORT video"
130 > fi
131 > if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
132 >  WANT_SDL=yes
133 >  SDL_SUPPORT="$SDL_SUPPORT audio"
134   fi
135   if [[ "x$WANT_SDL" = "xyes" ]]; then
136    AC_PATH_PROG(sdl_config, "sdl-config")
137    if [[ -n "$sdl_config" ]]; then
138 <    sdl_cflags=`$sdl_config --cflags`
139 <    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
140 <      sdl_libs=`$sdl_config --static-libs`
141 <    else
142 <      sdl_libs=`$sdl_config --libs`
143 <    fi
138 >    case $target_os in
139 >    # Special treatment for Cygwin so that we can still use the POSIX layer
140 >    *cygwin*)
141 >      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
142 >      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
143 >      ;;
144 >    *)
145 >      sdl_cflags=`$sdl_config --cflags`
146 >      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
147 >        sdl_libs=`$sdl_config --static-libs`
148 >      else
149 >        sdl_libs=`$sdl_config --libs`
150 >      fi
151 >      ;;
152 >    esac
153      CFLAGS="$CFLAGS $sdl_cflags"
154      CXXFLAGS="$CXXFLAGS $sdl_cflags"
155      LIBS="$LIBS $sdl_libs"
156    else
157      WANT_SDL=no
158 +    WANT_SDL_VIDEO=no
159 +    WANT_SDL_AUDIO=no
160    fi
161 +  SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
162 + else
163 +  SDL_SUPPORT="none"
164   fi
165  
166   dnl We need X11, if not using SDL.
167 < if [[ "x$WANT_SDL" = "xno" ]]; then
167 > if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; then
168    AC_PATH_XTRA
169    if [[ "x$no_x" = "xyes" ]]; then
170      AC_MSG_ERROR([You need X11 to run SheepShaver.])
# Line 137 | Line 177 | fi
177   dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
178   HAVE_PTHREADS=yes
179   case $EMULATED_PPC:$target_os in
180 < no:linux*)
180 > no:linux*|no:netbsd*)
181    dnl We do have our own pthread_cancel() implementation
182    AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Define if you have the pthread_cancel function.])
183    ;;
# Line 145 | Line 185 | no:linux*)
185    AC_CHECK_LIB(pthread, pthread_create, , [
186      AC_CHECK_LIB(c_r, pthread_create, , [
187        AC_CHECK_LIB(PTL, pthread_create, , [
188 <        AC_MSG_ERROR([You need pthreads to run Basilisk II.])
188 >        dnl XXX remove when no pthreads case is merged
189 >        AC_MSG_ERROR([You need pthreads to run SheepShaver.])
190 >        HAVE_PTHREADS=no
191        ])
192      ])
193    ])
194    AC_CHECK_FUNCS(pthread_cancel)
195 +  AC_CHECK_FUNCS(pthread_cond_init)
196    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
197    AC_CHECK_FUNCS(pthread_mutexattr_settype)
198    AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
156  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
157    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
158  fi
199    dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
200    SEMSRC=
201    AC_CHECK_FUNCS(sem_init, , [
# Line 165 | Line 205 | no:linux*)
205    ])
206    ;;
207   esac
208 + if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
209 +  AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
210 + fi
211 +
212 + dnl We use FBDev DGA if possible.
213 + if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
214 +  AC_CHECK_HEADER(linux/fb.h, [
215 +    AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using Linux fbdev extension.])
216 +  ], [
217 +    AC_MSG_WARN([Could not find Linux FBDev extension, ignoring --enable-fbdev-dga.])
218 +    WANT_FBDEV_DGA=no
219 +  ])
220 + fi
221  
222   dnl We use XFree86 DGA if possible.
223   if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
# Line 190 | Line 243 | fi
243  
244   dnl We use GTK+ if possible.
245   UISRCS=../dummy/prefs_editor_dummy.cpp
246 < if [[ "x$WANT_GTK" = "xyes" ]]; then
246 > case "x$WANT_GTK" in
247 > xgtk2*)
248 >  AM_PATH_GTK_2_0(1.3.15, [
249 >    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
250 >    CFLAGS="$CFLAGS $GTK_CFLAGS"
251 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
252 >    LIBS="$LIBS $GTK_LIBS"
253 >    UISRCS=prefs_editor_gtk.cpp
254 >    WANT_GTK=gtk2
255 >  ], [
256 >    case "x${WANT_GTK}x" in
257 >    *gtkx)
258 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
259 >      WANT_GTK=gtk
260 >      ;;
261 >    *)
262 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
263 >      WANT_GTK=no
264 >      ;;
265 >    esac
266 >  ])
267 >  ;;
268 > esac
269 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
270    AM_PATH_GTK(1.2.0, [
271      AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
272      CFLAGS="$CFLAGS $GTK_CFLAGS"
# Line 222 | Line 298 | AC_SYS_LARGEFILE
298   dnl Checks for header files.
299   AC_HEADER_STDC
300   AC_HEADER_SYS_WAIT
301 + AC_CHECK_HEADERS(malloc.h)
302   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
303   AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
304   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
# Line 231 | Line 308 | AC_CHECK_HEADERS(linux/if.h, [], [], [
308   #endif
309   ])
310   AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
311 + AC_CHECK_HEADERS(fenv.h)
312  
313   dnl Checks for typedefs, structures, and compiler characteristics.
314   AC_C_BIGENDIAN
# Line 271 | Line 349 | AC_CHECK_FUNCS(nanosleep)
349   AC_CHECK_FUNCS(sigaction signal)
350   AC_CHECK_FUNCS(mmap mprotect munmap)
351   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
352 < AC_CHECK_FUNCS(posix_memalign memalign valloc)
352 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
353 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
354  
355   dnl Darwin seems to define mach_task_self() instead of task_self().
356   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 283 | Line 362 | no:linux*)
362    ;;
363   *:*)
364    AC_SEARCH_LIBS(clock_gettime, [rt posix4])
365 <  AC_CHECK_FUNCS(clock_gettime)
365 >  AC_CHECK_FUNCS(clock_gettime clock_nanosleep)
366    ;;
367   esac
368  
369 + dnl Check for headers and functions related to pty support (sshpty.c)
370 + dnl From openssh-3.2.2p1 configure.ac
371 + AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
372 + AC_CHECK_FUNCS(_getpty vhangup strlcpy)
373 +
374 + case "$host" in
375 + *-*-hpux10.26)
376 +        disable_ptmx_check=yes
377 +        ;;
378 + *-*-linux*)
379 +        no_dev_ptmx=1
380 +        ;;
381 + mips-sony-bsd|mips-sony-newsos4)
382 +        AC_DEFINE(HAVE_NEWS4, 1, [Define if you are on NEWS-OS (additions from openssh-3.2.2p1, for sshpty.c).])
383 +        ;;
384 + *-*-sco3.2v4*)
385 +        no_dev_ptmx=1
386 +        ;;
387 + *-*-sco3.2v5*)
388 +        no_dev_ptmx=1
389 +        ;;
390 + *-*-cygwin*)
391 +        no_dev_ptmx=1
392 +        ;;
393 + esac
394 +
395 + if test -z "$no_dev_ptmx" ; then
396 +        if test "x$disable_ptmx_check" != "xyes" ; then
397 +                AC_CHECK_FILE([/dev/ptmx],
398 +                        [
399 +                                AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx.])
400 +                                have_dev_ptmx=1
401 +                        ]
402 +                )
403 +        fi
404 + fi
405 + AC_CHECK_FILE([/dev/ptc],
406 +        [
407 +                AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, [Define if you have /dev/ptc.])
408 +                have_dev_ptc=1
409 +        ]
410 + )
411 + dnl (end of code from openssh-3.2.2p1 configure.ac)
412 +
413   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
414   AC_DEFUN(AC_CHECK_FRAMEWORK, [
415    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
# Line 322 | Line 445 | linux*)
445    AUDIOSRC=audio_oss_esd.cpp
446    SCSISRC=Linux/scsi_linux.cpp
447    if [[ "x$EMULATED_PPC" = "xno" ]]; then
448 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
448 >    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
449 >  fi
450 >  ;;
451 > netbsd*)
452 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
453 >    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
454    fi
455    ;;
456   darwin*)
457    if [[ "x$EMULATED_PPC" = "xno" ]]; then
458 <    EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S"
458 >    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
459    fi
460    if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
461      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
# Line 336 | Line 464 | darwin*)
464      EXTFSSRC=../MacOSX/extfs_macosx.mm
465    fi
466    ;;
467 + cygwin*)
468 +  SERIALSRC="../dummy/serial_dummy.cpp"
469 +  ;;
470   esac
471  
472   dnl SDL overrides
# Line 343 | Line 474 | if [[ "x$WANT_SDL" = "xyes" ]]; then
474    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
475   fi
476   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
346  VIDEOSRCS="../SDL/video_sdl.cpp"
477    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
478 +  VIDEOSRCS="../SDL/video_sdl.cpp"
479    KEYCODES="../SDL/keycodes"
480    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
481      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
482    else
483 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
483 >    case "$target_os" in
484 >    cygwin*)
485 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
486 >      ;;
487 >    *)
488 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
489 >      ;;
490 >    esac
491    fi
492   else
493    VIDEOSRCS="video_x.cpp"
494    KEYCODES="keycodes"
495    EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
496   fi
497 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
498 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
499 +  AUDIOSRC="../SDL/audio_sdl.cpp"
500 + fi
501  
502 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
502 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
503  
504   dnl Define a macro that translates a yesno-variable into a C macro definition
505   dnl to be put into the config.h file
# Line 661 | Line 803 | fi
803   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
804    [Define if your system supports Mach exceptions.])
805  
806 + dnl Check if Windows exceptions are supported.
807 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
808 +  ac_cv_have_win32_exceptions, [
809 +  AC_LANG_SAVE
810 +  AC_LANG_CPLUSPLUS
811 +  AC_TRY_RUN([
812 +    #define HAVE_WIN32_EXCEPTIONS 1
813 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
814 +    #include "vm_alloc.cpp"
815 +    #include "sigsegv.cpp"
816 +  ], [
817 +  sigsegv_recovery=win32
818 +  ac_cv_have_win32_exceptions=yes
819 +  ],
820 +  ac_cv_have_win32_exceptions=no,
821 +  dnl When cross-compiling, do not assume anything.
822 +  ac_cv_have_win32_exceptions=no
823 +  )
824 +  AC_LANG_RESTORE
825 +  ]
826 + )
827 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
828 +  [Define if your system supports Windows exceptions.])
829 +
830   dnl Otherwise, check if extended signals are supported.
831   if [[ -z "$sigsegv_recovery" ]]; then
832    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 747 | Line 913 | else
913      WANT_VOSF=no
914   fi
915  
916 + dnl Check addressing mode to use
917 + AC_MSG_CHECKING([for addressing mode to use])
918 + case "$os_target" in
919 + cygwin*)
920 +  WANT_ADDRESSING_MODE="direct,cygwin-hack"
921 +  NATMEM_OFFSET=
922 +  ;;
923 + esac
924 + if [[ "$EMULATED_PPC" != "yes" ]]; then
925 +  if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
926 +    AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
927 +    WANT_ADDRESSING_MODE="real"
928 +  fi
929 + fi
930 + if [[ "$WANT_ADDRESSING_MODE" = "direct" ]]; then
931 +  if [[ -n "$NATMEM_OFFSET" ]]; then
932 +    NATMEM_OFFSET_DEF="-DNATMEM_OFFSET=$NATMEM_OFFSET"
933 +  fi
934 +  AC_LANG_SAVE
935 +  AC_LANG_CPLUSPLUS
936 +  cat confdefs.h > conftest.$ac_ext
937 +  cat >> conftest.$ac_ext << EOF
938 + #include <stdio.h>
939 + #include <string.h>
940 + #include "vm_alloc.cpp"
941 +
942 + int main(void)
943 + {
944 +        if (vm_init() < 0)
945 +                return 1;
946 +
947 +        static const struct {
948 +                unsigned long base;
949 +                unsigned int size;
950 +        } ranges[[]] = {
951 +                { 0x00000000, 0x0003000 },
952 +                { 0x10000000, 0x2000000 },
953 +                { 0x40800000, 0x0400000 },
954 +                { 0x68070000, 0x0010000 },
955 +                { 0x69000000, 0x0080000 },
956 +                { 0x68ffe000, 0x0002000 },
957 +                { 0x5fffe000, 0x0002000 },
958 +                { 0x60000000, 0x0040000 },
959 +        };
960 +        const int n_ranges = sizeof(ranges)/ sizeof(ranges[[0]]);
961 +
962 + #ifdef NATMEM_OFFSET
963 +        unsigned long ofs = NATMEM_OFFSET;
964 + #else
965 +        for (unsigned long ofs = 0x10000000; ofs <= 0x90000000; ofs += 0x10000000)
966 + #endif
967 +        for (int i = 0; i < n_ranges; i++) {
968 +                char *m = (char *)(ranges[[i]].base + ofs);
969 +                if (vm_acquire_fixed(m, ranges[[i]].size) != 0)
970 +                        break;
971 +                memset(m, 0, ranges[[i]].size);
972 +                vm_release(m, ranges[[i]].size);
973 +                if (i == n_ranges - 1) {
974 +                        if (sizeof(void *) == 8 && ofs > 0xffffffff)
975 +                                printf("0x%lxul\n", ofs);
976 +                        else
977 +                                printf("0x%08x\n", ofs);
978 +                        return 0;
979 +                }
980 +        }
981 +
982 +        vm_exit();
983 +        return 1;
984 + }
985 + EOF
986 +  doit='$CXX conftest.$ac_ext -o conftest.$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS $NATMEM_OFFSET_DEF >& AS_MESSAGE_LOG_FD'
987 +  if AC_TRY_EVAL(doit); then
988 +    NATMEM_OFFSET=`./conftest.$ac_exeext`
989 +  else
990 +    NATMEM_OFFSET=
991 +  fi
992 +  rm -f conftest*
993 +  AC_LANG_RESTORE
994 +
995 +  if [[ -z "$NATMEM_OFFSET" ]]; then
996 +    AC_MSG_ERROR([could not determine a sensible NATMEM_OFFSET value])
997 +  else
998 +    WANT_ADDRESSING_MODE="direct,$NATMEM_OFFSET"
999 +    AC_DEFINE_UNQUOTED(NATMEM_OFFSET, $NATMEM_OFFSET,
1000 +      [Define constant offset for Mac address translation])
1001 +  fi
1002 + fi
1003 + AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1004 +
1005 + dnl Utility macro used by next two tests.
1006 + dnl AC_EXAMINE_OBJECT(C source code,
1007 + dnl     commands examining object file,
1008 + dnl     [commands to run if compile failed]):
1009 + dnl
1010 + dnl Compile the source code to an object file; then convert it into a
1011 + dnl printable representation.  All unprintable characters and
1012 + dnl asterisks (*) are replaced by dots (.).  All white space is
1013 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1014 + dnl output, but runs of newlines are compressed to a single newline.
1015 + dnl Finally, line breaks are forcibly inserted so that no line is
1016 + dnl longer than 80 columns and the file ends with a newline.  The
1017 + dnl result of all this processing is in the file conftest.dmp, which
1018 + dnl may be examined by the commands in the second argument.
1019 + dnl
1020 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1021 + [AC_LANG_SAVE
1022 + AC_LANG_C
1023 + dnl Next bit cribbed from AC_TRY_COMPILE.
1024 + cat > conftest.$ac_ext <<EOF
1025 + [#line __oline__ "configure"
1026 + #include "confdefs.h"
1027 + $1
1028 + ]EOF
1029 + if AC_TRY_EVAL(ac_compile); then
1030 +  od -c conftest.o |
1031 +    sed ['s/^[0-7]*[    ]*/ /
1032 +          s/\*/./g
1033 +          s/ \\n/*/g
1034 +          s/ [0-9][0-9][0-9]/./g
1035 +          s/  \\[^ ]/./g'] |
1036 +    tr -d '
1037 + ' | tr -s '*' '
1038 + ' | fold | sed '$a\
1039 + ' > conftest.dmp
1040 +  $2
1041 + ifelse($3, , , else
1042 +  $3
1043 + )dnl
1044 + fi
1045 + rm -rf conftest*
1046 + AC_LANG_RESTORE])
1047 +
1048 + dnl Floating point format probe.
1049 + dnl The basic concept is the same as the above: grep the object
1050 + dnl file for an interesting string.  We have to watch out for
1051 + dnl rounding changing the values in the object, however; this is
1052 + dnl handled by ignoring the least significant byte of the float.
1053 + dnl
1054 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1055 + dnl It does know about PDP-10 idiosyncratic format, but this is
1056 + dnl not presently supported by GCC.  S/390 "binary floating point"
1057 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1058 + dnl as ASCII?)
1059 + dnl
1060 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1061 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1062 + [gcc_AC_EXAMINE_OBJECT(
1063 + [/* This will not work unless sizeof(double) == 8.  */
1064 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1065 +
1066 + /* This structure must have no internal padding.  */
1067 + struct possibility {
1068 +  char prefix[8];
1069 +  double candidate;
1070 +  char postfix[8];
1071 + };
1072 +
1073 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1074 + struct possibility table [] =
1075 + {
1076 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1077 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1078 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1079 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1080 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1081 + };],
1082 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1083 +    ac_cv_c_float_format='IEEE (big-endian)'
1084 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1085 +    ac_cv_c_float_format='IEEE (big-endian)'
1086 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1087 +    ac_cv_c_float_format='IEEE (little-endian)'
1088 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1089 +    ac_cv_c_float_format='IEEE (little-endian)'
1090 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1091 +    ac_cv_c_float_format='VAX D-float'
1092 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1093 +    ac_cv_c_float_format='PDP-10'
1094 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1095 +    ac_cv_c_float_format='IBM 370 hex'
1096 +  else
1097 +    AC_MSG_ERROR(Unknown floating point format)
1098 +  fi],
1099 +  [AC_MSG_ERROR(compile failed)])
1100 + ])
1101 + # IEEE is the default format.  If the float endianness isn't the same
1102 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1103 + # (which is a tristate: yes, no, default).  This is only an issue with
1104 + # IEEE; the other formats are only supported by a few machines each,
1105 + # all with the same endianness.
1106 + format=IEEE_FLOAT_FORMAT
1107 + fbigend=
1108 + case $ac_cv_c_float_format in
1109 +    'IEEE (big-endian)' )
1110 +        if test $ac_cv_c_bigendian = no; then
1111 +            fbigend=1
1112 +        fi
1113 +        ;;
1114 +    'IEEE (little-endian)' )
1115 +        if test $ac_cv_c_bigendian = yes; then
1116 +            fbigend=0
1117 +        fi
1118 +        ;;
1119 +    'VAX D-float' )
1120 +        format=VAX_FLOAT_FORMAT
1121 +        ;;
1122 +    'PDP-10' )
1123 +        format=PDP10_FLOAT_FORMAT
1124 +        ;;
1125 +    'IBM 370 hex' )
1126 +        format=IBM_FLOAT_FORMAT
1127 +        ;;
1128 + esac
1129 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1130 +  [Define to the floating point format of the host machine.])
1131 + if test -n "$fbigend"; then
1132 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1133 +  [Define to 1 if the host machine stores floating point numbers in
1134 +   memory with the word containing the sign bit at the lowest address,
1135 +   or to 0 if it does it the other way around.
1136 +
1137 +   This macro should not be defined if the ordering is the same as for
1138 +   multi-word integers.])
1139 + fi
1140 + ])
1141 +
1142 + dnl Check for host float format
1143 + gcc_AC_C_FLOAT_FORMAT
1144 +
1145   dnl Platform specific binary postprocessor
1146   AC_PATH_PROG(BLESS, "true")
1147   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 780 | Line 1175 | if $CXX -V -v 2>&1 | grep -q "Intel(R) C
1175   fi
1176   AC_MSG_RESULT($HAVE_ICC)
1177  
1178 < # Test if the compiler can generate ELF objects
1179 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1180 <  ac_cv_elf_objects, [
1178 > dnl Determine the generated object format
1179 > AC_CACHE_CHECK([the format of compiler generated objects],
1180 >  ac_cv_object_format, [
1181    echo 'int i;' > conftest.$ac_ext
1182 <  ac_cv_elf_objects=no
1182 >  ac_cv_object_format=no
1183    if AC_TRY_EVAL(ac_compile); then
1184      case `/usr/bin/file conftest.$ac_objext` in
1185      *"ELF"*)
1186 <      ac_cv_elf_objects=yes
1186 >      ac_cv_object_format=elf
1187 >      ;;
1188 >    *"Mach-O"*)
1189 >      ac_cv_object_format=mach
1190 >      ;;
1191 >    *)
1192 >      ac_cv_object_format=unknown
1193        ;;
1194      esac
1195    fi
1196    rm -rf conftest*
1197   ])
797 ELF_OBJECTS=$ac_cv_elf_objects
1198  
1199   dnl CPU emulator sources
1200   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1201    CPUSRCS="\
1202 +    ../kpx_cpu/src/mathlib/ieeefp.cpp \
1203 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1204      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1205      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1206      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 809 | Line 1211 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1211    if [[ "x$WANT_JIT" = "xyes" ]]; then
1212      AC_CACHE_CHECK([whether dyngen can be used],
1213        ac_cv_use_dyngen, [
1214 <      case $host_cpu:$ELF_OBJECTS in
1215 <      powerpc:yes)
1214 >      case $host_cpu:$ac_cv_object_format in
1215 >      powerpc:elf)
1216 >        ac_cv_use_dyngen=yes
1217 >        ;;
1218 >      x86_64:elf)
1219          ac_cv_use_dyngen=yes
1220          ;;
1221 <      x86_64:yes)
1221 >      i?86:elf)
1222          ac_cv_use_dyngen=yes
1223          ;;
1224 <      i?86:yes)
1224 >      powerpc:mach)
1225          ac_cv_use_dyngen=yes
1226          ;;
1227        *:*)
# Line 836 | Line 1241 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1241            done
1242          fi
1243        fi
1244 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1244 >      if [[ -z "$DYNGEN_CC" ]]; then
1245          ac_cv_use_dyngen=no
1246        fi
1247      ])
# Line 844 | Line 1249 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1249        case $host_cpu in
1250        i?86)
1251          DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
847        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
848          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
849        else
850          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
851        fi
852        saved_CPPFLAGS=$CPPFLAGS
853        CPPFLAGS="$CPPFLAGS -mmmx"
854        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
855        CPPFLAGS="$CPPFLAGS -msse"
856        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
857        CPPFLAGS="$CPPFLAGS -msse2"
858        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
859        CPPFLAGS=$saved_CPPFLAGS
1252          ;;
1253 <      x86_64)
1254 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1253 >      powerpc)
1254 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1255 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1256 >        fi
1257          ;;
1258        esac
1259 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
1259 >      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1260 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1261 >      else
1262 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1263 >      fi
1264 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1265        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1266          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1267        fi
# Line 888 | Line 1287 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1287    AC_CACHE_CHECK([whether static data regions are executable],
1288      ac_cv_have_static_data_exec, [
1289      AC_TRY_RUN([int main(void) {
1290 < #if defined(__powerpc__)
1290 > #if defined(__powerpc__) || defined(__ppc__)
1291        static unsigned int p[8] = {0x4e800020,};
1292        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1293        asm volatile("sync" : : : "memory");
# Line 904 | Line 1303 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1303      ac_cv_have_static_data_exec=no
1304      )
1305    ])
1306 + else
1307 +  ac_cv_use_dyngen=no
1308   fi
1309   AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1310    [Define if your system marks static data pages as executable.])
# Line 913 | Line 1314 | if [[ "x$WANT_JIT" = "xyes" ]]; then
1314   fi
1315  
1316   dnl Generate Makefile.
1317 + AC_SUBST(PERL)
1318 + AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1319   AC_SUBST(DYNGENSRCS)
1320   AC_SUBST(DYNGEN_CC)
1321   AC_SUBST(DYNGEN_OP_FLAGS)
# Line 930 | Line 1333 | echo
1333   echo SheepShaver configuration summary:
1334   echo
1335   echo SDL support ...................... : $SDL_SUPPORT
1336 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1337   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1338   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1339   echo Using PowerPC emulator ........... : $EMULATED_PPC
# Line 938 | Line 1342 | echo Enable video on SEGV signals .....
1342   echo ESD sound support ................ : $WANT_ESD
1343   echo GTK user interface ............... : $WANT_GTK
1344   echo mon debugger support ............. : $WANT_MON
1345 + echo Addressing mode .................. : $WANT_ADDRESSING_MODE
1346   echo Bad memory access recovery type .. : $sigsegv_recovery
1347   echo
1348   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines