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.37 by gbeauche, 2005-07-10T15:43:33Z vs.
Revision 1.61 by gbeauche, 2007-12-30T09:15:00Z

# 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 28 | Line 28 | AC_ARG_ENABLE(fbdev-dga,    [  --enable-
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=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]],
34    [case "$withval" in
# Line 105 | Line 106 | if [[ "x$WANT_MON" = "xyes" ]]; then
106    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
107      AC_MSG_RESULT(yes)
108      AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
109 <    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c"
109 >    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c $mon_srcdir/disass/mips-dis.c $mon_srcdir/disass/mips-opc.c $mon_srcdir/disass/mips16-opc.c"
110      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
111      AC_CHECK_LIB(ncurses, tgetent, ,
112        AC_CHECK_LIB(termcap, tgetent, ,
# Line 125 | 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 243 | Line 245 | dnl We use GTK+ if possible.
245   UISRCS=../dummy/prefs_editor_dummy.cpp
246   case "x$WANT_GTK" in
247   xgtk2*)
248 +  WANT_GTK=no
249    AM_PATH_GTK_2_0(1.3.15, [
250 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
251 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
249 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
250 <    LIBS="$LIBS $GTK_LIBS"
251 <    UISRCS=prefs_editor_gtk.cpp
250 >    GUI_CFLAGS="$GTK_CFLAGS"
251 >    GUI_LIBS="$GTK_LIBS"
252      WANT_GTK=gtk2
253    ], [
254      case "x${WANT_GTK}x" in
# Line 259 | Line 259 | xgtk2*)
259      *)
260        AC_MSG_WARN([Could not find GTK+, disabling user interface.])
261        WANT_GTK=no
262 <      ;;
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"
272 <    LIBS="$LIBS $GTK_LIBS"
273 <    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.])
276    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.])
289    WANT_ESD=no
304    ])
305   fi
306  
# Line 431 | 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 453 | Line 521 | 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 + AC_CHECK_FRAMEWORK(CoreAudio, [#include <CoreAudio/CoreAudio.h>])
525 + AC_CHECK_FRAMEWORK(AudioUnit, [#include <AudioUnit/AudioUnit.h>])
526 + AC_CHECK_FRAMEWORK(AudioToolbox, [#include <AudioToolbox/AudioToolbox.h>])
527  
528   dnl Select system-dependant sources.
529   SERIALSRC=serial_unix.cpp
530   ETHERSRC=../dummy/ether_dummy.cpp
531   SCSISRC=../dummy/scsi_dummy.cpp
532   AUDIOSRC=../dummy/audio_dummy.cpp
533 + PREFSSRC=../dummy/prefs_dummy.cpp
534   EXTFSSRC=extfs_unix.cpp
535   EXTRASYSSRCS=
536   case "$target_os" in
# Line 488 | Line 560 | darwin*)
560      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
561    fi
562    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
563 <    EXTFSSRC=../MacOSX/extfs_macosx.mm
563 >    EXTFSSRC=../MacOSX/extfs_macosx.cpp
564 >    PREFSSRC="../MacOSX/prefs_macosx.mm ../MacOSX/PrefsEditor/PrefsEditor.mm"
565 >    CPPFLAGS="$CPPFLAGS -I../MacOSX/PrefsEditor"
566 > fi
567 >  if [[ "x$ac_cv_framework_CoreAudio" = "xyes" ]]; then
568 >    AUDIOSRC="../MacOSX/audio_macosx.cpp ../MacOSX/AudioBackEnd.cpp ../MacOSX/AudioDevice.cpp ../MacOSX/MacOSX_sound_if.cpp"
569    fi
570    ;;
571 + irix*)
572 +  AUDIOSRC=Irix/audio_irix.cpp
573 +  LIBS="$LIBS -laudio"
574 +  WANT_ESD=no
575 +
576 +  dnl Check if our compiler supports -IPA (MIPSPro)
577 +  HAVE_IPA=no
578 +  ocflags="$CFLAGS"
579 +  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
580 +  AC_MSG_CHECKING(if "-IPA" works)
581 +  dnl Do a test compile of an empty function
582 +  AC_TRY_COMPILE([#if defined __GNUC__
583 +                  # error GCC does not support IPA yet
584 +                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
585 +  CFLAGS="$ocflags"
586 +  ;;
587   esac
588  
589   dnl Is the slirp library supported?
590 < if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
590 > case "$ac_cv_have_byte_bitfields" in
591 > yes|"guessing yes")
592 >  CAN_SLIRP=yes
593 >  ETHERSRC=ether_unix.cpp
594 >  ;;
595 > esac
596 > if [[ -n "$CAN_SLIRP" ]]; then
597    AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
598    SLIRP_SRCS="\
599      ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
# Line 529 | Line 628 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
628    AUDIOSRC="../SDL/audio_sdl.cpp"
629   fi
630  
631 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
631 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $PREFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
632  
633   dnl Define a macro that translates a yesno-variable into a C macro definition
634   dnl to be put into the config.h file
635   dnl $1 -- the macro to define
636   dnl $2 -- the value to translate
637   dnl $3 -- template name
638 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
638 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
639      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
640          AC_DEFINE($1, 1, $3)
641      fi
# Line 1178 | Line 1277 | HAVE_GCC27=no
1277   AC_MSG_CHECKING(for GCC 2.7 or higher)
1278   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1279                                       # error gcc < 2.7
1280 +                                     typedef syntax error;
1281                                       #endif
1282                                     ]])],
1283                    [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
# Line 1188 | Line 1288 | HAVE_GCC30=no
1288   AC_MSG_CHECKING(for GCC 3.0 or higher)
1289   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1290                                       # error gcc < 3
1291 +                                     typedef syntax error;
1292                                       #endif
1293                                     ]])],
1294                    [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
# Line 1235 | Line 1336 | if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1336    CFLAGS="$SAVED_CFLAGS"
1337   fi
1338  
1339 < dnl Add -mdynamic-no-pic for MacOS X
1340 < if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1339 > dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1340 > if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1341    SAVED_CFLAGS="$CFLAGS"
1342    CFLAGS="$CFLAGS -mdynamic-no-pic"
1343    AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
# Line 1258 | Line 1359 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1359      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1360      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1361      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
1362 <    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
1362 >    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \
1363 >    ../kpx_cpu/src/utils/utils-cpuinfo.cpp"
1364    CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
1365  
1366    dnl Enable JIT compiler, if possible
# Line 1275 | Line 1377 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1377        i?86:elf)
1378          ac_cv_use_dyngen=yes
1379          ;;
1380 +      mips:elf)
1381 +        ac_cv_use_dyngen=yes
1382 +        ;;
1383        powerpc:mach)
1384          ac_cv_use_dyngen=yes
1385          ;;
1386 +      i?86:mach)
1387 +        ac_cv_use_dyngen=yes
1388 +        ;;
1389        *:*)
1390          ac_cv_use_dyngen=no
1391          ;;
# Line 1287 | Line 1395 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1395          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1396            DYNGEN_CC=$CXX
1397          else
1398 <          for p in /usr/bin /usr/local/bin; do
1398 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1399              gxx="$p/g++"
1400              if [[ -x "$gxx" ]]; then
1401                DYNGEN_CC="$gxx"
# Line 1302 | Line 1410 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1410      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1411        case $host_cpu in
1412        i?86)
1413 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1413 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1414 >        ;;
1415 >      mips)
1416 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1417          ;;
1418        powerpc)
1419          if [[ "x$ac_cv_object_format" = "xmach" ]]; then
# Line 1310 | Line 1421 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1421          fi
1422          ;;
1423        esac
1424 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1425 <        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1424 >      have_dyngen_gcc3=no
1425 >      case "x`$DYNGEN_CC -dumpversion`" in
1426 >      x[12].*) ;;
1427 >      x*) have_dyngen_gcc3=yes ;;
1428 >      esac
1429 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1430 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions"
1431        else
1432          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1433        fi
1434 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1435 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1434 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1435 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1436          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1437        fi
1438 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1439 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1440 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1441 +      else
1442 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1443 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1444 +      fi
1445      else
1446        WANT_JIT=no
1447      fi
# Line 1330 | Line 1453 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1453        CPUSRCS="\
1454          ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
1455          ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
1456 <        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
1456 >        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \
1457 >        ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS"
1458      fi
1459    fi
1460    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
1461   else
1462    WANT_JIT=no
1463   fi
1340 if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1341  AC_CACHE_CHECK([whether static data regions are executable],
1342    ac_cv_have_static_data_exec, [
1343    AC_TRY_RUN([int main(void) {
1344 #if defined(__powerpc__) || defined(__ppc__)
1345      static unsigned int p[8] = {0x4e800020,};
1346      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1347      asm volatile("sync" : : : "memory");
1348      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
1349      asm volatile("sync" : : : "memory");
1350      asm volatile("isync" : : : "memory");
1351      ((void (*)(void))p)();
1352      return 0;
1353 #endif
1354      return 1;
1355    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
1356    dnl When cross-compiling, do not assume anything.
1357    ac_cv_have_static_data_exec=no
1358    )
1359  ])
1360 else
1361  ac_cv_use_dyngen=no
1362 fi
1363 AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1364  [Define if your system marks static data pages as executable.])
1365
1464   if [[ "x$WANT_JIT" = "xyes" ]]; then
1465    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1466   fi
1467  
1468 + dnl Higher level optimizations with MIPSPro compilers are possible
1469 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1470 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1471 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1472 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1473 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1474 + fi
1475 +
1476 + dnl Check for linker script support
1477 + case $target_os:$target_cpu in
1478 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1479 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1480 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1481 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1482 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1483 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1484 + esac
1485 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1486 +  AC_CACHE_CHECK([whether linker script is usable],
1487 +    ac_cv_linker_script_works, [
1488 +    AC_LANG_SAVE
1489 +    AC_LANG_CPLUSPLUS
1490 +    saved_LDFLAGS="$LDFLAGS"
1491 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1492 +    AC_TRY_RUN(
1493 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1494 +      [ac_cv_linker_script_works=yes],
1495 +      [ac_cv_linker_script_works=no],
1496 +      dnl When cross-compiling, assume it works
1497 +      [ac_cv_linker_script_works="guessing yes"]
1498 +    )
1499 +    AC_LANG_RESTORE
1500 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1501 +      LDFLAGS="$saved_LDFLAGS"
1502 +      LINKER_SCRIPT_FLAGS=""
1503 +    fi
1504 +  ])
1505 + fi
1506 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1507 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1508 +
1509   dnl Generate Makefile.
1510   AC_SUBST(PERL)
1511   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1512   AC_SUBST(DYNGENSRCS)
1513   AC_SUBST(DYNGEN_CC)
1514 + AC_SUBST(DYNGEN_CFLAGS)
1515 + AC_SUBST(DYNGEN_CXXFLAGS)
1516   AC_SUBST(DYNGEN_OP_FLAGS)
1517   AC_SUBST(SYSSRCS)
1518   AC_SUBST(CPUSRCS)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines