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.52 by gbeauche, 2006-05-06T10:42:51Z

# 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 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 244 | Line 246 | UISRCS=../dummy/prefs_editor_dummy.cpp
246   case "x$WANT_GTK" in
247   xgtk2*)
248    AM_PATH_GTK_2_0(1.3.15, [
249 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
250 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
249 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
250 <    LIBS="$LIBS $GTK_LIBS"
251 <    UISRCS=prefs_editor_gtk.cpp
249 >    GUI_CFLAGS="$GTK_CFLAGS"
250 >    GUI_LIBS="$GTK_LIBS"
251      WANT_GTK=gtk2
252    ], [
253      case "x${WANT_GTK}x" in
# Line 266 | Line 265 | xgtk2*)
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"
271 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
272 <    LIBS="$LIBS $GTK_LIBS"
273 <    UISRCS=prefs_editor_gtk.cpp
268 >    GUI_CFLAGS="$GTK_CFLAGS"
269 >    GUI_LIBS="$GTK_LIBS"
270    ], [
271      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
272      WANT_GTK=no
273    ])
274   fi
275 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
276 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
277 +  UISRCS=prefs_editor_gtk.cpp
278 + fi
279 + AC_SUBST(GUI_CFLAGS)
280 + AC_SUBST(GUI_LIBS)
281 +
282 + dnl Build external GUI if requested.
283 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
284 +  WANT_STANDALONE_GUI=no
285 + fi
286 + if [[ "$WANT_GTK" = "no" ]]; then
287 +  WANT_STANDALONE_GUI=no
288 + fi
289 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
290  
291   dnl We use ESD if possible.
292   if [[ "x$WANT_ESD" = "xyes" ]]; then
# Line 431 | Line 442 | AC_CHECK_FILE([/dev/ptc],
442   )
443   dnl (end of code from openssh-3.2.2p1 configure.ac)
444  
445 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
446 + dnl doesn't work or is unimplemented. On these systems (mostly older
447 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
448 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
449 +  ac_cv_nonblocking_io, [
450 +  case "$host" in
451 +  *-*-osf*)
452 +    ac_cv_nonblocking_io=FIONBIO
453 +    ;;
454 +  *-*-sunos4*)
455 +    ac_cv_nonblocking_io=FIONBIO
456 +    ;;
457 +  *-*-ultrix*)
458 +    ac_cv_nonblocking_io=FIONBIO
459 +    ;;
460 +  *)
461 +    ac_cv_nonblocking_io=O_NONBLOCK
462 +    ;;
463 +  esac
464 + ])
465 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
466 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
467 + fi
468 +
469 + dnl Check whether compiler supports byte bit-fields
470 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
471 +  ac_cv_have_byte_bitfields, [
472 +  AC_LANG_SAVE
473 +  AC_LANG_CPLUSPLUS
474 +  AC_TRY_RUN([
475 +    struct A {
476 +      unsigned char b1:4;
477 +      unsigned char b2:4;
478 +      unsigned char c;
479 +      unsigned short s;
480 +      unsigned char a[4];
481 +    };
482 +
483 +    int main(void) {
484 +      A a;
485 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
486 +    }],
487 +    [ac_cv_have_byte_bitfields=yes],
488 +    [ac_cv_have_byte_bitfields=no],
489 +    dnl When cross-compiling, assume only GCC supports this
490 +    [if [[ "$GCC" = "yes" ]]; then
491 +      ac_cv_have_byte_bitfields="guessing yes"
492 +    else
493 +      ac_cv_have_byte_bitfields="guessing no"
494 +    fi]
495 +    )
496 +  AC_LANG_RESTORE
497 + ])
498 +
499   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
500 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
500 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
501    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
502    AC_CACHE_CHECK([whether compiler supports framework $1],
503      ac_Framework, [
504      saved_LIBS="$LIBS"
505      LIBS="$LIBS -framework $1"
506      AC_TRY_LINK(
507 <      [$2], [int main(void) { return 0; }],
507 >      [$2], [],
508        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
509      )
510    ])
# Line 491 | Line 556 | darwin*)
556      EXTFSSRC=../MacOSX/extfs_macosx.mm
557    fi
558    ;;
559 + irix*)
560 +  AUDIOSRC=Irix/audio_irix.cpp
561 +  LIBS="$LIBS -laudio"
562 +  WANT_ESD=no
563 +
564 +  dnl Check if our compiler supports -IPA (MIPSPro)
565 +  HAVE_IPA=no
566 +  ocflags="$CFLAGS"
567 +  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
568 +  AC_MSG_CHECKING(if "-IPA" works)
569 +  dnl Do a test compile of an empty function
570 +  AC_TRY_COMPILE([#if defined __GNUC__
571 +                  # error GCC does not support IPA yet
572 +                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
573 +  CFLAGS="$ocflags"
574 +  ;;
575   esac
576  
577   dnl Is the slirp library supported?
578 < if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
578 > case "$ac_cv_have_byte_bitfields" in
579 > yes|"guessing yes")
580 >  CAN_SLIRP=yes
581 >  ETHERSRC=ether_unix.cpp
582 >  ;;
583 > esac
584 > if [[ -n "$CAN_SLIRP" ]]; then
585    AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
586    SLIRP_SRCS="\
587      ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
# Line 536 | Line 623 | dnl to be put into the config.h file
623   dnl $1 -- the macro to define
624   dnl $2 -- the value to translate
625   dnl $3 -- template name
626 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
626 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
627      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
628          AC_DEFINE($1, 1, $3)
629      fi
# Line 1178 | Line 1265 | HAVE_GCC27=no
1265   AC_MSG_CHECKING(for GCC 2.7 or higher)
1266   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1267                                       # error gcc < 2.7
1268 +                                     typedef syntax error;
1269                                       #endif
1270                                     ]])],
1271                    [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
# Line 1188 | Line 1276 | HAVE_GCC30=no
1276   AC_MSG_CHECKING(for GCC 3.0 or higher)
1277   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1278                                       # error gcc < 3
1279 +                                     typedef syntax error;
1280                                       #endif
1281                                     ]])],
1282                    [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
# Line 1235 | Line 1324 | if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1324    CFLAGS="$SAVED_CFLAGS"
1325   fi
1326  
1327 < dnl Add -mdynamic-no-pic for MacOS X
1328 < if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1327 > dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1328 > if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1329    SAVED_CFLAGS="$CFLAGS"
1330    CFLAGS="$CFLAGS -mdynamic-no-pic"
1331    AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
# Line 1275 | Line 1364 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1364        i?86:elf)
1365          ac_cv_use_dyngen=yes
1366          ;;
1367 +      mips:elf)
1368 +        ac_cv_use_dyngen=yes
1369 +        ;;
1370        powerpc:mach)
1371          ac_cv_use_dyngen=yes
1372          ;;
1373 +      i?86:mach)
1374 +        ac_cv_use_dyngen=yes
1375 +        ;;
1376        *:*)
1377          ac_cv_use_dyngen=no
1378          ;;
# Line 1287 | Line 1382 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1382          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1383            DYNGEN_CC=$CXX
1384          else
1385 <          for p in /usr/bin /usr/local/bin; do
1385 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1386              gxx="$p/g++"
1387              if [[ -x "$gxx" ]]; then
1388                DYNGEN_CC="$gxx"
# Line 1302 | Line 1397 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1397      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1398        case $host_cpu in
1399        i?86)
1400 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1400 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1401 >        ;;
1402 >      mips)
1403 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1404          ;;
1405        powerpc)
1406          if [[ "x$ac_cv_object_format" = "xmach" ]]; then
# Line 1310 | Line 1408 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1408          fi
1409          ;;
1410        esac
1411 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1411 >      have_dyngen_gcc3=no
1412 >      case "x`$DYNGEN_CC -dumpversion`" in
1413 >      x[12].*) ;;
1414 >      x*) have_dyngen_gcc3=yes ;;
1415 >      esac
1416 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1417          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1418        else
1419          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1420        fi
1421 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1422 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1421 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1422 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1423          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1424        fi
1425 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1426 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1427 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1428 +      else
1429 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1430 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1431 +      fi
1432      else
1433        WANT_JIT=no
1434      fi
# Line 1367 | Line 1477 | if [[ "x$WANT_JIT" = "xyes" ]]; then
1477    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1478   fi
1479  
1480 + dnl Higher level optimizations with MIPSPro compilers are possible
1481 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1482 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1483 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1484 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1485 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1486 + fi
1487 +
1488 + dnl Check for linker script support
1489 + case $target_os:$target_cpu in
1490 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1491 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1492 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1493 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1494 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1495 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1496 + esac
1497 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1498 +  AC_CACHE_CHECK([whether linker script is usable],
1499 +    ac_cv_linker_script_works, [
1500 +    AC_LANG_SAVE
1501 +    AC_LANG_CPLUSPLUS
1502 +    saved_LDFLAGS="$LDFLAGS"
1503 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1504 +    AC_TRY_RUN(
1505 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1506 +      [ac_cv_linker_script_works=yes],
1507 +      [ac_cv_linker_script_works=no],
1508 +      dnl When cross-compiling, assume it works
1509 +      [ac_cv_linker_script_works="guessing yes"]
1510 +    )
1511 +    AC_LANG_RESTORE
1512 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1513 +      LDFLAGS="$saved_LDFLAGS"
1514 +      LINKER_SCRIPT_FLAGS=""
1515 +    fi
1516 +  ])
1517 + fi
1518 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1519 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1520 +
1521   dnl Generate Makefile.
1522   AC_SUBST(PERL)
1523   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1524   AC_SUBST(DYNGENSRCS)
1525   AC_SUBST(DYNGEN_CC)
1526 + AC_SUBST(DYNGEN_CFLAGS)
1527 + AC_SUBST(DYNGEN_CXXFLAGS)
1528   AC_SUBST(DYNGEN_OP_FLAGS)
1529   AC_SUBST(SYSSRCS)
1530   AC_SUBST(CPUSRCS)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines