1 |
|
dnl Process this file with autoconf to produce a configure script. |
2 |
|
dnl Written in 2002 by Christian Bauer |
3 |
|
|
4 |
< |
AC_INIT([SheepShaver], 2.2, [Christian.Bauer@uni-mainz.de], SheepShaver) |
4 |
> |
AC_INIT([SheepShaver], 2.3, [Christian.Bauer@uni-mainz.de], SheepShaver) |
5 |
|
AC_CONFIG_SRCDIR(main_unix.cpp) |
6 |
|
AC_PREREQ(2.52) |
7 |
|
AC_CONFIG_HEADER(config.h) |
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]) |
125 |
|
|
126 |
|
dnl Checks for libraries. |
127 |
|
AC_CHECK_LIB(posix4, sem_init) |
128 |
+ |
AC_CHECK_LIB(m, cos) |
129 |
|
|
130 |
|
dnl Do we need SDL? |
131 |
|
WANT_SDL=no |
143 |
|
if [[ "x$WANT_SDL" = "xyes" ]]; then |
144 |
|
AC_PATH_PROG(sdl_config, "sdl-config") |
145 |
|
if [[ -n "$sdl_config" ]]; then |
146 |
< |
case $target_os in |
147 |
< |
# Special treatment for Cygwin so that we can still use the POSIX layer |
148 |
< |
*cygwin*) |
149 |
< |
sdl_cflags="-I`$sdl_config --prefix`/include/SDL" |
150 |
< |
sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" |
151 |
< |
;; |
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 |
146 |
> |
sdl_cflags=`$sdl_config --cflags` |
147 |
> |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
148 |
> |
sdl_libs=`$sdl_config --static-libs` |
149 |
> |
else |
150 |
> |
sdl_libs=`$sdl_config --libs` |
151 |
> |
fi |
152 |
|
CFLAGS="$CFLAGS $sdl_cflags" |
153 |
|
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
154 |
|
LIBS="$LIBS $sdl_libs" |
191 |
|
]) |
192 |
|
]) |
193 |
|
AC_CHECK_FUNCS(pthread_cancel) |
194 |
< |
AC_CHECK_FUNCS(pthread_cond_init) |
194 |
> |
AC_CHECK_FUNCS(pthread_cond_init pthread_testcancel) |
195 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
196 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
197 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setpshared) |
332 |
|
AC_HEADER_TIME |
333 |
|
AC_STRUCT_TM |
334 |
|
|
335 |
+ |
dnl Check whether sys/socket.h defines type socklen_t. |
336 |
+ |
dnl (extracted from ac-archive/Miscellaneous) |
337 |
+ |
AC_CACHE_CHECK([for socklen_t], |
338 |
+ |
ac_cv_type_socklen_t, [ |
339 |
+ |
AC_TRY_COMPILE([ |
340 |
+ |
#include <sys/types.h> |
341 |
+ |
#include <sys/socket.h> |
342 |
+ |
], [socklen_t len = 42; return 0;], |
343 |
+ |
ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no, |
344 |
+ |
dnl When cross-compiling, do not assume anything. |
345 |
+ |
ac_cv_type_socklen_t="guessing no" |
346 |
+ |
) |
347 |
+ |
]) |
348 |
+ |
if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then |
349 |
+ |
AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.]) |
350 |
+ |
fi |
351 |
+ |
|
352 |
|
dnl Check whether struct sigaction has sa_restorer member. |
353 |
|
AC_CACHE_CHECK([whether struct sigaction has sa_restorer], |
354 |
|
ac_cv_signal_sa_restorer, [ |
453 |
|
dnl Check for some MacOS X frameworks |
454 |
|
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
455 |
|
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
456 |
+ |
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>]) |
457 |
|
|
458 |
|
dnl Select system-dependant sources. |
459 |
|
SERIALSRC=serial_unix.cpp |
468 |
|
AUDIOSRC=audio_oss_esd.cpp |
469 |
|
SCSISRC=Linux/scsi_linux.cpp |
470 |
|
if [[ "x$EMULATED_PPC" = "xno" ]]; then |
471 |
< |
EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S" |
471 |
> |
EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S" |
472 |
|
fi |
473 |
|
;; |
474 |
|
freebsd*) |
477 |
|
netbsd*) |
478 |
|
ETHERSRC=ether_unix.cpp |
479 |
|
if [[ "x$EMULATED_PPC" = "xno" ]]; then |
480 |
< |
EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S" |
480 |
> |
EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S" |
481 |
|
fi |
482 |
|
;; |
483 |
|
darwin*) |
484 |
|
ETHERSRC=ether_unix.cpp |
485 |
|
if [[ "x$EMULATED_PPC" = "xno" ]]; then |
486 |
< |
EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S" |
486 |
> |
EXTRASYSSRCS="paranoia.cpp ppc_asm.S" |
487 |
|
fi |
488 |
< |
if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then |
488 |
> |
if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then |
489 |
|
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp" |
490 |
|
fi |
491 |
|
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
492 |
|
EXTFSSRC=../MacOSX/extfs_macosx.mm |
493 |
|
fi |
494 |
|
;; |
495 |
< |
cygwin*) |
496 |
< |
SERIALSRC="../dummy/serial_dummy.cpp" |
495 |
> |
irix*) |
496 |
> |
ETHERSRC=ether_unix.cpp |
497 |
> |
AUDIOSRC=Irix/audio_irix.cpp |
498 |
> |
LIBS="$LIBS -laudio" |
499 |
> |
WANT_ESD=no |
500 |
|
;; |
501 |
|
esac |
502 |
|
|
524 |
|
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
525 |
|
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" |
526 |
|
else |
527 |
< |
case "$target_os" in |
508 |
< |
cygwin*) |
509 |
< |
EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp" |
510 |
< |
;; |
511 |
< |
*) |
512 |
< |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
513 |
< |
;; |
514 |
< |
esac |
527 |
> |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
528 |
|
fi |
529 |
|
else |
530 |
|
VIDEOSRCS="video_x.cpp" |
952 |
|
|
953 |
|
dnl Check addressing mode to use |
954 |
|
AC_MSG_CHECKING([for addressing mode to use]) |
942 |
– |
case "$os_target" in |
943 |
– |
cygwin*) |
944 |
– |
WANT_ADDRESSING_MODE="direct,cygwin-hack" |
945 |
– |
NATMEM_OFFSET= |
946 |
– |
;; |
947 |
– |
esac |
955 |
|
if [[ "$EMULATED_PPC" != "yes" ]]; then |
956 |
|
if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then |
957 |
|
AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.]) |
1183 |
|
dnl Check for GCC 2.7 or higher. |
1184 |
|
HAVE_GCC27=no |
1185 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
1186 |
< |
AC_EGREP_CPP(xyes, |
1187 |
< |
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
1188 |
< |
xyes |
1189 |
< |
#endif |
1190 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
1186 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5) |
1187 |
> |
# error gcc < 2.7 |
1188 |
> |
#endif |
1189 |
> |
]])], |
1190 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC27=yes], |
1191 |
> |
[AC_MSG_RESULT(no)]) |
1192 |
|
|
1193 |
|
dnl Check for GCC 3.0 or higher. |
1194 |
|
HAVE_GCC30=no |
1195 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
1196 |
< |
AC_EGREP_CPP(xyes, |
1197 |
< |
[#if __GNUC__ >= 3 |
1198 |
< |
xyes |
1199 |
< |
#endif |
1200 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1196 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3) |
1197 |
> |
# error gcc < 3 |
1198 |
> |
#endif |
1199 |
> |
]])], |
1200 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC30=yes], |
1201 |
> |
[AC_MSG_RESULT(no)]) |
1202 |
|
|
1203 |
|
dnl Check for ICC. |
1204 |
|
AC_MSG_CHECKING(for ICC) |
1242 |
|
CFLAGS="$SAVED_CFLAGS" |
1243 |
|
fi |
1244 |
|
|
1245 |
< |
dnl Add -mdynamic-no-pic for MacOS X |
1246 |
< |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1245 |
> |
dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X) |
1246 |
> |
if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1247 |
|
SAVED_CFLAGS="$CFLAGS" |
1248 |
|
CFLAGS="$CFLAGS -mdynamic-no-pic" |
1249 |
|
AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic], |
1285 |
|
powerpc:mach) |
1286 |
|
ac_cv_use_dyngen=yes |
1287 |
|
;; |
1288 |
+ |
i?86:mach) |
1289 |
+ |
ac_cv_use_dyngen=yes |
1290 |
+ |
;; |
1291 |
|
*:*) |
1292 |
|
ac_cv_use_dyngen=no |
1293 |
|
;; |
1325 |
|
else |
1326 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0" |
1327 |
|
fi |
1328 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0" |
1328 |
> |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0" |
1329 |
|
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1330 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls" |
1331 |
|
fi |