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.36 by gbeauche, 2004-11-14T23:24:51Z vs.
Revision 1.55 by gbeauche, 2005-12-04T15:03:11Z

# 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 59 | Line 60 | AC_ARG_ENABLE(addressing,
60  
61   dnl External packages.
62   AC_ARG_WITH(esd,             [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
63 < AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
63 > AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]],
64 >  [case "$withval" in
65 >   gtk1)      WANT_GTK="gtk";;
66 >   gtk|gtk2)  WANT_GTK="$withval";;
67 >   yes)       WANT_GTK="gtk2 gtk";;
68 >   *)         WANT_GTK="no";;
69 >   esac],
70 >  [WANT_GTK="gtk2 gtk"])
71   AC_ARG_WITH(mon,             [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
72  
73   dnl Canonical system information.
# Line 153 | Line 161 | if [[ "x$WANT_SDL" = "xyes" ]]; then
161        ;;
162      *)
163        sdl_cflags=`$sdl_config --cflags`
164 <      sdl_libs=`$sdl_config --libs`
164 >      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
165 >        sdl_libs=`$sdl_config --static-libs`
166 >      else
167 >        sdl_libs=`$sdl_config --libs`
168 >      fi
169        ;;
170      esac
171      CFLAGS="$CFLAGS $sdl_cflags"
# Line 190 | Line 202 | AC_CHECK_LIB(pthread, pthread_create, ,
202   if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
203    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
204   fi
205 < AC_CHECK_FUNCS(pthread_cancel)
205 > AC_CHECK_FUNCS(pthread_cond_init)
206 > AC_CHECK_FUNCS(pthread_cancel pthread_testcancel)
207   AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
208   AC_CHECK_FUNCS(pthread_mutexattr_settype)
209   AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
# Line 234 | Line 247 | fi
247  
248   dnl We use GTK+ if possible.
249   UISRCS=../dummy/prefs_editor_dummy.cpp
250 < if [[ "x$WANT_GTK" = "xyes" ]]; then
250 > case "x$WANT_GTK" in
251 > xgtk2*)
252 >  AM_PATH_GTK_2_0(1.3.15, [
253 >    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
254 >    CFLAGS="$CFLAGS $GTK_CFLAGS"
255 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
256 >    LIBS="$LIBS $GTK_LIBS"
257 >    UISRCS=prefs_editor_gtk.cpp
258 >    WANT_GTK=gtk2
259 >  ], [
260 >    case "x${WANT_GTK}x" in
261 >    *gtkx)
262 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
263 >      WANT_GTK=gtk
264 >      ;;
265 >    *)
266 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
267 >      WANT_GTK=no
268 >      ;;
269 >    esac
270 >  ])
271 >  ;;
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"
# Line 273 | Line 309 | AC_SYS_LARGEFILE
309  
310   dnl Checks for header files.
311   AC_HEADER_STDC
312 + AC_CHECK_HEADERS(stdlib.h stdint.h)
313   AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
314   AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
315 < AC_CHECK_HEADERS(sys/socket.h)
315 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
316 > AC_CHECK_HEADERS(sys/poll.h sys/select.h)
317 > AC_CHECK_HEADERS(arpa/inet.h)
318   AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
319 + #ifdef HAVE_SYS_TYPES_H
320 + #include <sys/types.h>
321 + #endif
322   #ifdef HAVE_SYS_SOCKET_H
323   #include <sys/socket.h>
324   #endif
325   ])
326   AC_CHECK_HEADERS(AvailabilityMacros.h)
327 + AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
328  
329   dnl Checks for typedefs, structures, and compiler characteristics.
330   AC_C_BIGENDIAN
# Line 321 | Line 364 | if [[ "x$ac_cv_type_socklen_t" != "xyes"
364   fi
365  
366   dnl Checks for library functions.
367 < AC_CHECK_FUNCS(strdup cfmakeraw)
367 > AC_CHECK_FUNCS(strdup strerror cfmakeraw)
368   AC_CHECK_FUNCS(clock_gettime timer_create)
369   AC_CHECK_FUNCS(sigaction signal)
370   AC_CHECK_FUNCS(mmap mprotect munmap)
371   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
372 + AC_CHECK_FUNCS(poll inet_aton)
373  
374   dnl Darwin seems to define mach_task_self() instead of task_self().
375   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 378 | Line 422 | dnl (end of code from openssh-3.2.2p1 co
422  
423  
424   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
425 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
425 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
426    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
427    AC_CACHE_CHECK([whether compiler supports framework $1],
428      ac_Framework, [
# Line 398 | Line 442 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
442   dnl Check for some MacOS X frameworks
443   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
444   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
445 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
446  
447   dnl Select system-dependant source files.
448   SERIALSRC=serial_unix.cpp
449   ETHERSRC=../dummy/ether_dummy.cpp
450   SCSISRC=../dummy/scsi_dummy.cpp
451   AUDIOSRC=../dummy/audio_dummy.cpp
452 + EXTFSSRC=extfs_unix.cpp
453   EXTRASYSSRCS=
454   CAN_NATIVE_M68K=no
455   case "$target_os" in
# Line 437 | Line 483 | freebsd*)
483    ;;
484   netbsd*)
485    CAN_NATIVE_M68K=yes
486 +  ETHERSRC=ether_unix.cpp
487    ;;
488   solaris*)
489    AUDIOSRC=Solaris/audio_solaris.cpp
# Line 446 | Line 493 | irix*)
493    ETHERSRC=ether_unix.cpp
494    AUDIOSRC=Irix/audio_irix.cpp
495    EXTRASYSSRCS=Irix/unaligned.c
449  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
450  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
496    LIBS="$LIBS -laudio"
497    WANT_ESD=no
498  
# Line 461 | Line 506 | irix*)
506    CFLAGS="$ocflags"
507    ;;
508   darwin*)
509 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
509 >  ETHERSRC=ether_unix.cpp
510 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
511      EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
512    fi
513 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
514 +    EXTFSSRC=../MacOSX/extfs_macosx.mm
515 +  fi
516    ;;
517   cygwin*)
518    SERIALSRC="../dummy/serial_dummy.cpp"
519 +  EXTRASYSSRCS="../Windows/BasiliskII.rc"
520    ;;
521   esac
522 +
523 + dnl Is the slirp library supported?
524 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
525 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
526 +  SLIRP_SRCS="\
527 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
528 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
529 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
530 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
531 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
532 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
533 + fi
534 + AC_SUBST(SLIRP_SRCS)
535 +
536   dnl SDL overrides
537   if [[ "x$WANT_SDL" = "xyes" ]]; then
538    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
# Line 480 | Line 544 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
544    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
545      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
546    else
547 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
547 >    case "$target_os" in
548 >    cygwin*)
549 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
550 >      ;;
551 >    *)
552 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
553 >      ;;
554 >    esac
555    fi
556   else
557    VIDEOSRCS="video_x.cpp"
# Line 506 | Line 577 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
577    ETHERSRC=../dummy/ether_dummy.cpp
578    AUDIOSRC=../dummy/audio_dummy.cpp
579   fi
580 < SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
580 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
581  
582   dnl Define a macro that translates a yesno-variable into a C macro definition
583   dnl to be put into the config.h file
584   dnl $1 -- the macro to define
585   dnl $2 -- the value to translate
586   dnl $3 -- template name
587 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
587 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
588      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
589          AC_DEFINE($1, 1, $3)
590      fi
# Line 1040 | Line 1111 | AC_MSG_RESULT($HAVE_GAS)
1111   dnl Check for GCC 2.7 or higher.
1112   HAVE_GCC27=no
1113   AC_MSG_CHECKING(for GCC 2.7 or higher)
1114 < AC_EGREP_CPP(xyes,
1115 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1116 <  xyes
1117 < #endif
1118 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1114 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1115 >                                     # error gcc < 2.7
1116 >                                     #endif
1117 >                                   ]])],
1118 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1119 >                  [AC_MSG_RESULT(no)])
1120  
1121   dnl Check for GCC 3.0 or higher.
1122   HAVE_GCC30=no
1123   AC_MSG_CHECKING(for GCC 3.0 or higher)
1124 < AC_EGREP_CPP(xyes,
1125 < [#if __GNUC__ >= 3
1126 <  xyes
1127 < #endif
1128 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1124 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1125 >                                     # error gcc < 3
1126 >                                     #endif
1127 >                                   ]])],
1128 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1129 >                  [AC_MSG_RESULT(no)])
1130 >
1131 > dnl Check for ICC.
1132 > AC_MSG_CHECKING(for ICC)
1133 > HAVE_ICC=no
1134 > if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
1135 >  HAVE_ICC=yes
1136 > fi
1137 > AC_MSG_RESULT($HAVE_ICC)
1138  
1139   dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
1140   dnl Also set "-fno-exceptions" for C++ because exception handling requires
# Line 1068 | Line 1149 | dnl As of 2001/08/02, this affects the f
1149   dnl Official: probably gcc-3.1 (mainline CVS)
1150   dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
1151   dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
1152 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1152 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1153    SAVED_CXXFLAGS="$CXXFLAGS"
1154    CXXFLAGS="$CXXFLAGS -fno-merge-constants"
1155    AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
# Line 1084 | Line 1165 | fi
1165  
1166   dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1167   dnl However, there are some corner cases exposed on x86-64
1168 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1168 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1169    SAVED_CXXFLAGS="$CXXFLAGS"
1170    CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1171    AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
# Line 1098 | Line 1179 | if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1179    fi
1180   fi
1181  
1182 + dnl Add -fno-strict-aliasing for slirp sources
1183 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1184 +  SAVED_CFLAGS="$CFLAGS"
1185 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1186 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1187 +    ac_cv_gcc_no_strict_aliasing, [
1188 +    AC_TRY_COMPILE([],[],
1189 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1190 +      [ac_cv_gcc_no_strict_aliasing=no])
1191 +  ])
1192 +  CFLAGS="$SAVED_CFLAGS"
1193 + fi
1194 +
1195 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1196 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1197 +  SAVED_CFLAGS="$CFLAGS"
1198 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1199 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1200 +    ac_cv_gcc_mdynamic_no_pic, [
1201 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1202 +  ])
1203 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1204 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1205 +  else
1206 +    CFLAGS="$SAVED_CFLAGS"
1207 +  fi
1208 + fi
1209 +
1210   dnl Select appropriate CPU source and REGPARAM define.
1211   ASM_OPTIMIZATIONS=none
1212   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