14 |
|
dnl cores for the configure tests since some are intended to dump core. |
15 |
|
ulimit -c 0 |
16 |
|
|
17 |
+ |
AC_ARG_ENABLE(standalone-gui,[ --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no]) |
18 |
+ |
|
19 |
|
dnl Video options. |
20 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
21 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
26 |
|
AC_ARG_ENABLE(sdl-static, [ --enable-sdl-static use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no]) |
27 |
|
AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no]) |
28 |
|
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no]) |
29 |
+ |
AC_ARG_ENABLE(sdl-framework, [ --enable-sdl-framework use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no]) |
30 |
+ |
AC_ARG_ENABLE(sdl-framework-prefix, [ --enable-sdl-framework-prefix=PFX default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks]) |
31 |
|
|
32 |
|
dnl JIT compiler options. |
33 |
|
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no]) |
64 |
|
|
65 |
|
dnl External packages. |
66 |
|
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
67 |
< |
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) |
67 |
> |
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], |
68 |
> |
[case "$withval" in |
69 |
> |
gtk1) WANT_GTK="gtk";; |
70 |
> |
gtk|gtk2) WANT_GTK="$withval";; |
71 |
> |
yes) WANT_GTK="gtk2 gtk";; |
72 |
> |
*) WANT_GTK="no";; |
73 |
> |
esac], |
74 |
> |
[WANT_GTK="gtk2 gtk"]) |
75 |
|
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes]) |
76 |
|
|
77 |
|
dnl Canonical system information. |
103 |
|
x86_64* ) HAVE_X86_64=yes;; |
104 |
|
esac |
105 |
|
|
106 |
+ |
dnl Check if we should really be assuming x86_64 even if we detected HAVE_I386 above. |
107 |
+ |
if [[ "x$HAVE_I386" = "xyes" ]]; then |
108 |
+ |
AC_TRY_RUN([ |
109 |
+ |
int main(void) { |
110 |
+ |
#if defined(__x86_64__) |
111 |
+ |
return 0; |
112 |
+ |
#else |
113 |
+ |
return 1; |
114 |
+ |
#endif |
115 |
+ |
} |
116 |
+ |
], [ |
117 |
+ |
HAVE_I386=no |
118 |
+ |
HAVE_X86_64=yes |
119 |
+ |
]) |
120 |
+ |
fi |
121 |
+ |
|
122 |
|
dnl Checks for programs. |
123 |
|
AC_PROG_CC |
124 |
|
AC_PROG_CC_C_O |
136 |
|
if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then |
137 |
|
AC_MSG_RESULT(yes) |
138 |
|
AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".]) |
139 |
< |
MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c" |
139 |
> |
MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c $mon_srcdir/disass/mips-dis.c $mon_srcdir/disass/mips-opc.c $mon_srcdir/disass/mips16-opc.c" |
140 |
|
CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass" |
141 |
|
AC_CHECK_LIB(ncurses, tgetent, , |
142 |
< |
AC_CHECK_LIB(termcap, tgetent, , |
143 |
< |
AC_CHECK_LIB(termlib, tgetent, , |
144 |
< |
AC_CHECK_LIB(terminfo, tgetent, , |
145 |
< |
AC_CHECK_LIB(Hcurses, tgetent, , |
146 |
< |
AC_CHECK_LIB(curses, tgetent)))))) |
142 |
> |
[AC_CHECK_LIB(termcap, tgetent, , |
143 |
> |
[AC_CHECK_LIB(termlib, tgetent, , |
144 |
> |
[AC_CHECK_LIB(terminfo, tgetent, , |
145 |
> |
[AC_CHECK_LIB(Hcurses, tgetent, , |
146 |
> |
[AC_CHECK_LIB(curses, tgetent)])])])])]) |
147 |
|
AC_CHECK_LIB(readline, readline) |
148 |
|
else |
149 |
|
AC_MSG_RESULT(no) |
156 |
|
AC_CHECK_LIB(posix4, sem_init) |
157 |
|
AC_CHECK_LIB(rt, timer_create) |
158 |
|
AC_CHECK_LIB(rt, shm_open) |
159 |
+ |
AC_CHECK_LIB(m, cos) |
160 |
+ |
|
161 |
+ |
dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES) |
162 |
+ |
dnl AC_TRY_LINK uses main() but SDL needs main to take args, |
163 |
+ |
dnl therefore main is undefined with #undef. |
164 |
+ |
dnl Framework can be in an custom location. |
165 |
+ |
AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [ |
166 |
+ |
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1]) |
167 |
+ |
AC_CACHE_CHECK([whether compiler supports framework $1], |
168 |
+ |
ac_Framework, [ |
169 |
+ |
saved_LIBS="$LIBS" |
170 |
+ |
LIBS="$LIBS -framework $1" |
171 |
+ |
if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then |
172 |
+ |
if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then |
173 |
+ |
LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1" |
174 |
+ |
fi |
175 |
+ |
fi |
176 |
+ |
saved_CPPFLAGS="$CPPFLAGS" |
177 |
+ |
CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers" |
178 |
+ |
AC_TRY_LINK( |
179 |
+ |
[$2 |
180 |
+ |
#undef main], [], |
181 |
+ |
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); |
182 |
+ |
LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"] |
183 |
+ |
) |
184 |
+ |
]) |
185 |
+ |
AS_IF([test AS_VAR_GET(ac_Framework) = yes], |
186 |
+ |
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])] |
187 |
+ |
) |
188 |
+ |
AS_VAR_POPDEF([ac_Framework]) |
189 |
+ |
]) |
190 |
|
|
191 |
|
dnl Do we need SDL? |
192 |
|
WANT_SDL=no |
202 |
|
SDL_SUPPORT="$SDL_SUPPORT audio" |
203 |
|
fi |
204 |
|
if [[ "x$WANT_SDL" = "xyes" ]]; then |
205 |
< |
AC_PATH_PROG(sdl_config, "sdl-config") |
206 |
< |
if [[ -n "$sdl_config" ]]; then |
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" |
205 |
> |
if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then |
206 |
> |
AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>]) |
207 |
|
else |
208 |
< |
WANT_SDL=no |
208 |
> |
ac_cv_framework_SDL=no |
209 |
> |
fi |
210 |
> |
if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then |
211 |
> |
AC_PATH_PROG(sdl_config, "sdl-config") |
212 |
> |
if [[ -n "$sdl_config" ]]; then |
213 |
> |
case $target_os in |
214 |
> |
# Special treatment for Cygwin so that we can still use the POSIX layer |
215 |
> |
*cygwin*) |
216 |
> |
sdl_cflags="-I`$sdl_config --prefix`/include/SDL" |
217 |
> |
sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" |
218 |
> |
;; |
219 |
> |
*) |
220 |
> |
sdl_cflags=`$sdl_config --cflags` |
221 |
> |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
222 |
> |
sdl_libs=`$sdl_config --static-libs` |
223 |
> |
else |
224 |
> |
sdl_libs=`$sdl_config --libs` |
225 |
> |
fi |
226 |
> |
;; |
227 |
> |
esac |
228 |
> |
CFLAGS="$CFLAGS $sdl_cflags" |
229 |
> |
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
230 |
> |
LIBS="$LIBS $sdl_libs" |
231 |
> |
else |
232 |
> |
WANT_SDL=no |
233 |
> |
fi |
234 |
|
fi |
235 |
|
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"` |
236 |
|
else |
260 |
|
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then |
261 |
|
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) |
262 |
|
fi |
263 |
+ |
AC_CHECK_FUNCS(pthread_cond_init) |
264 |
|
AC_CHECK_FUNCS(pthread_cancel pthread_testcancel) |
265 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
266 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
305 |
|
|
306 |
|
dnl We use GTK+ if possible. |
307 |
|
UISRCS=../dummy/prefs_editor_dummy.cpp |
308 |
< |
if [[ "x$WANT_GTK" = "xyes" ]]; then |
308 |
> |
case "x$WANT_GTK" in |
309 |
> |
xgtk2*) |
310 |
> |
AM_PATH_GTK_2_0(1.3.15, [ |
311 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
312 |
> |
GUI_LIBS="$GTK_LIBS" |
313 |
> |
WANT_GTK=gtk2 |
314 |
> |
], [ |
315 |
> |
case "x${WANT_GTK}x" in |
316 |
> |
*gtkx) |
317 |
> |
AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.]) |
318 |
> |
WANT_GTK=gtk |
319 |
> |
;; |
320 |
> |
*) |
321 |
> |
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
322 |
> |
WANT_GTK=no |
323 |
> |
;; |
324 |
> |
esac |
325 |
> |
]) |
326 |
> |
;; |
327 |
> |
esac |
328 |
> |
if [[ "x$WANT_GTK" = "xgtk" ]]; then |
329 |
|
AM_PATH_GTK(1.2.0, [ |
330 |
< |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
331 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
246 |
< |
LIBS="$LIBS $GTK_LIBS" |
247 |
< |
UISRCS=prefs_editor_gtk.cpp |
330 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
331 |
> |
GUI_LIBS="$GTK_LIBS" |
332 |
|
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
333 |
|
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
334 |
|
dnl includes <libintl.h> |
335 |
|
AM_GNU_GETTEXT |
336 |
|
B2_PATH_GNOMEUI([ |
337 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
338 |
< |
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
339 |
< |
LIBS="$LIBS $GNOMEUI_LIBS" |
338 |
> |
GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS" |
339 |
> |
GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS" |
340 |
|
], []) |
341 |
|
], [ |
342 |
|
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
343 |
|
WANT_GTK=no |
344 |
|
]) |
345 |
|
fi |
346 |
+ |
if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then |
347 |
+ |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
348 |
+ |
UISRCS=prefs_editor_gtk.cpp |
349 |
+ |
fi |
350 |
+ |
AC_SUBST(GUI_CFLAGS) |
351 |
+ |
AC_SUBST(GUI_LIBS) |
352 |
+ |
|
353 |
+ |
dnl Build external GUI if requested. |
354 |
+ |
if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then |
355 |
+ |
WANT_STANDALONE_GUI=no |
356 |
+ |
fi |
357 |
+ |
if [[ "$WANT_GTK" = "no" ]]; then |
358 |
+ |
WANT_STANDALONE_GUI=no |
359 |
+ |
fi |
360 |
+ |
AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI]) |
361 |
|
|
362 |
|
dnl We use ESD if possible. |
363 |
|
if [[ "x$WANT_ESD" = "xyes" ]]; then |
377 |
|
|
378 |
|
dnl Checks for header files. |
379 |
|
AC_HEADER_STDC |
380 |
+ |
AC_CHECK_HEADERS(stdlib.h stdint.h) |
381 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h) |
382 |
|
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
383 |
|
AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h) |
392 |
|
#endif |
393 |
|
]) |
394 |
|
AC_CHECK_HEADERS(AvailabilityMacros.h) |
395 |
+ |
AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h) |
396 |
|
|
397 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
398 |
|
AC_C_BIGENDIAN |
467 |
|
*-*-cygwin*) |
468 |
|
no_dev_ptmx=1 |
469 |
|
;; |
470 |
+ |
*-*-darwin*) |
471 |
+ |
no_dev_ptmx=1 |
472 |
+ |
;; |
473 |
|
esac |
474 |
|
|
475 |
|
if test -z "$no_dev_ptmx" ; then |
488 |
|
have_dev_ptc=1 |
489 |
|
] |
490 |
|
) |
387 |
– |
|
491 |
|
dnl (end of code from openssh-3.2.2p1 configure.ac) |
492 |
|
|
493 |
+ |
dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK) |
494 |
+ |
dnl doesn't work or is unimplemented. On these systems (mostly older |
495 |
+ |
dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4] |
496 |
+ |
AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O], |
497 |
+ |
ac_cv_nonblocking_io, [ |
498 |
+ |
case "$host" in |
499 |
+ |
*-*-osf*) |
500 |
+ |
ac_cv_nonblocking_io=FIONBIO |
501 |
+ |
;; |
502 |
+ |
*-*-sunos4*) |
503 |
+ |
ac_cv_nonblocking_io=FIONBIO |
504 |
+ |
;; |
505 |
+ |
*-*-ultrix*) |
506 |
+ |
ac_cv_nonblocking_io=FIONBIO |
507 |
+ |
;; |
508 |
+ |
*) |
509 |
+ |
ac_cv_nonblocking_io=O_NONBLOCK |
510 |
+ |
;; |
511 |
+ |
esac |
512 |
+ |
]) |
513 |
+ |
if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then |
514 |
+ |
AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used]) |
515 |
+ |
fi |
516 |
+ |
|
517 |
+ |
dnl Check whether compiler supports byte bit-fields |
518 |
+ |
AC_CACHE_CHECK([whether compiler supports byte bit-fields], |
519 |
+ |
ac_cv_have_byte_bitfields, [ |
520 |
+ |
AC_LANG_SAVE |
521 |
+ |
AC_LANG_CPLUSPLUS |
522 |
+ |
AC_TRY_RUN([ |
523 |
+ |
struct A { |
524 |
+ |
unsigned char b1:4; |
525 |
+ |
unsigned char b2:4; |
526 |
+ |
unsigned char c; |
527 |
+ |
unsigned short s; |
528 |
+ |
unsigned char a[4]; |
529 |
+ |
}; |
530 |
+ |
|
531 |
+ |
int main(void) { |
532 |
+ |
A a; |
533 |
+ |
return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1)); |
534 |
+ |
}], |
535 |
+ |
[ac_cv_have_byte_bitfields=yes], |
536 |
+ |
[ac_cv_have_byte_bitfields=no], |
537 |
+ |
dnl When cross-compiling, assume only GCC supports this |
538 |
+ |
[if [[ "$GCC" = "yes" ]]; then |
539 |
+ |
ac_cv_have_byte_bitfields="guessing yes" |
540 |
+ |
else |
541 |
+ |
ac_cv_have_byte_bitfields="guessing no" |
542 |
+ |
fi] |
543 |
+ |
) |
544 |
+ |
AC_LANG_RESTORE |
545 |
+ |
]) |
546 |
|
|
547 |
|
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES) |
548 |
< |
AC_DEFUN(AC_CHECK_FRAMEWORK, [ |
548 |
> |
AC_DEFUN([AC_CHECK_FRAMEWORK], [ |
549 |
|
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl |
550 |
|
AC_CACHE_CHECK([whether compiler supports framework $1], |
551 |
|
ac_Framework, [ |
552 |
|
saved_LIBS="$LIBS" |
553 |
|
LIBS="$LIBS -framework $1" |
554 |
|
AC_TRY_LINK( |
555 |
< |
[$2], [int main(void) { return 0; }], |
555 |
> |
[$2], [], |
556 |
|
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"] |
557 |
|
) |
558 |
|
]) |
563 |
|
]) |
564 |
|
|
565 |
|
dnl Check for some MacOS X frameworks |
566 |
+ |
AC_CHECK_FRAMEWORK(AppKit, []) |
567 |
|
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
568 |
|
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
569 |
+ |
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>]) |
570 |
|
|
571 |
|
dnl Select system-dependant source files. |
572 |
|
SERIALSRC=serial_unix.cpp |
614 |
|
DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS" |
615 |
|
;; |
616 |
|
irix*) |
459 |
– |
ETHERSRC=ether_unix.cpp |
617 |
|
AUDIOSRC=Irix/audio_irix.cpp |
618 |
|
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" |
619 |
|
LIBS="$LIBS -laudio" |
620 |
|
WANT_ESD=no |
621 |
|
|
625 |
|
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
626 |
|
AC_MSG_CHECKING(if "-IPA" works) |
627 |
|
dnl Do a test compile of an empty function |
628 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
628 |
> |
AC_TRY_COMPILE([#if defined __GNUC__ |
629 |
> |
# error GCC does not support IPA yet |
630 |
> |
#endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
631 |
|
CFLAGS="$ocflags" |
632 |
|
;; |
633 |
|
darwin*) |
634 |
|
ETHERSRC=ether_unix.cpp |
635 |
< |
if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then |
635 |
> |
if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then |
636 |
|
EXTRASYSSRCS="../MacOSX/sys_darwin.cpp" |
637 |
|
fi |
638 |
|
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
639 |
< |
EXTFSSRC=../MacOSX/extfs_macosx.mm |
639 |
> |
EXTFSSRC=../MacOSX/extfs_macosx.cpp |
640 |
|
fi |
641 |
|
;; |
642 |
|
cygwin*) |
646 |
|
esac |
647 |
|
|
648 |
|
dnl Is the slirp library supported? |
649 |
< |
if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then |
649 |
> |
case "$ac_cv_have_byte_bitfields" in |
650 |
> |
yes|"guessing yes") |
651 |
> |
CAN_SLIRP=yes |
652 |
> |
ETHERSRC=ether_unix.cpp |
653 |
> |
;; |
654 |
> |
esac |
655 |
> |
if [[ -n "$CAN_SLIRP" ]]; then |
656 |
|
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported]) |
657 |
|
SLIRP_SRCS="\ |
658 |
|
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ |
667 |
|
dnl SDL overrides |
668 |
|
if [[ "x$WANT_SDL" = "xyes" ]]; then |
669 |
|
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) |
670 |
+ |
if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then |
671 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m" |
672 |
+ |
fi |
673 |
|
fi |
674 |
|
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
675 |
|
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support]) |
718 |
|
dnl $1 -- the macro to define |
719 |
|
dnl $2 -- the value to translate |
720 |
|
dnl $3 -- template name |
721 |
< |
AC_DEFUN(AC_TRANSLATE_DEFINE, [ |
721 |
> |
AC_DEFUN([AC_TRANSLATE_DEFINE], [ |
722 |
|
if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then |
723 |
|
AC_DEFINE($1, 1, $3) |
724 |
|
fi |
929 |
|
] |
930 |
|
) |
931 |
|
|
766 |
– |
dnl Check if we have POSIX shared memory support |
767 |
– |
AC_CACHE_CHECK([whether POSIX shared memory is working], |
768 |
– |
ac_cv_have_posix_shm, [ |
769 |
– |
AC_LANG_SAVE |
770 |
– |
AC_LANG_CPLUSPLUS |
771 |
– |
AC_TRY_RUN([ |
772 |
– |
#define HAVE_POSIX_SHM |
773 |
– |
#include "vm_alloc.cpp" |
774 |
– |
int main(void) { /* returns 0 if we have working POSIX shm */ |
775 |
– |
if (vm_init() < 0) exit(2); |
776 |
– |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
777 |
– |
if (m1 == VM_MAP_FAILED) exit(3); |
778 |
– |
vm_exit(); exit(0); |
779 |
– |
} |
780 |
– |
], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no, |
781 |
– |
dnl When cross-compiling, do not assume anything. |
782 |
– |
ac_cv_have_posix_shm="guessing no" |
783 |
– |
) |
784 |
– |
AC_LANG_RESTORE |
785 |
– |
] |
786 |
– |
) |
787 |
– |
AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm", |
788 |
– |
[Define if your system supports POSIX shared memory.]) |
789 |
– |
|
790 |
– |
dnl Check if we have working 33-bit memory addressing |
791 |
– |
AC_CACHE_CHECK([whether 33-bit memory addressing is working], |
792 |
– |
ac_cv_have_33bit_addressing, [ |
793 |
– |
AC_LANG_SAVE |
794 |
– |
AC_LANG_CPLUSPLUS |
795 |
– |
AC_TRY_RUN([ |
796 |
– |
#define USE_33BIT_ADDRESSING 1 |
797 |
– |
#include "vm_alloc.cpp" |
798 |
– |
int main(void) { /* returns 0 if we have working 33-bit addressing */ |
799 |
– |
if (sizeof(void *) < 8) exit(1); |
800 |
– |
if (vm_init() < 0) exit(2); |
801 |
– |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
802 |
– |
if (m1 == VM_MAP_FAILED) exit(3); |
803 |
– |
char *m2 = m1 + (1L << 32); |
804 |
– |
m1[0] = 0x12; if (m2[0] != 0x12) exit(4); |
805 |
– |
m2[0] = 0x34; if (m1[0] != 0x34) exit(5); |
806 |
– |
vm_exit(); exit(0); |
807 |
– |
} |
808 |
– |
], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no, |
809 |
– |
dnl When cross-compiling, do not assume anything. |
810 |
– |
ac_cv_have_33bit_addressing="guessing no" |
811 |
– |
) |
812 |
– |
AC_LANG_RESTORE |
813 |
– |
] |
814 |
– |
) |
815 |
– |
|
932 |
|
dnl Check signal handlers need to be reinstalled |
933 |
|
AC_CACHE_CHECK([whether signal handlers need to be reinstalled], |
934 |
|
ac_cv_signal_need_reinstall, [ |
996 |
|
AC_LANG_SAVE |
997 |
|
AC_LANG_CPLUSPLUS |
998 |
|
AC_TRY_RUN([ |
999 |
+ |
#define HAVE_UNISTD_H 1 |
1000 |
+ |
#define HAVE_MACH_VM 1 |
1001 |
+ |
#define HAVE_MACH_TASK_SELF 1 |
1002 |
|
#define HAVE_MACH_EXCEPTIONS 1 |
1003 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
1004 |
|
#include "vm_alloc.cpp" |
1121 |
|
dnl A dummy program that returns always true |
1122 |
|
AC_PATH_PROG([BLESS], "true") |
1123 |
|
|
1124 |
+ |
dnl Check for linker script support |
1125 |
+ |
case $target_os:$target_cpu in |
1126 |
+ |
linux*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1127 |
+ |
linux*:x86_64) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";; |
1128 |
+ |
linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";; |
1129 |
+ |
netbsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1130 |
+ |
freebsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";; |
1131 |
+ |
darwin*:*) LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";; |
1132 |
+ |
esac |
1133 |
+ |
if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then |
1134 |
+ |
AC_CACHE_CHECK([whether linker script is usable], |
1135 |
+ |
ac_cv_linker_script_works, [ |
1136 |
+ |
AC_LANG_SAVE |
1137 |
+ |
AC_LANG_CPLUSPLUS |
1138 |
+ |
saved_LDFLAGS="$LDFLAGS" |
1139 |
+ |
LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS" |
1140 |
+ |
AC_TRY_RUN( |
1141 |
+ |
[int main() {if ((char *)&main < (char *)0x70000000) return 1;}], |
1142 |
+ |
[ac_cv_linker_script_works=yes], |
1143 |
+ |
[ac_cv_linker_script_works=no], |
1144 |
+ |
dnl When cross-compiling, assume it works |
1145 |
+ |
[ac_cv_linker_script_works="guessing yes"] |
1146 |
+ |
) |
1147 |
+ |
AC_LANG_RESTORE |
1148 |
+ |
if [[ "$ac_cv_linker_script_works" = "no" ]]; then |
1149 |
+ |
LDFLAGS="$saved_LDFLAGS" |
1150 |
+ |
LINKER_SCRIPT_FLAGS="" |
1151 |
+ |
fi |
1152 |
+ |
]) |
1153 |
+ |
fi |
1154 |
+ |
AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works", |
1155 |
+ |
[Define if there is a linker script to relocate the executable above 0x70000000.]) |
1156 |
+ |
|
1157 |
|
dnl Determine the addressing mode to use |
1158 |
|
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
1159 |
|
ADDRESSING_MODE="real" |
1231 |
|
dnl Check for GCC 2.7 or higher. |
1232 |
|
HAVE_GCC27=no |
1233 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
1234 |
< |
AC_EGREP_CPP(xyes, |
1235 |
< |
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
1236 |
< |
xyes |
1237 |
< |
#endif |
1238 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
1234 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5) |
1235 |
> |
# error gcc < 2.7 |
1236 |
> |
#endif |
1237 |
> |
]])], |
1238 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC27=yes], |
1239 |
> |
[AC_MSG_RESULT(no)]) |
1240 |
|
|
1241 |
|
dnl Check for GCC 3.0 or higher. |
1242 |
|
HAVE_GCC30=no |
1243 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
1244 |
< |
AC_EGREP_CPP(xyes, |
1245 |
< |
[#if __GNUC__ >= 3 |
1246 |
< |
xyes |
1247 |
< |
#endif |
1248 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1244 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3) |
1245 |
> |
# error gcc < 3 |
1246 |
> |
#endif |
1247 |
> |
]])], |
1248 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC30=yes], |
1249 |
> |
[AC_MSG_RESULT(no)]) |
1250 |
|
|
1251 |
|
dnl Check for ICC. |
1252 |
|
AC_MSG_CHECKING(for ICC) |
1306 |
|
AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing], |
1307 |
|
ac_cv_gcc_no_strict_aliasing, [ |
1308 |
|
AC_TRY_COMPILE([],[], |
1309 |
< |
[ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "$CFLAGS")], |
1309 |
> |
[ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")], |
1310 |
|
[ac_cv_gcc_no_strict_aliasing=no]) |
1311 |
|
]) |
1312 |
|
CFLAGS="$SAVED_CFLAGS" |
1313 |
|
fi |
1314 |
|
|
1315 |
+ |
dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X) |
1316 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1317 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1318 |
+ |
CFLAGS="$CFLAGS -mdynamic-no-pic" |
1319 |
+ |
AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic], |
1320 |
+ |
ac_cv_gcc_mdynamic_no_pic, [ |
1321 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no]) |
1322 |
+ |
]) |
1323 |
+ |
if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then |
1324 |
+ |
CXXFLAGS="$CXXFLAGS -mdynamic-no-pic" |
1325 |
+ |
else |
1326 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1327 |
+ |
fi |
1328 |
+ |
fi |
1329 |
+ |
|
1330 |
|
dnl Select appropriate CPU source and REGPARAM define. |
1331 |
|
ASM_OPTIMIZATIONS=none |
1332 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
1353 |
|
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
1354 |
|
JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS" |
1355 |
|
CAN_JIT=yes |
1187 |
– |
WANT_33BIT_ADDRESSING=yes |
1356 |
|
fi |
1357 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
1358 |
|
dnl SPARC CPU |
1409 |
|
JITSRCS="" |
1410 |
|
fi |
1411 |
|
|
1244 |
– |
dnl Use 33-bit memory addressing? |
1245 |
– |
if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then |
1246 |
– |
use_33bit_addressing=yes |
1247 |
– |
fi |
1248 |
– |
AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing", |
1249 |
– |
[Define to use 33-bit memory addressing on 64-bit JIT capable systems.]) |
1250 |
– |
|
1412 |
|
dnl Utility macro used by next two tests. |
1413 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
1414 |
|
dnl commands examining object file, |