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 |
|
|
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= |
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" |
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) |
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 |
|
|
296 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
331 |
|
fi |
332 |
|
|
333 |
|
dnl Checks for library functions. |
334 |
< |
AC_CHECK_FUNCS(strdup cfmakeraw) |
334 |
> |
AC_CHECK_FUNCS(strdup strerror cfmakeraw) |
335 |
|
AC_CHECK_FUNCS(clock_gettime timer_create) |
336 |
|
AC_CHECK_FUNCS(sigaction signal) |
337 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
338 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
339 |
+ |
AC_CHECK_FUNCS(poll inet_aton) |
340 |
|
|
341 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
342 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
363 |
|
*-*-sco3.2v5*) |
364 |
|
no_dev_ptmx=1 |
365 |
|
;; |
366 |
+ |
*-*-cygwin*) |
367 |
+ |
no_dev_ptmx=1 |
368 |
+ |
;; |
369 |
|
esac |
370 |
|
|
371 |
|
if test -z "$no_dev_ptmx" ; then |
415 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
416 |
|
SCSISRC=../dummy/scsi_dummy.cpp |
417 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
418 |
+ |
EXTFSSRC=extfs_unix.cpp |
419 |
|
EXTRASYSSRCS= |
420 |
|
CAN_NATIVE_M68K=no |
421 |
|
case "$target_os" in |
449 |
|
;; |
450 |
|
netbsd*) |
451 |
|
CAN_NATIVE_M68K=yes |
452 |
+ |
ETHERSRC=ether_unix.cpp |
453 |
|
;; |
454 |
|
solaris*) |
455 |
|
AUDIOSRC=Solaris/audio_solaris.cpp |
474 |
|
CFLAGS="$ocflags" |
475 |
|
;; |
476 |
|
darwin*) |
477 |
+ |
ETHERSRC=ether_unix.cpp |
478 |
|
if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then |
479 |
|
EXTRASYSSRCS="../MacOSX/sys_darwin.cpp" |
480 |
|
fi |
481 |
+ |
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
482 |
+ |
EXTFSSRC=../MacOSX/extfs_macosx.mm |
483 |
+ |
fi |
484 |
+ |
;; |
485 |
+ |
cygwin*) |
486 |
+ |
SERIALSRC="../dummy/serial_dummy.cpp" |
487 |
+ |
EXTRASYSSRCS="../Windows/BasiliskII.rc" |
488 |
|
;; |
489 |
|
esac |
490 |
+ |
|
491 |
+ |
dnl Is the slirp library supported? |
492 |
+ |
if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then |
493 |
+ |
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported]) |
494 |
+ |
SLIRP_SRCS="\ |
495 |
+ |
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ |
496 |
+ |
../slirp/cksum.c ../slirp/mbuf.c ../slirp/tcp_output.c \ |
497 |
+ |
../slirp/debug.c ../slirp/misc.c ../slirp/tcp_subr.c \ |
498 |
+ |
../slirp/if.c ../slirp/sbuf.c ../slirp/tcp_timer.c \ |
499 |
+ |
../slirp/ip_icmp.c ../slirp/slirp.c ../slirp/tftp.c \ |
500 |
+ |
../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c" |
501 |
+ |
fi |
502 |
+ |
AC_SUBST(SLIRP_SRCS) |
503 |
+ |
|
504 |
|
dnl SDL overrides |
505 |
|
if [[ "x$WANT_SDL" = "xyes" ]]; then |
506 |
|
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) |
512 |
|
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
513 |
|
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" |
514 |
|
else |
515 |
< |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
515 |
> |
case "$target_os" in |
516 |
> |
cygwin*) |
517 |
> |
EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp" |
518 |
> |
;; |
519 |
> |
*) |
520 |
> |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
521 |
> |
;; |
522 |
> |
esac |
523 |
|
fi |
524 |
|
else |
525 |
|
VIDEOSRCS="video_x.cpp" |
545 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
546 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
547 |
|
fi |
548 |
< |
SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
548 |
> |
SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
549 |
|
|
550 |
|
dnl Define a macro that translates a yesno-variable into a C macro definition |
551 |
|
dnl to be put into the config.h file |
898 |
|
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
899 |
|
[Define if your system supports Mach exceptions.]) |
900 |
|
|
901 |
+ |
dnl Check if Windows exceptions are supported. |
902 |
+ |
AC_CACHE_CHECK([whether your system supports Windows exceptions], |
903 |
+ |
ac_cv_have_win32_exceptions, [ |
904 |
+ |
AC_LANG_SAVE |
905 |
+ |
AC_LANG_CPLUSPLUS |
906 |
+ |
AC_TRY_RUN([ |
907 |
+ |
#define HAVE_WIN32_EXCEPTIONS 1 |
908 |
+ |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
909 |
+ |
#include "vm_alloc.cpp" |
910 |
+ |
#include "sigsegv.cpp" |
911 |
+ |
], [ |
912 |
+ |
sigsegv_recovery=win32 |
913 |
+ |
ac_cv_have_win32_exceptions=yes |
914 |
+ |
], |
915 |
+ |
ac_cv_have_win32_exceptions=no, |
916 |
+ |
dnl When cross-compiling, do not assume anything. |
917 |
+ |
ac_cv_have_win32_exceptions=no |
918 |
+ |
) |
919 |
+ |
AC_LANG_RESTORE |
920 |
+ |
] |
921 |
+ |
) |
922 |
+ |
AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions", |
923 |
+ |
[Define if your system supports Windows exceptions.]) |
924 |
+ |
|
925 |
|
dnl Otherwise, check if extended signals are supported. |
926 |
|
if [[ -z "$sigsegv_recovery" ]]; then |
927 |
|
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
1094 |
|
#endif |
1095 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1096 |
|
|
1097 |
+ |
dnl Check for ICC. |
1098 |
+ |
AC_MSG_CHECKING(for ICC) |
1099 |
+ |
HAVE_ICC=no |
1100 |
+ |
if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then |
1101 |
+ |
HAVE_ICC=yes |
1102 |
+ |
fi |
1103 |
+ |
AC_MSG_RESULT($HAVE_ICC) |
1104 |
+ |
|
1105 |
|
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher. |
1106 |
|
dnl Also set "-fno-exceptions" for C++ because exception handling requires |
1107 |
|
dnl the frame pointer. |
1115 |
|
dnl Official: probably gcc-3.1 (mainline CVS) |
1116 |
|
dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk |
1117 |
|
dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1 |
1118 |
< |
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1118 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1119 |
|
SAVED_CXXFLAGS="$CXXFLAGS" |
1120 |
|
CXXFLAGS="$CXXFLAGS -fno-merge-constants" |
1121 |
|
AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [ |
1131 |
|
|
1132 |
|
dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4 |
1133 |
|
dnl However, there are some corner cases exposed on x86-64 |
1134 |
< |
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1134 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1135 |
|
SAVED_CXXFLAGS="$CXXFLAGS" |
1136 |
|
CXXFLAGS="$CXXFLAGS -fno-gcse-sm" |
1137 |
|
AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [ |
1145 |
|
fi |
1146 |
|
fi |
1147 |
|
|
1148 |
+ |
dnl Add -fno-strict-aliasing for slirp sources |
1149 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1150 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1151 |
+ |
CFLAGS="$CFLAGS -fno-strict-aliasing" |
1152 |
+ |
AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing], |
1153 |
+ |
ac_cv_gcc_no_strict_aliasing, [ |
1154 |
+ |
AC_TRY_COMPILE([],[], |
1155 |
+ |
[ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")], |
1156 |
+ |
[ac_cv_gcc_no_strict_aliasing=no]) |
1157 |
+ |
]) |
1158 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1159 |
+ |
fi |
1160 |
+ |
|
1161 |
|
dnl Select appropriate CPU source and REGPARAM define. |
1162 |
|
ASM_OPTIMIZATIONS=none |
1163 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |