ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/configure.ac
(Generate patch)

Comparing BasiliskII/src/Unix/configure.ac (file contents):
Revision 1.57 by gbeauche, 2006-01-15T11:38:41Z vs.
Revision 1.72 by gbeauche, 2007-06-07T11:52:14Z

# 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 + AC_ARG_ENABLE(standalone-gui,[  --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no])
18 +
19   dnl Video options.
20   AC_ARG_ENABLE(xf86-dga,      [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
21   AC_ARG_ENABLE(xf86-vidmode,  [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
# Line 116 | Line 118 | if [[ "x$WANT_MON" = "xyes" ]]; then
118    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
119      AC_MSG_RESULT(yes)
120      AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
121 <    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c"
121 >    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.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"
122      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
123      AC_CHECK_LIB(ncurses, tgetent, ,
124        AC_CHECK_LIB(termcap, tgetent, ,
# Line 251 | Line 253 | UISRCS=../dummy/prefs_editor_dummy.cpp
253   case "x$WANT_GTK" in
254   xgtk2*)
255    AM_PATH_GTK_2_0(1.3.15, [
256 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
257 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
256 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
257 <    LIBS="$LIBS $GTK_LIBS"
258 <    UISRCS=prefs_editor_gtk.cpp
256 >    GUI_CFLAGS="$GTK_CFLAGS"
257 >    GUI_LIBS="$GTK_LIBS"
258      WANT_GTK=gtk2
259    ], [
260      case "x${WANT_GTK}x" in
# Line 273 | Line 272 | xgtk2*)
272   esac
273   if [[ "x$WANT_GTK" = "xgtk" ]]; then
274    AM_PATH_GTK(1.2.0, [
275 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
276 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
278 <    LIBS="$LIBS $GTK_LIBS"
279 <    UISRCS=prefs_editor_gtk.cpp
275 >    GUI_CFLAGS="$GTK_CFLAGS"
276 >    GUI_LIBS="$GTK_LIBS"
277      dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if
278      dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which
279      dnl includes <libintl.h>
280      AM_GNU_GETTEXT
281      B2_PATH_GNOMEUI([
282        AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.])
283 <      CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
284 <      LIBS="$LIBS $GNOMEUI_LIBS"
283 >      GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS"
284 >      GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS"
285      ], [])
286    ], [
287      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
288      WANT_GTK=no
289    ])
290   fi
291 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
292 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
293 +  UISRCS=prefs_editor_gtk.cpp
294 + fi
295 + AC_SUBST(GUI_CFLAGS)
296 + AC_SUBST(GUI_LIBS)
297 +
298 + dnl Build external GUI if requested.
299 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
300 +  WANT_STANDALONE_GUI=no
301 + fi
302 + if [[ "$WANT_GTK" = "no" ]]; then
303 +  WANT_STANDALONE_GUI=no
304 + fi
305 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
306  
307   dnl We use ESD if possible.
308   if [[ "x$WANT_ESD" = "xyes" ]]; then
# Line 422 | Line 434 | AC_CHECK_FILE([/dev/ptc],
434   dnl (end of code from openssh-3.2.2p1 configure.ac)
435  
436  
437 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
438 + dnl doesn't work or is unimplemented. On these systems (mostly older
439 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
440 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
441 +  ac_cv_nonblocking_io, [
442 +  case "$host" in
443 +  *-*-osf*)
444 +    ac_cv_nonblocking_io=FIONBIO
445 +    ;;
446 +  *-*-sunos4*)
447 +    ac_cv_nonblocking_io=FIONBIO
448 +    ;;
449 +  *-*-ultrix*)
450 +    ac_cv_nonblocking_io=FIONBIO
451 +    ;;
452 +  *)
453 +    ac_cv_nonblocking_io=O_NONBLOCK
454 +    ;;
455 +  esac
456 + ])
457 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
458 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
459 + fi
460 +
461 + dnl Check whether compiler supports byte bit-fields
462 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
463 +  ac_cv_have_byte_bitfields, [
464 +  AC_LANG_SAVE
465 +  AC_LANG_CPLUSPLUS
466 +  AC_TRY_RUN([
467 +    struct A {
468 +      unsigned char b1:4;
469 +      unsigned char b2:4;
470 +      unsigned char c;
471 +      unsigned short s;
472 +      unsigned char a[4];
473 +    };
474 +
475 +    int main(void) {
476 +      A a;
477 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
478 +    }],
479 +    [ac_cv_have_byte_bitfields=yes],
480 +    [ac_cv_have_byte_bitfields=no],
481 +    dnl When cross-compiling, assume only GCC supports this
482 +    [if [[ "$GCC" = "yes" ]]; then
483 +      ac_cv_have_byte_bitfields="guessing yes"
484 +    else
485 +      ac_cv_have_byte_bitfields="guessing no"
486 +    fi]
487 +    )
488 +  AC_LANG_RESTORE
489 + ])
490 +
491   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
492   AC_DEFUN([AC_CHECK_FRAMEWORK], [
493    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
# Line 441 | Line 507 | AC_DEFUN([AC_CHECK_FRAMEWORK], [
507   ])
508  
509   dnl Check for some MacOS X frameworks
510 + AC_CHECK_FRAMEWORK(AppKit, [])
511   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
512   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
513   AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
# Line 491 | Line 558 | solaris*)
558    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
559    ;;
560   irix*)
494  ETHERSRC=ether_unix.cpp
561    AUDIOSRC=Irix/audio_irix.cpp
562    EXTRASYSSRCS=Irix/unaligned.c
563    LIBS="$LIBS -laudio"
# Line 524 | Line 590 | cygwin*)
590   esac
591  
592   dnl Is the slirp library supported?
593 < if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
593 > case "$ac_cv_have_byte_bitfields" in
594 > yes|"guessing yes")
595 >  CAN_SLIRP=yes
596 >  ETHERSRC=ether_unix.cpp
597 >  ;;
598 > esac
599 > if [[ -n "$CAN_SLIRP" ]]; then
600    AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
601    SLIRP_SRCS="\
602      ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
# Line 798 | Line 870 | AC_CACHE_CHECK([whether we can map Low M
870    ]
871   )
872  
801 dnl Check if we have POSIX shared memory support
802 AC_CACHE_CHECK([whether POSIX shared memory is working],
803  ac_cv_have_posix_shm, [
804  AC_LANG_SAVE
805  AC_LANG_CPLUSPLUS
806  AC_TRY_RUN([
807    #define HAVE_POSIX_SHM
808    #include "vm_alloc.cpp"
809    int main(void) { /* returns 0 if we have working POSIX shm */
810      if (vm_init() < 0) exit(2);
811      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
812      if (m1 == VM_MAP_FAILED) exit(3);
813      vm_exit(); exit(0);
814    }
815  ], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no,
816  dnl When cross-compiling, do not assume anything.
817  ac_cv_have_posix_shm="guessing no"
818  )
819  AC_LANG_RESTORE
820  ]
821 )
822 AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm",
823  [Define if your system supports POSIX shared memory.])
824
825 dnl Check if we have working 33-bit memory addressing
826 AC_CACHE_CHECK([whether 33-bit memory addressing is working],
827  ac_cv_have_33bit_addressing, [
828  AC_LANG_SAVE
829  AC_LANG_CPLUSPLUS
830  AC_TRY_RUN([
831    #define USE_33BIT_ADDRESSING 1
832    #include "vm_alloc.cpp"
833    int main(void) { /* returns 0 if we have working 33-bit addressing */
834      if (sizeof(void *) < 8) exit(1);
835      if (vm_init() < 0) exit(2);
836      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
837      if (m1 == VM_MAP_FAILED) exit(3);
838      char *m2 = m1 + (1L << 32);
839      m1[0] = 0x12; if (m2[0] != 0x12) exit(4);
840      m2[0] = 0x34; if (m1[0] != 0x34) exit(5);
841      vm_exit(); exit(0);
842    }
843  ], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no,
844  dnl When cross-compiling, do not assume anything.
845  ac_cv_have_33bit_addressing="guessing no"
846  )
847  AC_LANG_RESTORE
848  ]
849 )
850
873   dnl Check signal handlers need to be reinstalled
874   AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
875    ac_cv_signal_need_reinstall, [
# Line 1037 | Line 1059 | fi
1059   dnl A dummy program that returns always true
1060   AC_PATH_PROG([BLESS], "true")
1061  
1062 + dnl Check for linker script support
1063 + case $target_os:$target_cpu in
1064 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1065 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1066 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1067 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1068 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1069 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1070 + esac
1071 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1072 +  AC_CACHE_CHECK([whether linker script is usable],
1073 +    ac_cv_linker_script_works, [
1074 +    AC_LANG_SAVE
1075 +    AC_LANG_CPLUSPLUS
1076 +    saved_LDFLAGS="$LDFLAGS"
1077 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1078 +    AC_TRY_RUN(
1079 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1080 +      [ac_cv_linker_script_works=yes],
1081 +      [ac_cv_linker_script_works=no],
1082 +      dnl When cross-compiling, assume it works
1083 +      [ac_cv_linker_script_works="guessing yes"]
1084 +    )
1085 +    AC_LANG_RESTORE
1086 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1087 +      LDFLAGS="$saved_LDFLAGS"
1088 +      LINKER_SCRIPT_FLAGS=""
1089 +    fi
1090 +  ])
1091 + fi
1092 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1093 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1094 +
1095   dnl Determine the addressing mode to use
1096   if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
1097    ADDRESSING_MODE="real"
# Line 1236 | Line 1291 | elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HA
1291      DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
1292      JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS"
1293      CAN_JIT=yes
1239    WANT_33BIT_ADDRESSING=yes
1294    fi
1295   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
1296    dnl SPARC CPU
# Line 1293 | Line 1347 | else
1347    JITSRCS=""
1348   fi
1349  
1296 dnl Use 33-bit memory addressing?
1297 if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then
1298  use_33bit_addressing=yes
1299 fi
1300 AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing",
1301  [Define to use 33-bit memory addressing on 64-bit JIT capable systems.])
1302
1350   dnl Utility macro used by next two tests.
1351   dnl AC_EXAMINE_OBJECT(C source code,
1352   dnl     commands examining object file,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines