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.34 by gbeauche, 2004-11-08T21:07:07Z vs.
Revision 1.81 by asvitkine, 2010-10-19T03:21:52Z

# 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 21 | Line 23 | AC_ARG_ENABLE(fbdev-dga,     [  --enable
23   AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
24  
25   dnl SDL options.
26 + AC_ARG_ENABLE(sdl-static,    [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
27   AC_ARG_ENABLE(sdl-video,     [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
28   AC_ARG_ENABLE(sdl-audio,     [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
29 + AC_ARG_ENABLE(sdl-framework,    [  --enable-sdl-framework  use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
30 + AC_ARG_ENABLE(sdl-framework-prefix,    [  --enable-sdl-framework-prefix=PFX    default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
31  
32   dnl JIT compiler options.
33   AC_ARG_ENABLE(jit-compiler,  [  --enable-jit-compiler   enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no])
# Line 59 | Line 64 | AC_ARG_ENABLE(addressing,
64  
65   dnl External packages.
66   AC_ARG_WITH(esd,             [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
67 < AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
67 > AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]],
68 >  [case "$withval" in
69 >   gtk1)      WANT_GTK="gtk";;
70 >   gtk|gtk2)  WANT_GTK="$withval";;
71 >   yes)       WANT_GTK="gtk2 gtk";;
72 >   *)         WANT_GTK="no";;
73 >   esac],
74 >  [WANT_GTK="gtk2 gtk"])
75   AC_ARG_WITH(mon,             [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
76  
77 + AC_ARG_WITH(bincue,  
78 +  AS_HELP_STRING([--with-bincue], [Allow cdrom image files in bin/cue mode]))
79 +
80 + AC_ARG_WITH(libvhd,  
81 +  AS_HELP_STRING([--with-libvhd], [Enable VHD disk images]))
82 +
83 +
84   dnl Canonical system information.
85   AC_CANONICAL_HOST
86   AC_CANONICAL_TARGET
# Line 91 | Line 110 | case "$target_cpu" in
110    x86_64* ) HAVE_X86_64=yes;;
111   esac
112  
113 + dnl Check if we should really be assuming x86_64 even if we detected HAVE_I386 above.
114 + if [[ "x$HAVE_I386" = "xyes" ]]; then
115 +  AC_TRY_RUN([
116 +    int main(void) {
117 +        #if defined(__x86_64__)
118 +                return 0;
119 +        #else
120 +                return 1;
121 +        #endif
122 +    }
123 +  ], [
124 +    HAVE_I386=no
125 +    HAVE_X86_64=yes
126 +  ])
127 + fi
128 +
129   dnl Checks for programs.
130   AC_PROG_CC
131   AC_PROG_CC_C_O
# Line 98 | Line 133 | AC_PROG_CPP
133   AC_PROG_CXX
134   AC_PROG_MAKE_SET
135   AC_PROG_INSTALL
136 + AC_PROG_EGREP
137  
138   dnl We use mon if possible.
139   MONSRCS=
# Line 107 | Line 143 | if [[ "x$WANT_MON" = "xyes" ]]; then
143    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
144      AC_MSG_RESULT(yes)
145      AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
146 <    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"
146 >    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"
147      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
148      AC_CHECK_LIB(ncurses, tgetent, ,
149 <      AC_CHECK_LIB(termcap, tgetent, ,
150 <        AC_CHECK_LIB(termlib, tgetent, ,
151 <          AC_CHECK_LIB(terminfo, tgetent, ,
152 <            AC_CHECK_LIB(Hcurses, tgetent, ,
153 <              AC_CHECK_LIB(curses, tgetent))))))
149 >      [AC_CHECK_LIB(termcap, tgetent, ,
150 >        [AC_CHECK_LIB(termlib, tgetent, ,
151 >          [AC_CHECK_LIB(terminfo, tgetent, ,
152 >            [AC_CHECK_LIB(Hcurses, tgetent, ,
153 >              [AC_CHECK_LIB(curses, tgetent)])])])])])
154      AC_CHECK_LIB(readline, readline)
155    else
156      AC_MSG_RESULT(no)
# Line 127 | Line 163 | dnl Checks for libraries.
163   AC_CHECK_LIB(posix4, sem_init)
164   AC_CHECK_LIB(rt, timer_create)
165   AC_CHECK_LIB(rt, shm_open)
166 + AC_CHECK_LIB(m, cos)
167 +
168 + dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES)
169 + dnl AC_TRY_LINK uses main() but SDL needs main to take args,
170 + dnl therefore main is undefined with #undef.
171 + dnl Framework can be in an custom location.
172 + AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [
173 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])
174 +  AC_CACHE_CHECK([whether compiler supports framework $1],
175 +    ac_Framework, [
176 +    saved_LIBS="$LIBS"
177 +    LIBS="$LIBS -framework $1"
178 +    if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then
179 +      if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then
180 +        LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1"
181 +      fi
182 +    fi
183 +    saved_CPPFLAGS="$CPPFLAGS"
184 +    CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers"
185 +    AC_TRY_LINK(
186 +      [$2
187 + #undef main], [],
188 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no);
189 + LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"]
190 +    )
191 +  ])
192 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
193 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
194 +  )
195 +  AS_VAR_POPDEF([ac_Framework])
196 + ])
197  
198   dnl Do we need SDL?
199   WANT_SDL=no
# Line 142 | Line 209 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
209    SDL_SUPPORT="$SDL_SUPPORT audio"
210   fi
211   if [[ "x$WANT_SDL" = "xyes" ]]; then
212 <  AC_PATH_PROG(sdl_config, "sdl-config")
213 <  if [[ -n "$sdl_config" ]]; then
147 <    sdl_cflags=`$sdl_config --cflags`
148 <    sdl_libs=`$sdl_config --libs`
149 <    CFLAGS="$CFLAGS $sdl_cflags"
150 <    CXXFLAGS="$CXXFLAGS $sdl_cflags"
151 <    LIBS="$LIBS $sdl_libs"
212 >  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
213 >    AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>])
214    else
215 <    WANT_SDL=no
215 >    ac_cv_framework_SDL=no
216 >  fi
217 >  if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then
218 >    AC_PATH_PROG(sdl_config, "sdl-config")
219 >    if [[ -n "$sdl_config" ]]; then
220 >      case $target_os in
221 >      # Special treatment for Cygwin so that we can still use the POSIX layer
222 >      *cygwin*)
223 >        sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
224 >        sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
225 >        ;;
226 >      *)
227 >        sdl_cflags=`$sdl_config --cflags`
228 >        if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
229 >          sdl_libs=`$sdl_config --static-libs`
230 >        else
231 >          sdl_libs=`$sdl_config --libs`
232 >        fi
233 >        ;;
234 >      esac
235 >      CFLAGS="$CFLAGS $sdl_cflags"
236 >      CXXFLAGS="$CXXFLAGS $sdl_cflags"
237 >      LIBS="$LIBS $sdl_libs"
238 >    else
239 >      WANT_SDL=no
240 >    fi
241    fi
242    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
243   else
# Line 168 | Line 255 | if [[ "x$WANT_SDL" = "xno" ]]; then
255    LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
256   fi
257  
258 + dnl BINCUE
259 + AS_IF([test  "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no])
260 + AS_IF([test  "x$have_bincue" = "xyes" ], [
261 +   if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
262 +       DEFINES="$DEFINES -DBINCUE"
263 +   else
264 +       AC_MSG_ERROR([You need SDL Audio to use BINCUE support.])
265 +   fi
266 + ])
267 +
268 + dnl LIBVHD
269 + AS_IF([test  "x$with_libvhd" = "xyes" ], [have_libvhd=yes], [have_libvhd=no])
270 + AS_IF([test  "x$have_libvhd" = "xyes" ], [
271 +       CPPFLAGS="$CPPFLAGS -DHAVE_LIBVHD"
272 +           LIBS="$LIBS -lvhd"
273 +           case $target_os in
274 +           linux*)
275 +           LIBS="$LIBS -luuid"
276 +           esac
277 +           AC_CHECK_LIB(vhd, vhd_open)
278 +           AC_CHECK_LIB(vhd, vhd_io_read)
279 +           AC_CHECK_LIB(vhd, vhd_io_write)
280 +           AC_CHECK_LIB(vhd, vhd_close)
281 + ])
282 +
283 +
284 +
285   dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
286   HAVE_PTHREADS=yes
287   AC_CHECK_LIB(pthread, pthread_create, , [
# Line 180 | Line 294 | AC_CHECK_LIB(pthread, pthread_create, ,
294   if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
295    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
296   fi
297 < AC_CHECK_FUNCS(pthread_cancel)
297 > AC_CHECK_FUNCS(pthread_cond_init)
298 > AC_CHECK_FUNCS(pthread_cancel pthread_testcancel)
299   AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
300   AC_CHECK_FUNCS(pthread_mutexattr_settype)
301   AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
# Line 224 | Line 339 | fi
339  
340   dnl We use GTK+ if possible.
341   UISRCS=../dummy/prefs_editor_dummy.cpp
342 < if [[ "x$WANT_GTK" = "xyes" ]]; then
342 > case "x$WANT_GTK" in
343 > xgtk2*)
344 >  AM_PATH_GTK_2_0(1.3.15, [
345 >    GUI_CFLAGS="$GTK_CFLAGS"
346 >    GUI_LIBS="$GTK_LIBS"
347 >    WANT_GTK=gtk2
348 >  ], [
349 >    case "x${WANT_GTK}x" in
350 >    *gtkx)
351 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
352 >      WANT_GTK=gtk
353 >      ;;
354 >    *)
355 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
356 >      WANT_GTK=no
357 >      ;;
358 >    esac
359 >  ])
360 >  ;;
361 > esac
362 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
363    AM_PATH_GTK(1.2.0, [
364 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
365 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
231 <    LIBS="$LIBS $GTK_LIBS"
232 <    UISRCS=prefs_editor_gtk.cpp
364 >    GUI_CFLAGS="$GTK_CFLAGS"
365 >    GUI_LIBS="$GTK_LIBS"
366      dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if
367      dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which
368      dnl includes <libintl.h>
369      AM_GNU_GETTEXT
370      B2_PATH_GNOMEUI([
371        AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.])
372 <      CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
373 <      LIBS="$LIBS $GNOMEUI_LIBS"
372 >      GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS"
373 >      GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS"
374      ], [])
375    ], [
376      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
377      WANT_GTK=no
378    ])
379   fi
380 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
381 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
382 +  UISRCS=prefs_editor_gtk.cpp
383 + fi
384 + AC_SUBST(GUI_CFLAGS)
385 + AC_SUBST(GUI_LIBS)
386 +
387 + dnl Build external GUI if requested.
388 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
389 +  WANT_STANDALONE_GUI=no
390 + fi
391 + if [[ "$WANT_GTK" = "no" ]]; then
392 +  WANT_STANDALONE_GUI=no
393 + fi
394 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
395  
396   dnl We use ESD if possible.
397   if [[ "x$WANT_ESD" = "xyes" ]]; then
# Line 263 | Line 411 | AC_SYS_LARGEFILE
411  
412   dnl Checks for header files.
413   AC_HEADER_STDC
414 + AC_CHECK_HEADERS(stdlib.h stdint.h)
415   AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
416   AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
417 < AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h)
417 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
418 > AC_CHECK_HEADERS(sys/poll.h sys/select.h)
419 > AC_CHECK_HEADERS(arpa/inet.h)
420 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
421 > #ifdef HAVE_SYS_TYPES_H
422 > #include <sys/types.h>
423 > #endif
424 > #ifdef HAVE_SYS_SOCKET_H
425 > #include <sys/socket.h>
426 > #endif
427 > ])
428   AC_CHECK_HEADERS(AvailabilityMacros.h)
429 + AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
430  
431   dnl Checks for typedefs, structures, and compiler characteristics.
432   AC_C_BIGENDIAN
# Line 306 | Line 466 | if [[ "x$ac_cv_type_socklen_t" != "xyes"
466   fi
467  
468   dnl Checks for library functions.
469 < AC_CHECK_FUNCS(strdup cfmakeraw)
469 > AC_CHECK_FUNCS(strdup strerror cfmakeraw)
470   AC_CHECK_FUNCS(clock_gettime timer_create)
471   AC_CHECK_FUNCS(sigaction signal)
472   AC_CHECK_FUNCS(mmap mprotect munmap)
473   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
474 + AC_CHECK_FUNCS(poll inet_aton)
475  
476   dnl Darwin seems to define mach_task_self() instead of task_self().
477   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 337 | Line 498 | mips-sony-bsd|mips-sony-newsos4)
498   *-*-sco3.2v5*)
499          no_dev_ptmx=1
500          ;;
501 + *-*-cygwin*)
502 +        no_dev_ptmx=1
503 +        ;;
504 + *-*-darwin*)
505 +        no_dev_ptmx=1
506 +        ;;
507   esac
508  
509   if test -z "$no_dev_ptmx" ; then
# Line 355 | Line 522 | AC_CHECK_FILE([/dev/ptc],
522                  have_dev_ptc=1
523          ]
524   )
358
525   dnl (end of code from openssh-3.2.2p1 configure.ac)
526  
527 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
528 + dnl doesn't work or is unimplemented. On these systems (mostly older
529 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
530 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
531 +  ac_cv_nonblocking_io, [
532 +  case "$host" in
533 +  *-*-osf*)
534 +    ac_cv_nonblocking_io=FIONBIO
535 +    ;;
536 +  *-*-sunos4*)
537 +    ac_cv_nonblocking_io=FIONBIO
538 +    ;;
539 +  *-*-ultrix*)
540 +    ac_cv_nonblocking_io=FIONBIO
541 +    ;;
542 +  *)
543 +    ac_cv_nonblocking_io=O_NONBLOCK
544 +    ;;
545 +  esac
546 + ])
547 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
548 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
549 + fi
550 +
551 + dnl Check whether compiler supports byte bit-fields
552 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
553 +  ac_cv_have_byte_bitfields, [
554 +  AC_LANG_SAVE
555 +  AC_LANG_CPLUSPLUS
556 +  AC_TRY_RUN([
557 +    struct A {
558 +      unsigned char b1:4;
559 +      unsigned char b2:4;
560 +      unsigned char c;
561 +      unsigned short s;
562 +      unsigned char a[4];
563 +    };
564 +
565 +    int main(void) {
566 +      A a;
567 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
568 +    }],
569 +    [ac_cv_have_byte_bitfields=yes],
570 +    [ac_cv_have_byte_bitfields=no],
571 +    dnl When cross-compiling, assume only GCC supports this
572 +    [if [[ "$GCC" = "yes" ]]; then
573 +      ac_cv_have_byte_bitfields="guessing yes"
574 +    else
575 +      ac_cv_have_byte_bitfields="guessing no"
576 +    fi]
577 +    )
578 +  AC_LANG_RESTORE
579 + ])
580  
581   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
582 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
582 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
583    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
584    AC_CACHE_CHECK([whether compiler supports framework $1],
585      ac_Framework, [
586      saved_LIBS="$LIBS"
587      LIBS="$LIBS -framework $1"
588      AC_TRY_LINK(
589 <      [$2], [int main(void) { return 0; }],
589 >      [$2], [],
590        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
591      )
592    ])
# Line 378 | Line 597 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
597   ])
598  
599   dnl Check for some MacOS X frameworks
600 + AC_CHECK_FRAMEWORK(AppKit, [])
601   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
602   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
603 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
604  
605   dnl Select system-dependant source files.
606   SERIALSRC=serial_unix.cpp
607   ETHERSRC=../dummy/ether_dummy.cpp
608   SCSISRC=../dummy/scsi_dummy.cpp
609   AUDIOSRC=../dummy/audio_dummy.cpp
610 + EXTFSSRC=extfs_unix.cpp
611   EXTRASYSSRCS=
612   CAN_NATIVE_M68K=no
613   case "$target_os" in
# Line 419 | Line 641 | freebsd*)
641    ;;
642   netbsd*)
643    CAN_NATIVE_M68K=yes
644 +  ETHERSRC=ether_unix.cpp
645    ;;
646   solaris*)
647    AUDIOSRC=Solaris/audio_solaris.cpp
648    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
649    ;;
650   irix*)
428  ETHERSRC=ether_unix.cpp
651    AUDIOSRC=Irix/audio_irix.cpp
652    EXTRASYSSRCS=Irix/unaligned.c
431  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
432  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
653    LIBS="$LIBS -laudio"
654    WANT_ESD=no
655  
# Line 439 | Line 659 | irix*)
659    CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"`
660    AC_MSG_CHECKING(if "-IPA" works)
661    dnl Do a test compile of an empty function
662 <  AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
662 >  AC_TRY_COMPILE([#if defined __GNUC__
663 >                  # error GCC does not support IPA yet
664 >                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
665    CFLAGS="$ocflags"
666    ;;
667   darwin*)
668 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
668 >  ETHERSRC=ether_unix.cpp
669 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
670      EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
671    fi
672 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
673 +    EXTFSSRC=../MacOSX/extfs_macosx.cpp
674 +  fi
675 +  ;;
676 + cygwin*)
677 +  SERIALSRC="../dummy/serial_dummy.cpp"
678 +  EXTRASYSSRCS="../Windows/BasiliskII.rc"
679    ;;
680   esac
681 +
682 + dnl Is the slirp library supported?
683 + case "$ac_cv_have_byte_bitfields" in
684 + yes|"guessing yes")
685 +  CAN_SLIRP=yes
686 +  ETHERSRC=ether_unix.cpp
687 +  ;;
688 + esac
689 + if [[ -n "$CAN_SLIRP" ]]; then
690 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
691 +  SLIRP_SRCS="\
692 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
693 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
694 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
695 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
696 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
697 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
698 + fi
699 + AC_SUBST(SLIRP_SRCS)
700 +
701   dnl SDL overrides
702   if [[ "x$WANT_SDL" = "xyes" ]]; then
703    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
704 +  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
705 +    EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m"
706 +  fi
707   fi
708   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
709    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
# Line 459 | Line 712 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
712    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
713      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
714    else
715 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
715 >    case "$target_os" in
716 >    cygwin*)
717 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
718 >      ;;
719 >    *)
720 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
721 >      ;;
722 >    esac
723    fi
724   else
725    VIDEOSRCS="video_x.cpp"
# Line 471 | Line 731 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
731    AUDIOSRC="../SDL/audio_sdl.cpp"
732   fi
733  
734 + dnl BINCUE overrides
735 +
736 + if [[ "x$have_bincue" = "xyes" ]]; then
737 +  EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp"
738 + fi
739 +
740 + dnl libvhd overrides
741 +
742 + if [[ "x$have_libvhd" = "xyes" ]]; then
743 +  EXTRASYSSRCS="$EXTRASYSSRCS vhd_unix.cpp"
744 + fi
745 +
746 +
747   dnl Use 68k CPU natively?
748   WANT_NATIVE_M68K=no
749   if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then
# Line 485 | Line 758 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
758    ETHERSRC=../dummy/ether_dummy.cpp
759    AUDIOSRC=../dummy/audio_dummy.cpp
760   fi
761 < SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
761 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
762  
763   dnl Define a macro that translates a yesno-variable into a C macro definition
764   dnl to be put into the config.h file
765   dnl $1 -- the macro to define
766   dnl $2 -- the value to translate
767   dnl $3 -- template name
768 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
768 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
769      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
770          AC_DEFINE($1, 1, $3)
771      fi
# Line 703 | Line 976 | AC_CACHE_CHECK([whether we can map Low M
976    ]
977   )
978  
706 dnl Check if we have POSIX shared memory support
707 AC_CACHE_CHECK([whether POSIX shared memory is working],
708  ac_cv_have_posix_shm, [
709  AC_LANG_SAVE
710  AC_LANG_CPLUSPLUS
711  AC_TRY_RUN([
712    #define HAVE_POSIX_SHM
713    #include "vm_alloc.cpp"
714    int main(void) { /* returns 0 if we have working POSIX shm */
715      if (vm_init() < 0) exit(2);
716      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
717      if (m1 == VM_MAP_FAILED) exit(3);
718      vm_exit(); exit(0);
719    }
720  ], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no,
721  dnl When cross-compiling, do not assume anything.
722  ac_cv_have_posix_shm="guessing no"
723  )
724  AC_LANG_RESTORE
725  ]
726 )
727 AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm",
728  [Define if your system supports POSIX shared memory.])
729
730 dnl Check if we have working 33-bit memory addressing
731 AC_CACHE_CHECK([whether 33-bit memory addressing is working],
732  ac_cv_have_33bit_addressing, [
733  AC_LANG_SAVE
734  AC_LANG_CPLUSPLUS
735  AC_TRY_RUN([
736    #define USE_33BIT_ADDRESSING 1
737    #include "vm_alloc.cpp"
738    int main(void) { /* returns 0 if we have working 33-bit addressing */
739      if (sizeof(void *) < 8) exit(1);
740      if (vm_init() < 0) exit(2);
741      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
742      if (m1 == VM_MAP_FAILED) exit(3);
743      char *m2 = m1 + (1L << 32);
744      m1[0] = 0x12; if (m2[0] != 0x12) exit(4);
745      m2[0] = 0x34; if (m1[0] != 0x34) exit(5);
746      vm_exit(); exit(0);
747    }
748  ], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no,
749  dnl When cross-compiling, do not assume anything.
750  ac_cv_have_33bit_addressing="guessing no"
751  )
752  AC_LANG_RESTORE
753  ]
754 )
755
979   dnl Check signal handlers need to be reinstalled
980   AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
981    ac_cv_signal_need_reinstall, [
# Line 820 | Line 1043 | AC_CACHE_CHECK([whether your system supp
1043    AC_LANG_SAVE
1044    AC_LANG_CPLUSPLUS
1045    AC_TRY_RUN([
1046 +    #define HAVE_UNISTD_H 1
1047 +    #define HAVE_MACH_VM 1
1048 +    #define HAVE_MACH_TASK_SELF 1
1049      #define HAVE_MACH_EXCEPTIONS 1
1050      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1051      #include "vm_alloc.cpp"
# Line 838 | Line 1064 | AC_CACHE_CHECK([whether your system supp
1064   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
1065    [Define if your system supports Mach exceptions.])
1066  
1067 + dnl Check if Windows exceptions are supported.
1068 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
1069 +  ac_cv_have_win32_exceptions, [
1070 +  AC_LANG_SAVE
1071 +  AC_LANG_CPLUSPLUS
1072 +  AC_TRY_RUN([
1073 +    #define HAVE_WIN32_EXCEPTIONS 1
1074 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1075 +    #include "vm_alloc.cpp"
1076 +    #include "sigsegv.cpp"
1077 +  ], [
1078 +  sigsegv_recovery=win32
1079 +  ac_cv_have_win32_exceptions=yes
1080 +  ],
1081 +  ac_cv_have_win32_exceptions=no,
1082 +  dnl When cross-compiling, do not assume anything.
1083 +  ac_cv_have_win32_exceptions=no
1084 +  )
1085 +  AC_LANG_RESTORE
1086 +  ]
1087 + )
1088 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
1089 +  [Define if your system supports Windows exceptions.])
1090 +
1091   dnl Otherwise, check if extended signals are supported.
1092   if [[ -z "$sigsegv_recovery" ]]; then
1093    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 918 | Line 1168 | fi
1168   dnl A dummy program that returns always true
1169   AC_PATH_PROG([BLESS], "true")
1170  
1171 + dnl Check for linker script support
1172 + case $target_os:$target_cpu in
1173 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1174 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1175 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1176 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1177 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1178 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1179 + esac
1180 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1181 +  AC_CACHE_CHECK([whether linker script is usable],
1182 +    ac_cv_linker_script_works, [
1183 +    AC_LANG_SAVE
1184 +    AC_LANG_CPLUSPLUS
1185 +    saved_LDFLAGS="$LDFLAGS"
1186 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1187 +    AC_TRY_RUN(
1188 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1189 +      [ac_cv_linker_script_works=yes],
1190 +      [ac_cv_linker_script_works=no],
1191 +      dnl When cross-compiling, assume it works
1192 +      [ac_cv_linker_script_works="guessing yes"]
1193 +    )
1194 +    AC_LANG_RESTORE
1195 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1196 +      LDFLAGS="$saved_LDFLAGS"
1197 +      LINKER_SCRIPT_FLAGS=""
1198 +    fi
1199 +  ])
1200 + fi
1201 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1202 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1203 +
1204   dnl Determine the addressing mode to use
1205   if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
1206    ADDRESSING_MODE="real"
# Line 995 | Line 1278 | AC_MSG_RESULT($HAVE_GAS)
1278   dnl Check for GCC 2.7 or higher.
1279   HAVE_GCC27=no
1280   AC_MSG_CHECKING(for GCC 2.7 or higher)
1281 < AC_EGREP_CPP(xyes,
1282 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1283 <  xyes
1284 < #endif
1285 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1281 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1282 >                                     # error gcc < 2.7
1283 >                                     #endif
1284 >                                   ]])],
1285 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1286 >                  [AC_MSG_RESULT(no)])
1287  
1288   dnl Check for GCC 3.0 or higher.
1289   HAVE_GCC30=no
1290   AC_MSG_CHECKING(for GCC 3.0 or higher)
1291 < AC_EGREP_CPP(xyes,
1292 < [#if __GNUC__ >= 3
1293 <  xyes
1294 < #endif
1295 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1291 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1292 >                                     # error gcc < 3
1293 >                                     #endif
1294 >                                   ]])],
1295 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1296 >                  [AC_MSG_RESULT(no)])
1297 >
1298 > dnl Check for ICC.
1299 > AC_MSG_CHECKING(for ICC)
1300 > HAVE_ICC=no
1301 > if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
1302 >  HAVE_ICC=yes
1303 > fi
1304 > AC_MSG_RESULT($HAVE_ICC)
1305  
1306   dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
1307   dnl Also set "-fno-exceptions" for C++ because exception handling requires
# Line 1023 | Line 1316 | dnl As of 2001/08/02, this affects the f
1316   dnl Official: probably gcc-3.1 (mainline CVS)
1317   dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
1318   dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
1319 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1319 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1320    SAVED_CXXFLAGS="$CXXFLAGS"
1321    CXXFLAGS="$CXXFLAGS -fno-merge-constants"
1322    AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
# Line 1039 | Line 1332 | fi
1332  
1333   dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1334   dnl However, there are some corner cases exposed on x86-64
1335 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1335 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1336    SAVED_CXXFLAGS="$CXXFLAGS"
1337    CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1338    AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
# Line 1053 | Line 1346 | if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1346    fi
1347   fi
1348  
1349 + dnl Add -fno-strict-aliasing for slirp sources
1350 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1351 +  SAVED_CFLAGS="$CFLAGS"
1352 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1353 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1354 +    ac_cv_gcc_no_strict_aliasing, [
1355 +    AC_TRY_COMPILE([],[],
1356 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1357 +      [ac_cv_gcc_no_strict_aliasing=no])
1358 +  ])
1359 +  CFLAGS="$SAVED_CFLAGS"
1360 + fi
1361 +
1362 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1363 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1364 +  SAVED_CFLAGS="$CFLAGS"
1365 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1366 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1367 +    ac_cv_gcc_mdynamic_no_pic, [
1368 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1369 +  ])
1370 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1371 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1372 +  else
1373 +    CFLAGS="$SAVED_CFLAGS"
1374 +  fi
1375 + fi
1376 +
1377   dnl Select appropriate CPU source and REGPARAM define.
1378   ASM_OPTIMIZATIONS=none
1379   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
# Line 1079 | Line 1400 | elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HA
1400      DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
1401      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"
1402      CAN_JIT=yes
1082    WANT_33BIT_ADDRESSING=yes
1403    fi
1404   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
1405    dnl SPARC CPU
# Line 1136 | Line 1456 | else
1456    JITSRCS=""
1457   fi
1458  
1139 dnl Use 33-bit memory addressing?
1140 if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then
1141  use_33bit_addressing=yes
1142 fi
1143 AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing",
1144  [Define to use 33-bit memory addressing on 64-bit JIT capable systems.])
1145
1459   dnl Utility macro used by next two tests.
1460   dnl AC_EXAMINE_OBJECT(C source code,
1461   dnl     commands examining object file,
# Line 1367 | Line 1680 | echo
1680   echo Basilisk II configuration summary:
1681   echo
1682   echo SDL support ............................ : $SDL_SUPPORT
1683 + echo BINCUE support ......................... : $have_bincue
1684 + echo LIBVHD support ......................... : $have_libvhd
1685   echo XFree86 DGA support .................... : $WANT_XF86_DGA
1686   echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE
1687   echo fbdev DGA support ...................... : $WANT_FBDEV_DGA

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines