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.28 by gbeauche, 2005-06-22T16:38:15Z vs.
Revision 1.35 by gbeauche, 2005-07-04T06:09:59Z

# 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 + dnl Invite Cygwin users to build within the Windows/ directory
18 + case $target_os in
19 + *cygwin* | *mingw32*)
20 +  AC_MSG_ERROR([You can only build the Windows version from its directory, Cygwin/X11 is not supported.])
21 +  ;;
22 + esac
23 +
24   dnl Options.
25   AC_ARG_ENABLE(jit,          [  --enable-jit            enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
26   AC_ARG_ENABLE(ppc-emulator, [  --enable-ppc-emulator   use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto])
# Line 135 | Line 142 | fi
142   if [[ "x$WANT_SDL" = "xyes" ]]; then
143    AC_PATH_PROG(sdl_config, "sdl-config")
144    if [[ -n "$sdl_config" ]]; then
145 <    case $target_os in
146 <    # Special treatment for Cygwin so that we can still use the POSIX layer
147 <    *cygwin*)
148 <      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
149 <      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
150 <      ;;
144 <    *)
145 <      sdl_cflags=`$sdl_config --cflags`
146 <      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
147 <        sdl_libs=`$sdl_config --static-libs`
148 <      else
149 <        sdl_libs=`$sdl_config --libs`
150 <      fi
151 <      ;;
152 <    esac
145 >    sdl_cflags=`$sdl_config --cflags`
146 >    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
147 >      sdl_libs=`$sdl_config --static-libs`
148 >    else
149 >      sdl_libs=`$sdl_config --libs`
150 >    fi
151      CFLAGS="$CFLAGS $sdl_cflags"
152      CXXFLAGS="$CXXFLAGS $sdl_cflags"
153      LIBS="$LIBS $sdl_libs"
# Line 185 | Line 183 | no:linux*|no:netbsd*)
183    AC_CHECK_LIB(pthread, pthread_create, , [
184      AC_CHECK_LIB(c_r, pthread_create, , [
185        AC_CHECK_LIB(PTL, pthread_create, , [
186 <        AC_MSG_ERROR([You need pthreads to run Basilisk II.])
186 >        dnl XXX remove when no pthreads case is merged
187 >        AC_MSG_ERROR([You need pthreads to run SheepShaver.])
188 >        HAVE_PTHREADS=no
189        ])
190      ])
191    ])
192    AC_CHECK_FUNCS(pthread_cancel)
193 +  AC_CHECK_FUNCS(pthread_cond_init pthread_testcancel)
194    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
195    AC_CHECK_FUNCS(pthread_mutexattr_settype)
196    AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
196  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
197    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
198  fi
197    dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
198    SEMSRC=
199    AC_CHECK_FUNCS(sem_init, , [
# Line 205 | Line 203 | no:linux*|no:netbsd*)
203    ])
204    ;;
205   esac
206 + if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
207 +  AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
208 + fi
209  
210   dnl We use FBDev DGA if possible.
211   if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
# Line 295 | Line 296 | AC_SYS_LARGEFILE
296   dnl Checks for header files.
297   AC_HEADER_STDC
298   AC_HEADER_SYS_WAIT
299 < AC_CHECK_HEADERS(malloc.h)
299 > AC_CHECK_HEADERS(malloc.h stdint.h)
300   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
300 AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
301   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
302 < AC_CHECK_HEADERS(linux/if.h, [], [], [
303 < #if HAVE_SYS_SOCKET_H
304 < # include <sys/socket.h>
302 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
303 > AC_CHECK_HEADERS(sys/time.h sys/poll.h sys/select.h arpa/inet.h)
304 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
305 > #ifdef HAVE_SYS_TYPES_H
306 > #include <sys/types.h>
307 > #endif
308 > #ifdef HAVE_SYS_SOCKET_H
309 > #include <sys/socket.h>
310   #endif
311   ])
312 < AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
312 > AC_CHECK_HEADERS(AvailabilityMacros.h)
313 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
314   AC_CHECK_HEADERS(fenv.h)
315  
316   dnl Checks for typedefs, structures, and compiler characteristics.
# Line 325 | Line 331 | AC_TYPE_SIGNAL
331   AC_HEADER_TIME
332   AC_STRUCT_TM
333  
334 + dnl Check whether sys/socket.h defines type socklen_t.
335 + dnl (extracted from ac-archive/Miscellaneous)
336 + AC_CACHE_CHECK([for socklen_t],
337 +  ac_cv_type_socklen_t, [
338 +  AC_TRY_COMPILE([
339 +    #include <sys/types.h>
340 +    #include <sys/socket.h>
341 +  ], [socklen_t len = 42; return 0;],
342 +  ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
343 +  dnl When cross-compiling, do not assume anything.
344 +  ac_cv_type_socklen_t="guessing no"
345 +  )
346 + ])
347 + if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
348 +  AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
349 + fi
350 +
351   dnl Check whether struct sigaction has sa_restorer member.
352   AC_CACHE_CHECK([whether struct sigaction has sa_restorer],
353    ac_cv_signal_sa_restorer, [
# Line 341 | Line 364 | if [[ "x$ac_cv_signal_sa_restorer" = "xy
364   fi
365  
366   dnl Checks for library functions.
367 < AC_CHECK_FUNCS(strdup strlcpy cfmakeraw)
367 > AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw)
368   AC_CHECK_FUNCS(nanosleep)
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(exp2f log2f exp2 log2)
373   AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
374 + AC_CHECK_FUNCS(poll inet_aton)
375  
376   dnl Darwin seems to define mach_task_self() instead of task_self().
377   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 438 | Line 462 | EXTFSSRC=extfs_unix.cpp
462   EXTRASYSSRCS=
463   case "$target_os" in
464   linux*)
465 <  ETHERSRC=Linux/ether_linux.cpp
465 >  ETHERSRC=ether_unix.cpp
466    AUDIOSRC=audio_oss_esd.cpp
467    SCSISRC=Linux/scsi_linux.cpp
468    if [[ "x$EMULATED_PPC" = "xno" ]]; then
469 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
469 >    EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
470    fi
471    ;;
472 + freebsd*)
473 +  ETHERSRC=ether_unix.cpp
474 +  ;;
475   netbsd*)
476 +  ETHERSRC=ether_unix.cpp
477    if [[ "x$EMULATED_PPC" = "xno" ]]; then
478 <    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
478 >    EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
479    fi
480    ;;
481   darwin*)
482 +  ETHERSRC=ether_unix.cpp
483    if [[ "x$EMULATED_PPC" = "xno" ]]; then
484 <    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
484 >    EXTRASYSSRCS="paranoia.cpp ppc_asm.S"
485    fi
486    if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
487      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
# Line 461 | Line 490 | darwin*)
490      EXTFSSRC=../MacOSX/extfs_macosx.mm
491    fi
492    ;;
464 cygwin*)
465  SERIALSRC="../dummy/serial_dummy.cpp"
466  ;;
493   esac
494  
495 + dnl Is the slirp library supported?
496 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
497 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
498 +  SLIRP_SRCS="\
499 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
500 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
501 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
502 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
503 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
504 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
505 + fi
506 + AC_SUBST(SLIRP_SRCS)
507 +
508   dnl SDL overrides
509   if [[ "x$WANT_SDL" = "xyes" ]]; then
510    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
# Line 477 | Line 516 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
516    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
517      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
518    else
519 <    case "$target_os" in
481 <    cygwin*)
482 <      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
483 <      ;;
484 <    *)
485 <      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
486 <      ;;
487 <    esac
519 >    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
520    fi
521   else
522    VIDEOSRCS="video_x.cpp"
# Line 912 | Line 944 | fi
944  
945   dnl Check addressing mode to use
946   AC_MSG_CHECKING([for addressing mode to use])
915 case "$os_target" in
916 cygwin*)
917  WANT_ADDRESSING_MODE="direct,cygwin-hack"
918  NATMEM_OFFSET=
919  ;;
920 esac
947   if [[ "$EMULATED_PPC" != "yes" ]]; then
948    if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
949      AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
# Line 1193 | Line 1219 | AC_CACHE_CHECK([the format of compiler g
1219    rm -rf conftest*
1220   ])
1221  
1222 + dnl Add -fno-strict-aliasing for slirp sources
1223 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1224 +  SAVED_CFLAGS="$CFLAGS"
1225 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1226 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1227 +    ac_cv_gcc_no_strict_aliasing, [
1228 +    AC_TRY_COMPILE([],[],
1229 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1230 +      [ac_cv_gcc_no_strict_aliasing=no])
1231 +  ])
1232 +  CFLAGS="$SAVED_CFLAGS"
1233 + fi
1234 +
1235 + dnl Add -mdynamic-no-pic for MacOS X
1236 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1237 +  SAVED_CFLAGS="$CFLAGS"
1238 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1239 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1240 +    ac_cv_gcc_mdynamic_no_pic, [
1241 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1242 +  ])
1243 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1244 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1245 +  else
1246 +    CFLAGS="$SAVED_CFLAGS"
1247 +  fi
1248 + fi
1249 +
1250   dnl CPU emulator sources
1251   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1252    CPUSRCS="\

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines