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. |
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_cond_init) |
206 |
|
AC_CHECK_FUNCS(pthread_cancel pthread_testcancel) |
207 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
208 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
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" |
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 sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.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 |
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, [ |
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 |
493 |
|
ETHERSRC=ether_unix.cpp |
494 |
|
AUDIOSRC=Irix/audio_irix.cpp |
495 |
|
EXTRASYSSRCS=Irix/unaligned.c |
462 |
– |
dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS" |
463 |
– |
DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS" |
496 |
|
LIBS="$LIBS -laudio" |
497 |
|
WANT_ESD=no |
498 |
|
|
507 |
|
;; |
508 |
|
darwin*) |
509 |
|
ETHERSRC=ether_unix.cpp |
510 |
< |
if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then |
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 |
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 |
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) |
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" |