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.15 by gbeauche, 2005-01-19T20:26:01Z vs.
Revision 1.57 by gbeauche, 2007-06-13T12:09:05Z

# Line 1 | Line 1
1   dnl Process this file with autoconf to produce a configure script.
2   dnl Written in 2002 by Christian Bauer
3  
4 < AC_INIT([SheepShaver], 2.2, [Christian.Bauer@uni-mainz.de], SheepShaver)
4 > AC_INIT([SheepShaver], 2.3, [Christian.Bauer@uni-mainz.de], SheepShaver)
5   AC_CONFIG_SRCDIR(main_unix.cpp)
6   AC_PREREQ(2.52)
7   AC_CONFIG_HEADER(config.h)
# Line 14 | Line 14 | dnl Some systems do not put corefiles in
14   dnl cores for the configure tests since some are intended to dump core.
15   ulimit -c 0
16  
17 + dnl Invite Cygwin users to build within the Windows/ directory
18 + case $target_os in
19 + *cygwin* | *mingw32*)
20 +  AC_MSG_ERROR([You can only build the Windows version from its directory, Cygwin/X11 is not supported.])
21 +  ;;
22 + esac
23 +
24   dnl Options.
25   AC_ARG_ENABLE(jit,          [  --enable-jit            enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
26   AC_ARG_ENABLE(ppc-emulator, [  --enable-ppc-emulator   use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto])
27 + 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])
28   AC_ARG_ENABLE(xf86-dga,     [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
29 < AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=no]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=no])
29 > AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
30   AC_ARG_ENABLE(vosf,         [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
31 + AC_ARG_ENABLE(standalone-gui,[  --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no])
32   AC_ARG_WITH(esd,            [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
33 < AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
33 > AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]],
34 >  [case "$withval" in
35 >   gtk1)      WANT_GTK="gtk";;
36 >   gtk|gtk2)  WANT_GTK="$withval";;
37 >   yes)       WANT_GTK="gtk2 gtk";;
38 >   *)         WANT_GTK="no";;
39 >   esac],
40 >  [WANT_GTK="gtk2 gtk"])
41   AC_ARG_WITH(mon,            [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
42   AC_ARG_WITH(dgcc,           [  --with-dgcc=COMPILER    use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval])
43  
# Line 48 | Line 64 | AC_PROG_CXX
64   AC_PROG_MAKE_SET
65   AC_PROG_INSTALL
66   AC_PROG_EGREP
67 < AC_CHECK_PROGS(FILE, [file false])
67 > AC_PATH_PROGS(FILE, [file false])
68 > AC_PATH_PROG(PERL, [perl])
69  
70   dnl Check for PowerPC target CPU.
71   HAVE_PPC=no
# Line 109 | Line 126 | AC_SUBST(MONSRCS)
126  
127   dnl Checks for libraries.
128   AC_CHECK_LIB(posix4, sem_init)
129 + AC_CHECK_LIB(m, cos)
130  
131   dnl Do we need SDL?
132   WANT_SDL=no
# Line 126 | Line 144 | fi
144   if [[ "x$WANT_SDL" = "xyes" ]]; then
145    AC_PATH_PROG(sdl_config, "sdl-config")
146    if [[ -n "$sdl_config" ]]; then
147 <    case $target_os in
148 <    # Special treatment for Cygwin so that we can still use the POSIX layer
149 <    *cygwin*)
150 <      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
151 <      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
152 <      ;;
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
147 >    sdl_cflags=`$sdl_config --cflags`
148 >    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
149 >      sdl_libs=`$sdl_config --static-libs`
150 >    else
151 >      sdl_libs=`$sdl_config --libs`
152 >    fi
153      CFLAGS="$CFLAGS $sdl_cflags"
154      CXXFLAGS="$CXXFLAGS $sdl_cflags"
155      LIBS="$LIBS $sdl_libs"
# Line 168 | 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 176 | 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 pthread_testcancel)
196    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
197    AC_CHECK_FUNCS(pthread_mutexattr_settype)
198    AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
187  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
188    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
189  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 196 | 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 221 | 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 >  WANT_GTK=no
249 >  AM_PATH_GTK_2_0(1.3.15, [
250 >    GUI_CFLAGS="$GTK_CFLAGS"
251 >    GUI_LIBS="$GTK_LIBS"
252 >    WANT_GTK=gtk2
253 >  ], [
254 >    case "x${WANT_GTK}x" in
255 >    *gtkx)
256 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
257 >      WANT_GTK=gtk
258 >      ;;
259 >    *)
260 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
261 >      WANT_GTK=no
262 >     ;;
263 >    esac
264 >  ])
265 >  ;;
266 > esac
267 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
268 >  WANT_GTK=no
269    AM_PATH_GTK(1.2.0, [
270 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
271 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
272 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
229 <    LIBS="$LIBS $GTK_LIBS"
230 <    UISRCS=prefs_editor_gtk.cpp
270 >    GUI_CFLAGS="$GTK_CFLAGS"
271 >    GUI_LIBS="$GTK_LIBS"
272 >    WANT_GTK=gtk
273    ], [
274      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
233    WANT_GTK=no
275    ])
276   fi
277 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
278 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
279 +  UISRCS=prefs_editor_gtk.cpp
280 + fi
281 + AC_SUBST(GUI_CFLAGS)
282 + AC_SUBST(GUI_LIBS)
283 +
284 + dnl Build external GUI if requested.
285 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
286 +  WANT_STANDALONE_GUI=no
287 + fi
288 + if [[ "$WANT_GTK" = "no" ]]; then
289 +  WANT_STANDALONE_GUI=no
290 + fi
291 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
292  
293   dnl We use ESD if possible.
294   if [[ "x$WANT_ESD" = "xyes" ]]; then
295 +  WANT_ESD=no
296    AM_PATH_ESD(0.2.8, [
297      AC_DEFINE(ENABLE_ESD, 1, [Define is using ESD.])
298      CFLAGS="$CFLAGS $ESD_CFLAGS"
299      CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
300      LIBS="$LIBS $ESD_LIBS"
301 +    WANT_ESD=yes
302    ], [
303      AC_MSG_WARN([Could not find ESD, disabling ESD support.])
246    WANT_ESD=no
304    ])
305   fi
306  
# Line 253 | Line 310 | AC_SYS_LARGEFILE
310   dnl Checks for header files.
311   AC_HEADER_STDC
312   AC_HEADER_SYS_WAIT
313 < AC_CHECK_HEADERS(malloc.h)
313 > AC_CHECK_HEADERS(malloc.h stdint.h)
314   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)
315   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
316 < AC_CHECK_HEADERS(linux/if.h, [], [], [
317 < #if HAVE_SYS_SOCKET_H
318 < # include <sys/socket.h>
316 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
317 > AC_CHECK_HEADERS(sys/time.h sys/poll.h sys/select.h arpa/inet.h)
318 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
319 > #ifdef HAVE_SYS_TYPES_H
320 > #include <sys/types.h>
321 > #endif
322 > #ifdef HAVE_SYS_SOCKET_H
323 > #include <sys/socket.h>
324   #endif
325   ])
326 < AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
326 > AC_CHECK_HEADERS(AvailabilityMacros.h)
327 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
328   AC_CHECK_HEADERS(fenv.h)
329  
330   dnl Checks for typedefs, structures, and compiler characteristics.
# Line 283 | Line 345 | AC_TYPE_SIGNAL
345   AC_HEADER_TIME
346   AC_STRUCT_TM
347  
348 + dnl Check whether sys/socket.h defines type socklen_t.
349 + dnl (extracted from ac-archive/Miscellaneous)
350 + AC_CACHE_CHECK([for socklen_t],
351 +  ac_cv_type_socklen_t, [
352 +  AC_TRY_COMPILE([
353 +    #include <sys/types.h>
354 +    #include <sys/socket.h>
355 +  ], [socklen_t len = 42; return 0;],
356 +  ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
357 +  dnl When cross-compiling, do not assume anything.
358 +  ac_cv_type_socklen_t="guessing no"
359 +  )
360 + ])
361 + if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
362 +  AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
363 + fi
364 +
365   dnl Check whether struct sigaction has sa_restorer member.
366   AC_CACHE_CHECK([whether struct sigaction has sa_restorer],
367    ac_cv_signal_sa_restorer, [
# Line 299 | Line 378 | if [[ "x$ac_cv_signal_sa_restorer" = "xy
378   fi
379  
380   dnl Checks for library functions.
381 < AC_CHECK_FUNCS(strdup strlcpy cfmakeraw)
381 > AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw)
382   AC_CHECK_FUNCS(nanosleep)
383   AC_CHECK_FUNCS(sigaction signal)
384   AC_CHECK_FUNCS(mmap mprotect munmap)
385   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
307 AC_CHECK_FUNCS(posix_memalign memalign valloc)
386   AC_CHECK_FUNCS(exp2f log2f exp2 log2)
387 + AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
388 + AC_CHECK_FUNCS(poll inet_aton)
389  
390   dnl Darwin seems to define mach_task_self() instead of task_self().
391   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 317 | Line 397 | no:linux*)
397    ;;
398   *:*)
399    AC_SEARCH_LIBS(clock_gettime, [rt posix4])
400 <  AC_CHECK_FUNCS(clock_gettime)
400 >  AC_CHECK_FUNCS(clock_gettime clock_nanosleep)
401    ;;
402   esac
403  
# Line 365 | Line 445 | AC_CHECK_FILE([/dev/ptc],
445   )
446   dnl (end of code from openssh-3.2.2p1 configure.ac)
447  
448 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
449 + dnl doesn't work or is unimplemented. On these systems (mostly older
450 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
451 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
452 +  ac_cv_nonblocking_io, [
453 +  case "$host" in
454 +  *-*-osf*)
455 +    ac_cv_nonblocking_io=FIONBIO
456 +    ;;
457 +  *-*-sunos4*)
458 +    ac_cv_nonblocking_io=FIONBIO
459 +    ;;
460 +  *-*-ultrix*)
461 +    ac_cv_nonblocking_io=FIONBIO
462 +    ;;
463 +  *)
464 +    ac_cv_nonblocking_io=O_NONBLOCK
465 +    ;;
466 +  esac
467 + ])
468 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
469 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
470 + fi
471 +
472 + dnl Check whether compiler supports byte bit-fields
473 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
474 +  ac_cv_have_byte_bitfields, [
475 +  AC_LANG_SAVE
476 +  AC_LANG_CPLUSPLUS
477 +  AC_TRY_RUN([
478 +    struct A {
479 +      unsigned char b1:4;
480 +      unsigned char b2:4;
481 +      unsigned char c;
482 +      unsigned short s;
483 +      unsigned char a[4];
484 +    };
485 +
486 +    int main(void) {
487 +      A a;
488 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
489 +    }],
490 +    [ac_cv_have_byte_bitfields=yes],
491 +    [ac_cv_have_byte_bitfields=no],
492 +    dnl When cross-compiling, assume only GCC supports this
493 +    [if [[ "$GCC" = "yes" ]]; then
494 +      ac_cv_have_byte_bitfields="guessing yes"
495 +    else
496 +      ac_cv_have_byte_bitfields="guessing no"
497 +    fi]
498 +    )
499 +  AC_LANG_RESTORE
500 + ])
501 +
502   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
503 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
503 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
504    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
505    AC_CACHE_CHECK([whether compiler supports framework $1],
506      ac_Framework, [
507      saved_LIBS="$LIBS"
508      LIBS="$LIBS -framework $1"
509      AC_TRY_LINK(
510 <      [$2], [int main(void) { return 0; }],
510 >      [$2], [],
511        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
512      )
513    ])
# Line 386 | Line 520 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
520   dnl Check for some MacOS X frameworks
521   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
522   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
523 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
524  
525   dnl Select system-dependant sources.
526   SERIALSRC=serial_unix.cpp
# Line 396 | Line 531 | EXTFSSRC=extfs_unix.cpp
531   EXTRASYSSRCS=
532   case "$target_os" in
533   linux*)
534 <  ETHERSRC=Linux/ether_linux.cpp
534 >  ETHERSRC=ether_unix.cpp
535    AUDIOSRC=audio_oss_esd.cpp
536    SCSISRC=Linux/scsi_linux.cpp
537    if [[ "x$EMULATED_PPC" = "xno" ]]; then
538 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
538 >    EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
539 >  fi
540 >  ;;
541 > freebsd*)
542 >  ETHERSRC=ether_unix.cpp
543 >  ;;
544 > netbsd*)
545 >  ETHERSRC=ether_unix.cpp
546 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
547 >    EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
548    fi
549    ;;
550   darwin*)
551 +  ETHERSRC=ether_unix.cpp
552    if [[ "x$EMULATED_PPC" = "xno" ]]; then
553 <    EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S"
553 >    EXTRASYSSRCS="paranoia.cpp ppc_asm.S"
554    fi
555 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
555 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
556      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
557    fi
558    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
559      EXTFSSRC=../MacOSX/extfs_macosx.mm
560    fi
561    ;;
562 < cygwin*)
563 <  SERIALSRC="../dummy/serial_dummy.cpp"
562 > irix*)
563 >  AUDIOSRC=Irix/audio_irix.cpp
564 >  LIBS="$LIBS -laudio"
565 >  WANT_ESD=no
566 >
567 >  dnl Check if our compiler supports -IPA (MIPSPro)
568 >  HAVE_IPA=no
569 >  ocflags="$CFLAGS"
570 >  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
571 >  AC_MSG_CHECKING(if "-IPA" works)
572 >  dnl Do a test compile of an empty function
573 >  AC_TRY_COMPILE([#if defined __GNUC__
574 >                  # error GCC does not support IPA yet
575 >                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
576 >  CFLAGS="$ocflags"
577    ;;
578   esac
579  
580 + dnl Is the slirp library supported?
581 + case "$ac_cv_have_byte_bitfields" in
582 + yes|"guessing yes")
583 +  CAN_SLIRP=yes
584 +  ETHERSRC=ether_unix.cpp
585 +  ;;
586 + esac
587 + if [[ -n "$CAN_SLIRP" ]]; then
588 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
589 +  SLIRP_SRCS="\
590 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
591 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
592 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
593 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
594 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
595 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
596 + fi
597 + AC_SUBST(SLIRP_SRCS)
598 +
599   dnl SDL overrides
600   if [[ "x$WANT_SDL" = "xyes" ]]; then
601    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
# Line 430 | Line 607 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
607    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
608      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
609    else
610 <    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
610 >    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
611    fi
612   else
613    VIDEOSRCS="video_x.cpp"
# Line 456 | Line 626 | dnl to be put into the config.h file
626   dnl $1 -- the macro to define
627   dnl $2 -- the value to translate
628   dnl $3 -- template name
629 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
629 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
630      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
631          AC_DEFINE($1, 1, $3)
632      fi
# Line 865 | Line 1035 | fi
1035  
1036   dnl Check addressing mode to use
1037   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
1038   if [[ "$EMULATED_PPC" != "yes" ]]; then
1039    if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
1040      AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
# Line 952 | Line 1116 | EOF
1116   fi
1117   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1118  
1119 + dnl Utility macro used by next two tests.
1120 + dnl AC_EXAMINE_OBJECT(C source code,
1121 + dnl     commands examining object file,
1122 + dnl     [commands to run if compile failed]):
1123 + dnl
1124 + dnl Compile the source code to an object file; then convert it into a
1125 + dnl printable representation.  All unprintable characters and
1126 + dnl asterisks (*) are replaced by dots (.).  All white space is
1127 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1128 + dnl output, but runs of newlines are compressed to a single newline.
1129 + dnl Finally, line breaks are forcibly inserted so that no line is
1130 + dnl longer than 80 columns and the file ends with a newline.  The
1131 + dnl result of all this processing is in the file conftest.dmp, which
1132 + dnl may be examined by the commands in the second argument.
1133 + dnl
1134 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1135 + [AC_LANG_SAVE
1136 + AC_LANG_C
1137 + dnl Next bit cribbed from AC_TRY_COMPILE.
1138 + cat > conftest.$ac_ext <<EOF
1139 + [#line __oline__ "configure"
1140 + #include "confdefs.h"
1141 + $1
1142 + ]EOF
1143 + if AC_TRY_EVAL(ac_compile); then
1144 +  od -c conftest.o |
1145 +    sed ['s/^[0-7]*[    ]*/ /
1146 +          s/\*/./g
1147 +          s/ \\n/*/g
1148 +          s/ [0-9][0-9][0-9]/./g
1149 +          s/  \\[^ ]/./g'] |
1150 +    tr -d '
1151 + ' | tr -s '*' '
1152 + ' | fold | sed '$a\
1153 + ' > conftest.dmp
1154 +  $2
1155 + ifelse($3, , , else
1156 +  $3
1157 + )dnl
1158 + fi
1159 + rm -rf conftest*
1160 + AC_LANG_RESTORE])
1161 +
1162 + dnl Floating point format probe.
1163 + dnl The basic concept is the same as the above: grep the object
1164 + dnl file for an interesting string.  We have to watch out for
1165 + dnl rounding changing the values in the object, however; this is
1166 + dnl handled by ignoring the least significant byte of the float.
1167 + dnl
1168 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1169 + dnl It does know about PDP-10 idiosyncratic format, but this is
1170 + dnl not presently supported by GCC.  S/390 "binary floating point"
1171 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1172 + dnl as ASCII?)
1173 + dnl
1174 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1175 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1176 + [gcc_AC_EXAMINE_OBJECT(
1177 + [/* This will not work unless sizeof(double) == 8.  */
1178 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1179 +
1180 + /* This structure must have no internal padding.  */
1181 + struct possibility {
1182 +  char prefix[8];
1183 +  double candidate;
1184 +  char postfix[8];
1185 + };
1186 +
1187 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1188 + struct possibility table [] =
1189 + {
1190 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1191 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1192 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1193 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1194 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1195 + };],
1196 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1197 +    ac_cv_c_float_format='IEEE (big-endian)'
1198 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1199 +    ac_cv_c_float_format='IEEE (big-endian)'
1200 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1201 +    ac_cv_c_float_format='IEEE (little-endian)'
1202 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1203 +    ac_cv_c_float_format='IEEE (little-endian)'
1204 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1205 +    ac_cv_c_float_format='VAX D-float'
1206 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1207 +    ac_cv_c_float_format='PDP-10'
1208 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1209 +    ac_cv_c_float_format='IBM 370 hex'
1210 +  else
1211 +    AC_MSG_ERROR(Unknown floating point format)
1212 +  fi],
1213 +  [AC_MSG_ERROR(compile failed)])
1214 + ])
1215 + # IEEE is the default format.  If the float endianness isn't the same
1216 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1217 + # (which is a tristate: yes, no, default).  This is only an issue with
1218 + # IEEE; the other formats are only supported by a few machines each,
1219 + # all with the same endianness.
1220 + format=IEEE_FLOAT_FORMAT
1221 + fbigend=
1222 + case $ac_cv_c_float_format in
1223 +    'IEEE (big-endian)' )
1224 +        if test $ac_cv_c_bigendian = no; then
1225 +            fbigend=1
1226 +        fi
1227 +        ;;
1228 +    'IEEE (little-endian)' )
1229 +        if test $ac_cv_c_bigendian = yes; then
1230 +            fbigend=0
1231 +        fi
1232 +        ;;
1233 +    'VAX D-float' )
1234 +        format=VAX_FLOAT_FORMAT
1235 +        ;;
1236 +    'PDP-10' )
1237 +        format=PDP10_FLOAT_FORMAT
1238 +        ;;
1239 +    'IBM 370 hex' )
1240 +        format=IBM_FLOAT_FORMAT
1241 +        ;;
1242 + esac
1243 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1244 +  [Define to the floating point format of the host machine.])
1245 + if test -n "$fbigend"; then
1246 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1247 +  [Define to 1 if the host machine stores floating point numbers in
1248 +   memory with the word containing the sign bit at the lowest address,
1249 +   or to 0 if it does it the other way around.
1250 +
1251 +   This macro should not be defined if the ordering is the same as for
1252 +   multi-word integers.])
1253 + fi
1254 + ])
1255 +
1256 + dnl Check for host float format
1257 + gcc_AC_C_FLOAT_FORMAT
1258 +
1259   dnl Platform specific binary postprocessor
1260   AC_PATH_PROG(BLESS, "true")
1261   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 962 | Line 1266 | fi
1266   dnl Check for GCC 2.7 or higher.
1267   HAVE_GCC27=no
1268   AC_MSG_CHECKING(for GCC 2.7 or higher)
1269 < AC_EGREP_CPP(xyes,
1270 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1271 <  xyes
1272 < #endif
1273 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1269 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1270 >                                     # error gcc < 2.7
1271 >                                     typedef syntax error;
1272 >                                     #endif
1273 >                                   ]])],
1274 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1275 >                  [AC_MSG_RESULT(no)])
1276  
1277   dnl Check for GCC 3.0 or higher.
1278   HAVE_GCC30=no
1279   AC_MSG_CHECKING(for GCC 3.0 or higher)
1280 < AC_EGREP_CPP(xyes,
1281 < [#if __GNUC__ >= 3
1282 <  xyes
1283 < #endif
1284 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1280 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1281 >                                     # error gcc < 3
1282 >                                     typedef syntax error;
1283 >                                     #endif
1284 >                                   ]])],
1285 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1286 >                  [AC_MSG_RESULT(no)])
1287  
1288   dnl Check for ICC.
1289   AC_MSG_CHECKING(for ICC)
# Line 986 | Line 1294 | fi
1294   AC_MSG_RESULT($HAVE_ICC)
1295  
1296   dnl Determine the generated object format
1297 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1297 > AC_CACHE_CHECK([the format of compiler generated objects],
1298    ac_cv_object_format, [
1299    echo 'int i;' > conftest.$ac_ext
1300    ac_cv_object_format=no
# Line 995 | Line 1303 | AC_CACHE_CHECK([whether the compiler can
1303      *"ELF"*)
1304        ac_cv_object_format=elf
1305        ;;
1306 +    *"Mach-O"*)
1307 +      ac_cv_object_format=mach
1308 +      ;;
1309      *)
1310        ac_cv_object_format=unknown
1311        ;;
# Line 1003 | Line 1314 | AC_CACHE_CHECK([whether the compiler can
1314    rm -rf conftest*
1315   ])
1316  
1317 + dnl Add -fno-strict-aliasing for slirp sources
1318 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1319 +  SAVED_CFLAGS="$CFLAGS"
1320 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1321 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1322 +    ac_cv_gcc_no_strict_aliasing, [
1323 +    AC_TRY_COMPILE([],[],
1324 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1325 +      [ac_cv_gcc_no_strict_aliasing=no])
1326 +  ])
1327 +  CFLAGS="$SAVED_CFLAGS"
1328 + fi
1329 +
1330 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1331 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1332 +  SAVED_CFLAGS="$CFLAGS"
1333 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1334 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1335 +    ac_cv_gcc_mdynamic_no_pic, [
1336 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1337 +  ])
1338 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1339 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1340 +  else
1341 +    CFLAGS="$SAVED_CFLAGS"
1342 +  fi
1343 + fi
1344 +
1345   dnl CPU emulator sources
1346   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1347    CPUSRCS="\
1348      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1349 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1350      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1351      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1352      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
1353 <    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
1353 >    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \
1354 >    ../kpx_cpu/src/utils/utils-cpuinfo.cpp"
1355    CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
1356  
1357    dnl Enable JIT compiler, if possible
# Line 1027 | Line 1368 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1368        i?86:elf)
1369          ac_cv_use_dyngen=yes
1370          ;;
1371 +      mips:elf)
1372 +        ac_cv_use_dyngen=yes
1373 +        ;;
1374 +      powerpc:mach)
1375 +        ac_cv_use_dyngen=yes
1376 +        ;;
1377 +      i?86:mach)
1378 +        ac_cv_use_dyngen=yes
1379 +        ;;
1380        *:*)
1381          ac_cv_use_dyngen=no
1382          ;;
# Line 1036 | Line 1386 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1386          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1387            DYNGEN_CC=$CXX
1388          else
1389 <          for p in /usr/bin /usr/local/bin; do
1389 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1390              gxx="$p/g++"
1391              if [[ -x "$gxx" ]]; then
1392                DYNGEN_CC="$gxx"
# Line 1044 | Line 1394 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1394            done
1395          fi
1396        fi
1397 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1397 >      if [[ -z "$DYNGEN_CC" ]]; then
1398          ac_cv_use_dyngen=no
1399        fi
1400      ])
1401      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1402        case $host_cpu in
1403        i?86)
1404 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1055 <        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1056 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1057 <        else
1058 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1059 <        fi
1060 <        saved_CPPFLAGS=$CPPFLAGS
1061 <        CPPFLAGS="$CPPFLAGS -mmmx"
1062 <        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
1063 <        CPPFLAGS="$CPPFLAGS -msse"
1064 <        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
1065 <        CPPFLAGS="$CPPFLAGS -msse2"
1066 <        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
1067 <        CPPFLAGS=$saved_CPPFLAGS
1404 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1405          ;;
1406 <      x86_64)
1407 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1406 >      mips)
1407 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1408          ;;
1409 +      powerpc)
1410 +        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1411 +          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1412 +        fi
1413 +        ;;
1414 +      esac
1415 +      have_dyngen_gcc3=no
1416 +      case "x`$DYNGEN_CC -dumpversion`" in
1417 +      x[12].*) ;;
1418 +      x*) have_dyngen_gcc3=yes ;;
1419        esac
1420 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
1421 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1420 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1421 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions"
1422 >      else
1423 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1424 >      fi
1425 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1426 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1427          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1428        fi
1429 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1430 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1431 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1432 +      else
1433 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1434 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1435 +      fi
1436      else
1437        WANT_JIT=no
1438      fi
# Line 1085 | Line 1444 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1444        CPUSRCS="\
1445          ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
1446          ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
1447 <        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
1447 >        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \
1448 >        ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS"
1449      fi
1450    fi
1451    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
1452   else
1453    WANT_JIT=no
1454   fi
1095 if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1096  AC_CACHE_CHECK([whether static data regions are executable],
1097    ac_cv_have_static_data_exec, [
1098    AC_TRY_RUN([int main(void) {
1099 #if defined(__powerpc__)
1100      static unsigned int p[8] = {0x4e800020,};
1101      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1102      asm volatile("sync" : : : "memory");
1103      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
1104      asm volatile("sync" : : : "memory");
1105      asm volatile("isync" : : : "memory");
1106      ((void (*)(void))p)();
1107      return 0;
1108 #endif
1109      return 1;
1110    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
1111    dnl When cross-compiling, do not assume anything.
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.])
1120
1455   if [[ "x$WANT_JIT" = "xyes" ]]; then
1456    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1457   fi
1458  
1459 + dnl Higher level optimizations with MIPSPro compilers are possible
1460 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1461 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1462 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1463 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1464 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1465 + fi
1466 +
1467 + dnl Check for linker script support
1468 + case $target_os:$target_cpu in
1469 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1470 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1471 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1472 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1473 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1474 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1475 + esac
1476 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1477 +  AC_CACHE_CHECK([whether linker script is usable],
1478 +    ac_cv_linker_script_works, [
1479 +    AC_LANG_SAVE
1480 +    AC_LANG_CPLUSPLUS
1481 +    saved_LDFLAGS="$LDFLAGS"
1482 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1483 +    AC_TRY_RUN(
1484 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1485 +      [ac_cv_linker_script_works=yes],
1486 +      [ac_cv_linker_script_works=no],
1487 +      dnl When cross-compiling, assume it works
1488 +      [ac_cv_linker_script_works="guessing yes"]
1489 +    )
1490 +    AC_LANG_RESTORE
1491 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1492 +      LDFLAGS="$saved_LDFLAGS"
1493 +      LINKER_SCRIPT_FLAGS=""
1494 +    fi
1495 +  ])
1496 + fi
1497 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1498 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1499 +
1500   dnl Generate Makefile.
1501 + AC_SUBST(PERL)
1502   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1503   AC_SUBST(DYNGENSRCS)
1504   AC_SUBST(DYNGEN_CC)
1505 + AC_SUBST(DYNGEN_CFLAGS)
1506 + AC_SUBST(DYNGEN_CXXFLAGS)
1507   AC_SUBST(DYNGEN_OP_FLAGS)
1508   AC_SUBST(SYSSRCS)
1509   AC_SUBST(CPUSRCS)
# Line 1141 | Line 1519 | echo
1519   echo SheepShaver configuration summary:
1520   echo
1521   echo SDL support ...................... : $SDL_SUPPORT
1522 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1523   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1524   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1525   echo Using PowerPC emulator ........... : $EMULATED_PPC

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines