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.41 by gbeauche, 2005-11-30T21:42:22Z vs.
Revision 1.58 by gbeauche, 2007-06-13T12:11:55Z

# 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 491 | Line 559 | darwin*)
559      EXTFSSRC=../MacOSX/extfs_macosx.mm
560    fi
561    ;;
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 < if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
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  \
# Line 536 | 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 1178 | Line 1268 | HAVE_GCC27=no
1268   AC_MSG_CHECKING(for GCC 2.7 or higher)
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],
# Line 1188 | Line 1279 | HAVE_GCC30=no
1279   AC_MSG_CHECKING(for GCC 3.0 or higher)
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],
# Line 1258 | Line 1350 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
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 1275 | 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          ;;
# Line 1290 | 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 1305 | Line 1401 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
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"
1404 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1405 >        ;;
1406 >      mips)
1407 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1408          ;;
1409        powerpc)
1410          if [[ "x$ac_cv_object_format" = "xmach" ]]; then
# Line 1313 | Line 1412 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1412          fi
1413          ;;
1414        esac
1415 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1416 <        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1415 >      have_dyngen_gcc3=no
1416 >      case "x`$DYNGEN_CC -dumpversion`" in
1417 >      x[12].*) ;;
1418 >      x*) have_dyngen_gcc3=yes ;;
1419 >      esac
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_GCC30" = "xyes" ]]; then
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 1333 | 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
1343 if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1344  AC_CACHE_CHECK([whether static data regions are executable],
1345    ac_cv_have_static_data_exec, [
1346    AC_TRY_RUN([int main(void) {
1347 #if defined(__powerpc__) || defined(__ppc__)
1348      static unsigned int p[8] = {0x4e800020,};
1349      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1350      asm volatile("sync" : : : "memory");
1351      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
1352      asm volatile("sync" : : : "memory");
1353      asm volatile("isync" : : : "memory");
1354      ((void (*)(void))p)();
1355      return 0;
1356 #endif
1357      return 1;
1358    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
1359    dnl When cross-compiling, do not assume anything.
1360    ac_cv_have_static_data_exec=no
1361    )
1362  ])
1363 else
1364  ac_cv_use_dyngen=no
1365 fi
1366 AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1367  [Define if your system marks static data pages as executable.])
1368
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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines