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.28 by gbeauche, 2005-06-22T16:38:15Z

# 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 166 | Line 206 | no:linux*)
206    ;;
207   esac
208  
209 + dnl We use FBDev DGA if possible.
210 + if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
211 +  AC_CHECK_HEADER(linux/fb.h, [
212 +    AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using Linux fbdev extension.])
213 +  ], [
214 +    AC_MSG_WARN([Could not find Linux FBDev extension, ignoring --enable-fbdev-dga.])
215 +    WANT_FBDEV_DGA=no
216 +  ])
217 + fi
218 +
219   dnl We use XFree86 DGA if possible.
220   if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
221    AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [
# Line 190 | Line 240 | fi
240  
241   dnl We use GTK+ if possible.
242   UISRCS=../dummy/prefs_editor_dummy.cpp
243 < if [[ "x$WANT_GTK" = "xyes" ]]; then
243 > case "x$WANT_GTK" in
244 > xgtk2*)
245 >  AM_PATH_GTK_2_0(1.3.15, [
246 >    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
247 >    CFLAGS="$CFLAGS $GTK_CFLAGS"
248 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
249 >    LIBS="$LIBS $GTK_LIBS"
250 >    UISRCS=prefs_editor_gtk.cpp
251 >    WANT_GTK=gtk2
252 >  ], [
253 >    case "x${WANT_GTK}x" in
254 >    *gtkx)
255 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
256 >      WANT_GTK=gtk
257 >      ;;
258 >    *)
259 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
260 >      WANT_GTK=no
261 >      ;;
262 >    esac
263 >  ])
264 >  ;;
265 > esac
266 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
267    AM_PATH_GTK(1.2.0, [
268      AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
269      CFLAGS="$CFLAGS $GTK_CFLAGS"
# Line 222 | Line 295 | AC_SYS_LARGEFILE
295   dnl Checks for header files.
296   AC_HEADER_STDC
297   AC_HEADER_SYS_WAIT
298 + AC_CHECK_HEADERS(malloc.h)
299   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
300   AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
301   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
# Line 231 | Line 305 | AC_CHECK_HEADERS(linux/if.h, [], [], [
305   #endif
306   ])
307   AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
308 + AC_CHECK_HEADERS(fenv.h)
309  
310   dnl Checks for typedefs, structures, and compiler characteristics.
311   AC_C_BIGENDIAN
# Line 271 | Line 346 | AC_CHECK_FUNCS(nanosleep)
346   AC_CHECK_FUNCS(sigaction signal)
347   AC_CHECK_FUNCS(mmap mprotect munmap)
348   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
349 < AC_CHECK_FUNCS(posix_memalign memalign valloc)
349 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
350 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
351  
352   dnl Darwin seems to define mach_task_self() instead of task_self().
353   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 283 | Line 359 | no:linux*)
359    ;;
360   *:*)
361    AC_SEARCH_LIBS(clock_gettime, [rt posix4])
362 <  AC_CHECK_FUNCS(clock_gettime)
362 >  AC_CHECK_FUNCS(clock_gettime clock_nanosleep)
363    ;;
364   esac
365  
366 + dnl Check for headers and functions related to pty support (sshpty.c)
367 + dnl From openssh-3.2.2p1 configure.ac
368 + AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
369 + AC_CHECK_FUNCS(_getpty vhangup strlcpy)
370 +
371 + case "$host" in
372 + *-*-hpux10.26)
373 +        disable_ptmx_check=yes
374 +        ;;
375 + *-*-linux*)
376 +        no_dev_ptmx=1
377 +        ;;
378 + mips-sony-bsd|mips-sony-newsos4)
379 +        AC_DEFINE(HAVE_NEWS4, 1, [Define if you are on NEWS-OS (additions from openssh-3.2.2p1, for sshpty.c).])
380 +        ;;
381 + *-*-sco3.2v4*)
382 +        no_dev_ptmx=1
383 +        ;;
384 + *-*-sco3.2v5*)
385 +        no_dev_ptmx=1
386 +        ;;
387 + *-*-cygwin*)
388 +        no_dev_ptmx=1
389 +        ;;
390 + esac
391 +
392 + if test -z "$no_dev_ptmx" ; then
393 +        if test "x$disable_ptmx_check" != "xyes" ; then
394 +                AC_CHECK_FILE([/dev/ptmx],
395 +                        [
396 +                                AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx.])
397 +                                have_dev_ptmx=1
398 +                        ]
399 +                )
400 +        fi
401 + fi
402 + AC_CHECK_FILE([/dev/ptc],
403 +        [
404 +                AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, [Define if you have /dev/ptc.])
405 +                have_dev_ptc=1
406 +        ]
407 + )
408 + dnl (end of code from openssh-3.2.2p1 configure.ac)
409 +
410   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
411   AC_DEFUN(AC_CHECK_FRAMEWORK, [
412    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
# Line 314 | Line 434 | SERIALSRC=serial_unix.cpp
434   ETHERSRC=../dummy/ether_dummy.cpp
435   SCSISRC=../dummy/scsi_dummy.cpp
436   AUDIOSRC=../dummy/audio_dummy.cpp
437 + EXTFSSRC=extfs_unix.cpp
438   EXTRASYSSRCS=
439   case "$target_os" in
440   linux*)
# Line 321 | Line 442 | linux*)
442    AUDIOSRC=audio_oss_esd.cpp
443    SCSISRC=Linux/scsi_linux.cpp
444    if [[ "x$EMULATED_PPC" = "xno" ]]; then
445 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
445 >    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
446 >  fi
447 >  ;;
448 > netbsd*)
449 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
450 >    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
451    fi
452    ;;
453   darwin*)
454    if [[ "x$EMULATED_PPC" = "xno" ]]; then
455 <    EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S"
455 >    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
456    fi
457    if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
458      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
459    fi
460 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
461 +    EXTFSSRC=../MacOSX/extfs_macosx.mm
462 +  fi
463 +  ;;
464 + cygwin*)
465 +  SERIALSRC="../dummy/serial_dummy.cpp"
466    ;;
467   esac
468  
# Line 339 | Line 471 | if [[ "x$WANT_SDL" = "xyes" ]]; then
471    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
472   fi
473   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
342  VIDEOSRCS="../SDL/video_sdl.cpp"
474    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
475 +  VIDEOSRCS="../SDL/video_sdl.cpp"
476    KEYCODES="../SDL/keycodes"
477    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
478      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
479    else
480 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
480 >    case "$target_os" in
481 >    cygwin*)
482 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
483 >      ;;
484 >    *)
485 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
486 >      ;;
487 >    esac
488    fi
489   else
490    VIDEOSRCS="video_x.cpp"
491    KEYCODES="keycodes"
492    EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
493   fi
494 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
495 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
496 +  AUDIOSRC="../SDL/audio_sdl.cpp"
497 + fi
498  
499 < SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
499 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
500  
501   dnl Define a macro that translates a yesno-variable into a C macro definition
502   dnl to be put into the config.h file
# Line 657 | Line 800 | fi
800   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
801    [Define if your system supports Mach exceptions.])
802  
803 + dnl Check if Windows exceptions are supported.
804 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
805 +  ac_cv_have_win32_exceptions, [
806 +  AC_LANG_SAVE
807 +  AC_LANG_CPLUSPLUS
808 +  AC_TRY_RUN([
809 +    #define HAVE_WIN32_EXCEPTIONS 1
810 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
811 +    #include "vm_alloc.cpp"
812 +    #include "sigsegv.cpp"
813 +  ], [
814 +  sigsegv_recovery=win32
815 +  ac_cv_have_win32_exceptions=yes
816 +  ],
817 +  ac_cv_have_win32_exceptions=no,
818 +  dnl When cross-compiling, do not assume anything.
819 +  ac_cv_have_win32_exceptions=no
820 +  )
821 +  AC_LANG_RESTORE
822 +  ]
823 + )
824 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
825 +  [Define if your system supports Windows exceptions.])
826 +
827   dnl Otherwise, check if extended signals are supported.
828   if [[ -z "$sigsegv_recovery" ]]; then
829    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 743 | Line 910 | else
910      WANT_VOSF=no
911   fi
912  
913 + dnl Check addressing mode to use
914 + AC_MSG_CHECKING([for addressing mode to use])
915 + case "$os_target" in
916 + cygwin*)
917 +  WANT_ADDRESSING_MODE="direct,cygwin-hack"
918 +  NATMEM_OFFSET=
919 +  ;;
920 + esac
921 + if [[ "$EMULATED_PPC" != "yes" ]]; then
922 +  if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
923 +    AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
924 +    WANT_ADDRESSING_MODE="real"
925 +  fi
926 + fi
927 + if [[ "$WANT_ADDRESSING_MODE" = "direct" ]]; then
928 +  if [[ -n "$NATMEM_OFFSET" ]]; then
929 +    NATMEM_OFFSET_DEF="-DNATMEM_OFFSET=$NATMEM_OFFSET"
930 +  fi
931 +  AC_LANG_SAVE
932 +  AC_LANG_CPLUSPLUS
933 +  cat confdefs.h > conftest.$ac_ext
934 +  cat >> conftest.$ac_ext << EOF
935 + #include <stdio.h>
936 + #include <string.h>
937 + #include "vm_alloc.cpp"
938 +
939 + int main(void)
940 + {
941 +        if (vm_init() < 0)
942 +                return 1;
943 +
944 +        static const struct {
945 +                unsigned long base;
946 +                unsigned int size;
947 +        } ranges[[]] = {
948 +                { 0x00000000, 0x0003000 },
949 +                { 0x10000000, 0x2000000 },
950 +                { 0x40800000, 0x0400000 },
951 +                { 0x68070000, 0x0010000 },
952 +                { 0x69000000, 0x0080000 },
953 +                { 0x68ffe000, 0x0002000 },
954 +                { 0x5fffe000, 0x0002000 },
955 +                { 0x60000000, 0x0040000 },
956 +        };
957 +        const int n_ranges = sizeof(ranges)/ sizeof(ranges[[0]]);
958 +
959 + #ifdef NATMEM_OFFSET
960 +        unsigned long ofs = NATMEM_OFFSET;
961 + #else
962 +        for (unsigned long ofs = 0x10000000; ofs <= 0x90000000; ofs += 0x10000000)
963 + #endif
964 +        for (int i = 0; i < n_ranges; i++) {
965 +                char *m = (char *)(ranges[[i]].base + ofs);
966 +                if (vm_acquire_fixed(m, ranges[[i]].size) != 0)
967 +                        break;
968 +                memset(m, 0, ranges[[i]].size);
969 +                vm_release(m, ranges[[i]].size);
970 +                if (i == n_ranges - 1) {
971 +                        if (sizeof(void *) == 8 && ofs > 0xffffffff)
972 +                                printf("0x%lxul\n", ofs);
973 +                        else
974 +                                printf("0x%08x\n", ofs);
975 +                        return 0;
976 +                }
977 +        }
978 +
979 +        vm_exit();
980 +        return 1;
981 + }
982 + EOF
983 +  doit='$CXX conftest.$ac_ext -o conftest.$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS $NATMEM_OFFSET_DEF >& AS_MESSAGE_LOG_FD'
984 +  if AC_TRY_EVAL(doit); then
985 +    NATMEM_OFFSET=`./conftest.$ac_exeext`
986 +  else
987 +    NATMEM_OFFSET=
988 +  fi
989 +  rm -f conftest*
990 +  AC_LANG_RESTORE
991 +
992 +  if [[ -z "$NATMEM_OFFSET" ]]; then
993 +    AC_MSG_ERROR([could not determine a sensible NATMEM_OFFSET value])
994 +  else
995 +    WANT_ADDRESSING_MODE="direct,$NATMEM_OFFSET"
996 +    AC_DEFINE_UNQUOTED(NATMEM_OFFSET, $NATMEM_OFFSET,
997 +      [Define constant offset for Mac address translation])
998 +  fi
999 + fi
1000 + AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1001 +
1002 + dnl Utility macro used by next two tests.
1003 + dnl AC_EXAMINE_OBJECT(C source code,
1004 + dnl     commands examining object file,
1005 + dnl     [commands to run if compile failed]):
1006 + dnl
1007 + dnl Compile the source code to an object file; then convert it into a
1008 + dnl printable representation.  All unprintable characters and
1009 + dnl asterisks (*) are replaced by dots (.).  All white space is
1010 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1011 + dnl output, but runs of newlines are compressed to a single newline.
1012 + dnl Finally, line breaks are forcibly inserted so that no line is
1013 + dnl longer than 80 columns and the file ends with a newline.  The
1014 + dnl result of all this processing is in the file conftest.dmp, which
1015 + dnl may be examined by the commands in the second argument.
1016 + dnl
1017 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1018 + [AC_LANG_SAVE
1019 + AC_LANG_C
1020 + dnl Next bit cribbed from AC_TRY_COMPILE.
1021 + cat > conftest.$ac_ext <<EOF
1022 + [#line __oline__ "configure"
1023 + #include "confdefs.h"
1024 + $1
1025 + ]EOF
1026 + if AC_TRY_EVAL(ac_compile); then
1027 +  od -c conftest.o |
1028 +    sed ['s/^[0-7]*[    ]*/ /
1029 +          s/\*/./g
1030 +          s/ \\n/*/g
1031 +          s/ [0-9][0-9][0-9]/./g
1032 +          s/  \\[^ ]/./g'] |
1033 +    tr -d '
1034 + ' | tr -s '*' '
1035 + ' | fold | sed '$a\
1036 + ' > conftest.dmp
1037 +  $2
1038 + ifelse($3, , , else
1039 +  $3
1040 + )dnl
1041 + fi
1042 + rm -rf conftest*
1043 + AC_LANG_RESTORE])
1044 +
1045 + dnl Floating point format probe.
1046 + dnl The basic concept is the same as the above: grep the object
1047 + dnl file for an interesting string.  We have to watch out for
1048 + dnl rounding changing the values in the object, however; this is
1049 + dnl handled by ignoring the least significant byte of the float.
1050 + dnl
1051 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1052 + dnl It does know about PDP-10 idiosyncratic format, but this is
1053 + dnl not presently supported by GCC.  S/390 "binary floating point"
1054 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1055 + dnl as ASCII?)
1056 + dnl
1057 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1058 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1059 + [gcc_AC_EXAMINE_OBJECT(
1060 + [/* This will not work unless sizeof(double) == 8.  */
1061 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1062 +
1063 + /* This structure must have no internal padding.  */
1064 + struct possibility {
1065 +  char prefix[8];
1066 +  double candidate;
1067 +  char postfix[8];
1068 + };
1069 +
1070 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1071 + struct possibility table [] =
1072 + {
1073 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1074 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1075 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1076 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1077 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1078 + };],
1079 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1080 +    ac_cv_c_float_format='IEEE (big-endian)'
1081 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1082 +    ac_cv_c_float_format='IEEE (big-endian)'
1083 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1084 +    ac_cv_c_float_format='IEEE (little-endian)'
1085 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1086 +    ac_cv_c_float_format='IEEE (little-endian)'
1087 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1088 +    ac_cv_c_float_format='VAX D-float'
1089 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1090 +    ac_cv_c_float_format='PDP-10'
1091 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1092 +    ac_cv_c_float_format='IBM 370 hex'
1093 +  else
1094 +    AC_MSG_ERROR(Unknown floating point format)
1095 +  fi],
1096 +  [AC_MSG_ERROR(compile failed)])
1097 + ])
1098 + # IEEE is the default format.  If the float endianness isn't the same
1099 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1100 + # (which is a tristate: yes, no, default).  This is only an issue with
1101 + # IEEE; the other formats are only supported by a few machines each,
1102 + # all with the same endianness.
1103 + format=IEEE_FLOAT_FORMAT
1104 + fbigend=
1105 + case $ac_cv_c_float_format in
1106 +    'IEEE (big-endian)' )
1107 +        if test $ac_cv_c_bigendian = no; then
1108 +            fbigend=1
1109 +        fi
1110 +        ;;
1111 +    'IEEE (little-endian)' )
1112 +        if test $ac_cv_c_bigendian = yes; then
1113 +            fbigend=0
1114 +        fi
1115 +        ;;
1116 +    'VAX D-float' )
1117 +        format=VAX_FLOAT_FORMAT
1118 +        ;;
1119 +    'PDP-10' )
1120 +        format=PDP10_FLOAT_FORMAT
1121 +        ;;
1122 +    'IBM 370 hex' )
1123 +        format=IBM_FLOAT_FORMAT
1124 +        ;;
1125 + esac
1126 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1127 +  [Define to the floating point format of the host machine.])
1128 + if test -n "$fbigend"; then
1129 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1130 +  [Define to 1 if the host machine stores floating point numbers in
1131 +   memory with the word containing the sign bit at the lowest address,
1132 +   or to 0 if it does it the other way around.
1133 +
1134 +   This macro should not be defined if the ordering is the same as for
1135 +   multi-word integers.])
1136 + fi
1137 + ])
1138 +
1139 + dnl Check for host float format
1140 + gcc_AC_C_FLOAT_FORMAT
1141 +
1142   dnl Platform specific binary postprocessor
1143   AC_PATH_PROG(BLESS, "true")
1144   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 776 | Line 1172 | if $CXX -V -v 2>&1 | grep -q "Intel(R) C
1172   fi
1173   AC_MSG_RESULT($HAVE_ICC)
1174  
1175 < # Test if the compiler can generate ELF objects
1176 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1177 <  ac_cv_elf_objects, [
1175 > dnl Determine the generated object format
1176 > AC_CACHE_CHECK([the format of compiler generated objects],
1177 >  ac_cv_object_format, [
1178    echo 'int i;' > conftest.$ac_ext
1179 <  ac_cv_elf_objects=no
1179 >  ac_cv_object_format=no
1180    if AC_TRY_EVAL(ac_compile); then
1181      case `/usr/bin/file conftest.$ac_objext` in
1182      *"ELF"*)
1183 <      ac_cv_elf_objects=yes
1183 >      ac_cv_object_format=elf
1184 >      ;;
1185 >    *"Mach-O"*)
1186 >      ac_cv_object_format=mach
1187 >      ;;
1188 >    *)
1189 >      ac_cv_object_format=unknown
1190        ;;
1191      esac
1192    fi
1193    rm -rf conftest*
1194   ])
793 ELF_OBJECTS=$ac_cv_elf_objects
1195  
1196   dnl CPU emulator sources
1197   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1198    CPUSRCS="\
1199 +    ../kpx_cpu/src/mathlib/ieeefp.cpp \
1200 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1201      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1202      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1203      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 805 | Line 1208 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1208    if [[ "x$WANT_JIT" = "xyes" ]]; then
1209      AC_CACHE_CHECK([whether dyngen can be used],
1210        ac_cv_use_dyngen, [
1211 <      case $host_cpu:$ELF_OBJECTS in
1212 <      powerpc:yes)
1211 >      case $host_cpu:$ac_cv_object_format in
1212 >      powerpc:elf)
1213 >        ac_cv_use_dyngen=yes
1214 >        ;;
1215 >      x86_64:elf)
1216          ac_cv_use_dyngen=yes
1217          ;;
1218 <      x86_64:yes)
1218 >      i?86:elf)
1219          ac_cv_use_dyngen=yes
1220          ;;
1221 <      i?86:yes)
1221 >      powerpc:mach)
1222          ac_cv_use_dyngen=yes
1223          ;;
1224        *:*)
# Line 832 | Line 1238 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1238            done
1239          fi
1240        fi
1241 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1241 >      if [[ -z "$DYNGEN_CC" ]]; then
1242          ac_cv_use_dyngen=no
1243        fi
1244      ])
# Line 840 | Line 1246 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1246        case $host_cpu in
1247        i?86)
1248          DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
843        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
844          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
845        else
846          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
847        fi
848        saved_CPPFLAGS=$CPPFLAGS
849        CPPFLAGS="$CPPFLAGS -mmmx"
850        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
851        CPPFLAGS="$CPPFLAGS -msse"
852        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
853        CPPFLAGS="$CPPFLAGS -msse2"
854        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
855        CPPFLAGS=$saved_CPPFLAGS
1249          ;;
1250 <      x86_64)
1251 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1250 >      powerpc)
1251 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1252 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1253 >        fi
1254          ;;
1255        esac
1256 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
1256 >      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1257 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1258 >      else
1259 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1260 >      fi
1261 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1262        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1263          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1264        fi
# Line 884 | Line 1284 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1284    AC_CACHE_CHECK([whether static data regions are executable],
1285      ac_cv_have_static_data_exec, [
1286      AC_TRY_RUN([int main(void) {
1287 < #if defined(__powerpc__)
1287 > #if defined(__powerpc__) || defined(__ppc__)
1288        static unsigned int p[8] = {0x4e800020,};
1289        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1290        asm volatile("sync" : : : "memory");
# Line 900 | Line 1300 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1300      ac_cv_have_static_data_exec=no
1301      )
1302    ])
1303 + else
1304 +  ac_cv_use_dyngen=no
1305   fi
1306   AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1307    [Define if your system marks static data pages as executable.])
# Line 909 | Line 1311 | if [[ "x$WANT_JIT" = "xyes" ]]; then
1311   fi
1312  
1313   dnl Generate Makefile.
1314 + AC_SUBST(PERL)
1315 + AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1316   AC_SUBST(DYNGENSRCS)
1317   AC_SUBST(DYNGEN_CC)
1318   AC_SUBST(DYNGEN_OP_FLAGS)
# Line 916 | Line 1320 | AC_SUBST(SYSSRCS)
1320   AC_SUBST(CPUSRCS)
1321   AC_SUBST(BLESS)
1322   AC_SUBST(KEYCODES)
1323 < AC_OUTPUT(Makefile)
1323 > AC_OUTPUT([
1324 > Makefile
1325 > ../MacOSX/Info.plist
1326 > ])
1327  
1328   dnl Print summary.
1329   echo
1330   echo SheepShaver configuration summary:
1331   echo
1332   echo SDL support ...................... : $SDL_SUPPORT
1333 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1334   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1335   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1336   echo Using PowerPC emulator ........... : $EMULATED_PPC
# Line 931 | Line 1339 | echo Enable video on SEGV signals .....
1339   echo ESD sound support ................ : $WANT_ESD
1340   echo GTK user interface ............... : $WANT_GTK
1341   echo mon debugger support ............. : $WANT_MON
1342 + echo Addressing mode .................. : $WANT_ADDRESSING_MODE
1343   echo Bad memory access recovery type .. : $sigsegv_recovery
1344   echo
1345   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines