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.48 by gbeauche, 2005-06-12T23:36:34Z

# Line 21 | Line 21 | AC_ARG_ENABLE(fbdev-dga,     [  --enable
21   AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
22  
23   dnl SDL options.
24 + AC_ARG_ENABLE(sdl-static,    [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
25   AC_ARG_ENABLE(sdl-video,     [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
26   AC_ARG_ENABLE(sdl-audio,     [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
27  
# Line 98 | Line 99 | AC_PROG_CPP
99   AC_PROG_CXX
100   AC_PROG_MAKE_SET
101   AC_PROG_INSTALL
102 + AC_PROG_EGREP
103  
104   dnl We use mon if possible.
105   MONSRCS=
# Line 144 | Line 146 | fi
146   if [[ "x$WANT_SDL" = "xyes" ]]; then
147    AC_PATH_PROG(sdl_config, "sdl-config")
148    if [[ -n "$sdl_config" ]]; then
149 <    sdl_cflags=`$sdl_config --cflags`
150 <    sdl_libs=`$sdl_config --libs`
149 >    case $target_os in
150 >    # Special treatment for Cygwin so that we can still use the POSIX layer
151 >    *cygwin*)
152 >      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
153 >      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
154 >      ;;
155 >    *)
156 >      sdl_cflags=`$sdl_config --cflags`
157 >      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
158 >        sdl_libs=`$sdl_config --static-libs`
159 >      else
160 >        sdl_libs=`$sdl_config --libs`
161 >      fi
162 >      ;;
163 >    esac
164      CFLAGS="$CFLAGS $sdl_cflags"
165      CXXFLAGS="$CXXFLAGS $sdl_cflags"
166      LIBS="$LIBS $sdl_libs"
# Line 180 | Line 195 | AC_CHECK_LIB(pthread, pthread_create, ,
195   if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
196    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
197   fi
198 < AC_CHECK_FUNCS(pthread_cancel)
198 > AC_CHECK_FUNCS(pthread_cancel pthread_testcancel)
199   AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
200   AC_CHECK_FUNCS(pthread_mutexattr_settype)
201   AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
# Line 265 | Line 280 | dnl Checks for header files.
280   AC_HEADER_STDC
281   AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
282   AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
283 < AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h)
283 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
284 > AC_CHECK_HEADERS(sys/poll.h sys/select.h)
285 > AC_CHECK_HEADERS(arpa/inet.h)
286 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
287 > #ifdef HAVE_SYS_TYPES_H
288 > #include <sys/types.h>
289 > #endif
290 > #ifdef HAVE_SYS_SOCKET_H
291 > #include <sys/socket.h>
292 > #endif
293 > ])
294   AC_CHECK_HEADERS(AvailabilityMacros.h)
295 + AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
296  
297   dnl Checks for typedefs, structures, and compiler characteristics.
298   AC_C_BIGENDIAN
# Line 306 | Line 332 | if [[ "x$ac_cv_type_socklen_t" != "xyes"
332   fi
333  
334   dnl Checks for library functions.
335 < AC_CHECK_FUNCS(strdup cfmakeraw)
335 > AC_CHECK_FUNCS(strdup strerror cfmakeraw)
336   AC_CHECK_FUNCS(clock_gettime timer_create)
337   AC_CHECK_FUNCS(sigaction signal)
338   AC_CHECK_FUNCS(mmap mprotect munmap)
339   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
340 + AC_CHECK_FUNCS(poll inet_aton)
341  
342   dnl Darwin seems to define mach_task_self() instead of task_self().
343   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 337 | Line 364 | mips-sony-bsd|mips-sony-newsos4)
364   *-*-sco3.2v5*)
365          no_dev_ptmx=1
366          ;;
367 + *-*-cygwin*)
368 +        no_dev_ptmx=1
369 +        ;;
370   esac
371  
372   if test -z "$no_dev_ptmx" ; then
# Line 380 | Line 410 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
410   dnl Check for some MacOS X frameworks
411   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
412   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
413 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
414  
415   dnl Select system-dependant source files.
416   SERIALSRC=serial_unix.cpp
417   ETHERSRC=../dummy/ether_dummy.cpp
418   SCSISRC=../dummy/scsi_dummy.cpp
419   AUDIOSRC=../dummy/audio_dummy.cpp
420 + EXTFSSRC=extfs_unix.cpp
421   EXTRASYSSRCS=
422   CAN_NATIVE_M68K=no
423   case "$target_os" in
# Line 419 | Line 451 | freebsd*)
451    ;;
452   netbsd*)
453    CAN_NATIVE_M68K=yes
454 +  ETHERSRC=ether_unix.cpp
455    ;;
456   solaris*)
457    AUDIOSRC=Solaris/audio_solaris.cpp
# Line 443 | Line 476 | irix*)
476    CFLAGS="$ocflags"
477    ;;
478   darwin*)
479 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
479 >  ETHERSRC=ether_unix.cpp
480 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
481      EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
482    fi
483 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
484 +    EXTFSSRC=../MacOSX/extfs_macosx.mm
485 +  fi
486 +  ;;
487 + cygwin*)
488 +  SERIALSRC="../dummy/serial_dummy.cpp"
489 +  EXTRASYSSRCS="../Windows/BasiliskII.rc"
490    ;;
491   esac
492 +
493 + dnl Is the slirp library supported?
494 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
495 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
496 +  SLIRP_SRCS="\
497 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
498 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
499 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
500 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
501 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
502 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
503 + fi
504 + AC_SUBST(SLIRP_SRCS)
505 +
506   dnl SDL overrides
507   if [[ "x$WANT_SDL" = "xyes" ]]; then
508    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
# Line 459 | Line 514 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
514    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
515      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
516    else
517 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
517 >    case "$target_os" in
518 >    cygwin*)
519 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
520 >      ;;
521 >    *)
522 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
523 >      ;;
524 >    esac
525    fi
526   else
527    VIDEOSRCS="video_x.cpp"
# Line 485 | Line 547 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
547    ETHERSRC=../dummy/ether_dummy.cpp
548    AUDIOSRC=../dummy/audio_dummy.cpp
549   fi
550 < SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
550 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
551  
552   dnl Define a macro that translates a yesno-variable into a C macro definition
553   dnl to be put into the config.h file
# Line 838 | Line 900 | AC_CACHE_CHECK([whether your system supp
900   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
901    [Define if your system supports Mach exceptions.])
902  
903 + dnl Check if Windows exceptions are supported.
904 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
905 +  ac_cv_have_win32_exceptions, [
906 +  AC_LANG_SAVE
907 +  AC_LANG_CPLUSPLUS
908 +  AC_TRY_RUN([
909 +    #define HAVE_WIN32_EXCEPTIONS 1
910 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
911 +    #include "vm_alloc.cpp"
912 +    #include "sigsegv.cpp"
913 +  ], [
914 +  sigsegv_recovery=win32
915 +  ac_cv_have_win32_exceptions=yes
916 +  ],
917 +  ac_cv_have_win32_exceptions=no,
918 +  dnl When cross-compiling, do not assume anything.
919 +  ac_cv_have_win32_exceptions=no
920 +  )
921 +  AC_LANG_RESTORE
922 +  ]
923 + )
924 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
925 +  [Define if your system supports Windows exceptions.])
926 +
927   dnl Otherwise, check if extended signals are supported.
928   if [[ -z "$sigsegv_recovery" ]]; then
929    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 1010 | Line 1096 | AC_EGREP_CPP(xyes,
1096   #endif
1097   ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1098  
1099 + dnl Check for ICC.
1100 + AC_MSG_CHECKING(for ICC)
1101 + HAVE_ICC=no
1102 + if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
1103 +  HAVE_ICC=yes
1104 + fi
1105 + AC_MSG_RESULT($HAVE_ICC)
1106 +
1107   dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
1108   dnl Also set "-fno-exceptions" for C++ because exception handling requires
1109   dnl the frame pointer.
# Line 1023 | Line 1117 | dnl As of 2001/08/02, this affects the f
1117   dnl Official: probably gcc-3.1 (mainline CVS)
1118   dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
1119   dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
1120 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1120 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1121    SAVED_CXXFLAGS="$CXXFLAGS"
1122    CXXFLAGS="$CXXFLAGS -fno-merge-constants"
1123    AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
# Line 1039 | Line 1133 | fi
1133  
1134   dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1135   dnl However, there are some corner cases exposed on x86-64
1136 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1136 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1137    SAVED_CXXFLAGS="$CXXFLAGS"
1138    CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1139    AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
# Line 1053 | Line 1147 | if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1147    fi
1148   fi
1149  
1150 + dnl Add -fno-strict-aliasing for slirp sources
1151 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1152 +  SAVED_CFLAGS="$CFLAGS"
1153 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1154 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1155 +    ac_cv_gcc_no_strict_aliasing, [
1156 +    AC_TRY_COMPILE([],[],
1157 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1158 +      [ac_cv_gcc_no_strict_aliasing=no])
1159 +  ])
1160 +  CFLAGS="$SAVED_CFLAGS"
1161 + fi
1162 +
1163   dnl Select appropriate CPU source and REGPARAM define.
1164   ASM_OPTIMIZATIONS=none
1165   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines