6 |
|
AC_PREREQ(2.52) |
7 |
|
AC_CONFIG_HEADER(config.h) |
8 |
|
|
9 |
+ |
dnl Aliases for PACKAGE and VERSION macros. |
10 |
+ |
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.]) |
11 |
+ |
AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.]) |
12 |
+ |
|
13 |
+ |
dnl Some systems do not put corefiles in the currect directory, avoid saving |
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]) |
22 |
|
AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes]) |
23 |
|
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
24 |
|
|
25 |
+ |
dnl SDL options. |
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]) |
34 |
|
AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=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 |
+ |
AC_ARG_WITH(bincue, |
78 |
+ |
AS_HELP_STRING([--with-bincue], [Allow cdrom image files in bin/cue mode])) |
79 |
+ |
|
80 |
|
dnl Canonical system information. |
81 |
|
AC_CANONICAL_HOST |
82 |
|
AC_CANONICAL_TARGET |
106 |
|
x86_64* ) HAVE_X86_64=yes;; |
107 |
|
esac |
108 |
|
|
109 |
+ |
dnl Check if we should really be assuming x86_64 even if we detected HAVE_I386 above. |
110 |
+ |
if [[ "x$HAVE_I386" = "xyes" ]]; then |
111 |
+ |
AC_TRY_RUN([ |
112 |
+ |
int main(void) { |
113 |
+ |
#if defined(__x86_64__) |
114 |
+ |
return 0; |
115 |
+ |
#else |
116 |
+ |
return 1; |
117 |
+ |
#endif |
118 |
+ |
} |
119 |
+ |
], [ |
120 |
+ |
HAVE_I386=no |
121 |
+ |
HAVE_X86_64=yes |
122 |
+ |
]) |
123 |
+ |
fi |
124 |
+ |
|
125 |
|
dnl Checks for programs. |
126 |
|
AC_PROG_CC |
127 |
|
AC_PROG_CC_C_O |
129 |
|
AC_PROG_CXX |
130 |
|
AC_PROG_MAKE_SET |
131 |
|
AC_PROG_INSTALL |
132 |
+ |
AC_PROG_EGREP |
133 |
|
|
134 |
|
dnl We use mon if possible. |
135 |
|
MONSRCS= |
139 |
|
if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then |
140 |
|
AC_MSG_RESULT(yes) |
141 |
|
AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".]) |
142 |
< |
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" |
142 |
> |
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" |
143 |
|
CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass" |
144 |
|
AC_CHECK_LIB(ncurses, tgetent, , |
145 |
< |
AC_CHECK_LIB(termcap, tgetent, , |
146 |
< |
AC_CHECK_LIB(termlib, tgetent, , |
147 |
< |
AC_CHECK_LIB(terminfo, tgetent, , |
148 |
< |
AC_CHECK_LIB(Hcurses, tgetent, , |
149 |
< |
AC_CHECK_LIB(curses, tgetent)))))) |
145 |
> |
[AC_CHECK_LIB(termcap, tgetent, , |
146 |
> |
[AC_CHECK_LIB(termlib, tgetent, , |
147 |
> |
[AC_CHECK_LIB(terminfo, tgetent, , |
148 |
> |
[AC_CHECK_LIB(Hcurses, tgetent, , |
149 |
> |
[AC_CHECK_LIB(curses, tgetent)])])])])]) |
150 |
|
AC_CHECK_LIB(readline, readline) |
107 |
– |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
151 |
|
else |
152 |
|
AC_MSG_RESULT(no) |
153 |
|
AC_MSG_WARN([Could not find mon, ignoring --with-mon.]) |
158 |
|
dnl Checks for libraries. |
159 |
|
AC_CHECK_LIB(posix4, sem_init) |
160 |
|
AC_CHECK_LIB(rt, timer_create) |
161 |
+ |
AC_CHECK_LIB(rt, shm_open) |
162 |
+ |
AC_CHECK_LIB(m, cos) |
163 |
+ |
|
164 |
+ |
dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES) |
165 |
+ |
dnl AC_TRY_LINK uses main() but SDL needs main to take args, |
166 |
+ |
dnl therefore main is undefined with #undef. |
167 |
+ |
dnl Framework can be in an custom location. |
168 |
+ |
AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [ |
169 |
+ |
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1]) |
170 |
+ |
AC_CACHE_CHECK([whether compiler supports framework $1], |
171 |
+ |
ac_Framework, [ |
172 |
+ |
saved_LIBS="$LIBS" |
173 |
+ |
LIBS="$LIBS -framework $1" |
174 |
+ |
if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then |
175 |
+ |
if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then |
176 |
+ |
LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1" |
177 |
+ |
fi |
178 |
+ |
fi |
179 |
+ |
saved_CPPFLAGS="$CPPFLAGS" |
180 |
+ |
CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers" |
181 |
+ |
AC_TRY_LINK( |
182 |
+ |
[$2 |
183 |
+ |
#undef main], [], |
184 |
+ |
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); |
185 |
+ |
LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"] |
186 |
+ |
) |
187 |
+ |
]) |
188 |
+ |
AS_IF([test AS_VAR_GET(ac_Framework) = yes], |
189 |
+ |
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])] |
190 |
+ |
) |
191 |
+ |
AS_VAR_POPDEF([ac_Framework]) |
192 |
+ |
]) |
193 |
+ |
|
194 |
+ |
dnl Do we need SDL? |
195 |
+ |
WANT_SDL=no |
196 |
+ |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
197 |
+ |
WANT_SDL=yes |
198 |
+ |
WANT_XF86_DGA=no |
199 |
+ |
WANT_XF86_VIDMODE=no |
200 |
+ |
WANT_FBDEV_DGA=no |
201 |
+ |
SDL_SUPPORT="$SDL_SUPPORT video" |
202 |
+ |
fi |
203 |
+ |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
204 |
+ |
WANT_SDL=yes |
205 |
+ |
SDL_SUPPORT="$SDL_SUPPORT audio" |
206 |
+ |
fi |
207 |
+ |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
208 |
+ |
if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then |
209 |
+ |
AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>]) |
210 |
+ |
else |
211 |
+ |
ac_cv_framework_SDL=no |
212 |
+ |
fi |
213 |
+ |
if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then |
214 |
+ |
AC_PATH_PROG(sdl_config, "sdl-config") |
215 |
+ |
if [[ -n "$sdl_config" ]]; then |
216 |
+ |
case $target_os in |
217 |
+ |
# Special treatment for Cygwin so that we can still use the POSIX layer |
218 |
+ |
*cygwin*) |
219 |
+ |
sdl_cflags="-I`$sdl_config --prefix`/include/SDL" |
220 |
+ |
sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" |
221 |
+ |
;; |
222 |
+ |
*) |
223 |
+ |
sdl_cflags=`$sdl_config --cflags` |
224 |
+ |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
225 |
+ |
sdl_libs=`$sdl_config --static-libs` |
226 |
+ |
else |
227 |
+ |
sdl_libs=`$sdl_config --libs` |
228 |
+ |
fi |
229 |
+ |
;; |
230 |
+ |
esac |
231 |
+ |
CFLAGS="$CFLAGS $sdl_cflags" |
232 |
+ |
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
233 |
+ |
LIBS="$LIBS $sdl_libs" |
234 |
+ |
else |
235 |
+ |
WANT_SDL=no |
236 |
+ |
fi |
237 |
+ |
fi |
238 |
+ |
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"` |
239 |
+ |
else |
240 |
+ |
SDL_SUPPORT="none" |
241 |
+ |
fi |
242 |
+ |
|
243 |
+ |
dnl We need X11, if not using SDL. |
244 |
+ |
if [[ "x$WANT_SDL" = "xno" ]]; then |
245 |
+ |
AC_PATH_XTRA |
246 |
+ |
if [[ "x$no_x" = "xyes" ]]; then |
247 |
+ |
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
248 |
+ |
fi |
249 |
+ |
CFLAGS="$CFLAGS $X_CFLAGS" |
250 |
+ |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
251 |
+ |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
252 |
+ |
fi |
253 |
+ |
|
254 |
+ |
dnl BINCUE |
255 |
+ |
AS_IF([test "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no]) |
256 |
+ |
AS_IF([test "x$have_bincue" = "xyes" ], [ |
257 |
+ |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
258 |
+ |
DEFINES="$DEFINES -DBINCUE" |
259 |
+ |
else |
260 |
+ |
AC_MSG_ERROR([You need SDL Audio to use BINCUE support.]) |
261 |
+ |
fi |
262 |
+ |
]) |
263 |
|
|
119 |
– |
dnl We need X11. |
120 |
– |
AC_PATH_XTRA |
121 |
– |
if [[ "x$no_x" = "xyes" ]]; then |
122 |
– |
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
123 |
– |
fi |
124 |
– |
CFLAGS="$CFLAGS $X_CFLAGS" |
125 |
– |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
126 |
– |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
264 |
|
|
265 |
|
dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. |
266 |
|
HAVE_PTHREADS=yes |
274 |
|
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then |
275 |
|
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) |
276 |
|
fi |
277 |
< |
AC_CHECK_FUNCS(pthread_cancel) |
277 |
> |
AC_CHECK_FUNCS(pthread_cond_init) |
278 |
> |
AC_CHECK_FUNCS(pthread_cancel pthread_testcancel) |
279 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
280 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
281 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setpshared) |
319 |
|
|
320 |
|
dnl We use GTK+ if possible. |
321 |
|
UISRCS=../dummy/prefs_editor_dummy.cpp |
322 |
< |
if [[ "x$WANT_GTK" = "xyes" ]]; then |
322 |
> |
case "x$WANT_GTK" in |
323 |
> |
xgtk2*) |
324 |
> |
AM_PATH_GTK_2_0(1.3.15, [ |
325 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
326 |
> |
GUI_LIBS="$GTK_LIBS" |
327 |
> |
WANT_GTK=gtk2 |
328 |
> |
], [ |
329 |
> |
case "x${WANT_GTK}x" in |
330 |
> |
*gtkx) |
331 |
> |
AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.]) |
332 |
> |
WANT_GTK=gtk |
333 |
> |
;; |
334 |
> |
*) |
335 |
> |
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
336 |
> |
WANT_GTK=no |
337 |
> |
;; |
338 |
> |
esac |
339 |
> |
]) |
340 |
> |
;; |
341 |
> |
esac |
342 |
> |
if [[ "x$WANT_GTK" = "xgtk" ]]; then |
343 |
|
AM_PATH_GTK(1.2.0, [ |
344 |
< |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
345 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
188 |
< |
LIBS="$LIBS $GTK_LIBS" |
189 |
< |
UISRCS=prefs_editor_gtk.cpp |
344 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
345 |
> |
GUI_LIBS="$GTK_LIBS" |
346 |
|
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
347 |
|
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
348 |
|
dnl includes <libintl.h> |
349 |
|
AM_GNU_GETTEXT |
350 |
|
B2_PATH_GNOMEUI([ |
351 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
352 |
< |
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
353 |
< |
LIBS="$LIBS $GNOMEUI_LIBS" |
352 |
> |
GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS" |
353 |
> |
GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS" |
354 |
|
], []) |
355 |
|
], [ |
356 |
|
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
357 |
|
WANT_GTK=no |
358 |
|
]) |
359 |
|
fi |
360 |
+ |
if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then |
361 |
+ |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
362 |
+ |
UISRCS=prefs_editor_gtk.cpp |
363 |
+ |
fi |
364 |
+ |
AC_SUBST(GUI_CFLAGS) |
365 |
+ |
AC_SUBST(GUI_LIBS) |
366 |
+ |
|
367 |
+ |
dnl Build external GUI if requested. |
368 |
+ |
if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then |
369 |
+ |
WANT_STANDALONE_GUI=no |
370 |
+ |
fi |
371 |
+ |
if [[ "$WANT_GTK" = "no" ]]; then |
372 |
+ |
WANT_STANDALONE_GUI=no |
373 |
+ |
fi |
374 |
+ |
AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI]) |
375 |
|
|
376 |
|
dnl We use ESD if possible. |
377 |
|
if [[ "x$WANT_ESD" = "xyes" ]]; then |
391 |
|
|
392 |
|
dnl Checks for header files. |
393 |
|
AC_HEADER_STDC |
394 |
< |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h) |
394 |
> |
AC_CHECK_HEADERS(stdlib.h stdint.h) |
395 |
> |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h) |
396 |
> |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
397 |
> |
AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h) |
398 |
> |
AC_CHECK_HEADERS(sys/poll.h sys/select.h) |
399 |
> |
AC_CHECK_HEADERS(arpa/inet.h) |
400 |
> |
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [ |
401 |
> |
#ifdef HAVE_SYS_TYPES_H |
402 |
> |
#include <sys/types.h> |
403 |
> |
#endif |
404 |
> |
#ifdef HAVE_SYS_SOCKET_H |
405 |
> |
#include <sys/socket.h> |
406 |
> |
#endif |
407 |
> |
]) |
408 |
> |
AC_CHECK_HEADERS(AvailabilityMacros.h) |
409 |
> |
AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h) |
410 |
|
|
411 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
412 |
|
AC_C_BIGENDIAN |
421 |
|
AC_CHECK_SIZEOF(long double, 12) |
422 |
|
AC_CHECK_SIZEOF(void *, 4) |
423 |
|
AC_TYPE_OFF_T |
424 |
< |
AC_CHECK_TYPE(loff_t, off_t) |
425 |
< |
AC_CHECK_TYPE(caddr_t, [char *]) |
424 |
> |
AC_CHECK_TYPES(loff_t) |
425 |
> |
AC_CHECK_TYPES(caddr_t) |
426 |
|
AC_TYPE_SIZE_T |
427 |
|
AC_TYPE_SIGNAL |
428 |
|
AC_HEADER_TIME |
446 |
|
fi |
447 |
|
|
448 |
|
dnl Checks for library functions. |
449 |
< |
AC_CHECK_FUNCS(strdup cfmakeraw) |
449 |
> |
AC_CHECK_FUNCS(strdup strerror cfmakeraw) |
450 |
|
AC_CHECK_FUNCS(clock_gettime timer_create) |
451 |
|
AC_CHECK_FUNCS(sigaction signal) |
452 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
453 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
454 |
+ |
AC_CHECK_FUNCS(poll inet_aton) |
455 |
|
|
456 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
457 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
478 |
|
*-*-sco3.2v5*) |
479 |
|
no_dev_ptmx=1 |
480 |
|
;; |
481 |
+ |
*-*-cygwin*) |
482 |
+ |
no_dev_ptmx=1 |
483 |
+ |
;; |
484 |
+ |
*-*-darwin*) |
485 |
+ |
no_dev_ptmx=1 |
486 |
+ |
;; |
487 |
|
esac |
488 |
|
|
489 |
|
if test -z "$no_dev_ptmx" ; then |
502 |
|
have_dev_ptc=1 |
503 |
|
] |
504 |
|
) |
312 |
– |
|
505 |
|
dnl (end of code from openssh-3.2.2p1 configure.ac) |
506 |
|
|
507 |
+ |
dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK) |
508 |
+ |
dnl doesn't work or is unimplemented. On these systems (mostly older |
509 |
+ |
dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4] |
510 |
+ |
AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O], |
511 |
+ |
ac_cv_nonblocking_io, [ |
512 |
+ |
case "$host" in |
513 |
+ |
*-*-osf*) |
514 |
+ |
ac_cv_nonblocking_io=FIONBIO |
515 |
+ |
;; |
516 |
+ |
*-*-sunos4*) |
517 |
+ |
ac_cv_nonblocking_io=FIONBIO |
518 |
+ |
;; |
519 |
+ |
*-*-ultrix*) |
520 |
+ |
ac_cv_nonblocking_io=FIONBIO |
521 |
+ |
;; |
522 |
+ |
*) |
523 |
+ |
ac_cv_nonblocking_io=O_NONBLOCK |
524 |
+ |
;; |
525 |
+ |
esac |
526 |
+ |
]) |
527 |
+ |
if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then |
528 |
+ |
AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used]) |
529 |
+ |
fi |
530 |
+ |
|
531 |
+ |
dnl Check whether compiler supports byte bit-fields |
532 |
+ |
AC_CACHE_CHECK([whether compiler supports byte bit-fields], |
533 |
+ |
ac_cv_have_byte_bitfields, [ |
534 |
+ |
AC_LANG_SAVE |
535 |
+ |
AC_LANG_CPLUSPLUS |
536 |
+ |
AC_TRY_RUN([ |
537 |
+ |
struct A { |
538 |
+ |
unsigned char b1:4; |
539 |
+ |
unsigned char b2:4; |
540 |
+ |
unsigned char c; |
541 |
+ |
unsigned short s; |
542 |
+ |
unsigned char a[4]; |
543 |
+ |
}; |
544 |
+ |
|
545 |
+ |
int main(void) { |
546 |
+ |
A a; |
547 |
+ |
return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1)); |
548 |
+ |
}], |
549 |
+ |
[ac_cv_have_byte_bitfields=yes], |
550 |
+ |
[ac_cv_have_byte_bitfields=no], |
551 |
+ |
dnl When cross-compiling, assume only GCC supports this |
552 |
+ |
[if [[ "$GCC" = "yes" ]]; then |
553 |
+ |
ac_cv_have_byte_bitfields="guessing yes" |
554 |
+ |
else |
555 |
+ |
ac_cv_have_byte_bitfields="guessing no" |
556 |
+ |
fi] |
557 |
+ |
) |
558 |
+ |
AC_LANG_RESTORE |
559 |
+ |
]) |
560 |
+ |
|
561 |
+ |
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES) |
562 |
+ |
AC_DEFUN([AC_CHECK_FRAMEWORK], [ |
563 |
+ |
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl |
564 |
+ |
AC_CACHE_CHECK([whether compiler supports framework $1], |
565 |
+ |
ac_Framework, [ |
566 |
+ |
saved_LIBS="$LIBS" |
567 |
+ |
LIBS="$LIBS -framework $1" |
568 |
+ |
AC_TRY_LINK( |
569 |
+ |
[$2], [], |
570 |
+ |
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"] |
571 |
+ |
) |
572 |
+ |
]) |
573 |
+ |
AS_IF([test AS_VAR_GET(ac_Framework) = yes], |
574 |
+ |
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])] |
575 |
+ |
) |
576 |
+ |
AS_VAR_POPDEF([ac_Framework])dnl |
577 |
+ |
]) |
578 |
+ |
|
579 |
+ |
dnl Check for some MacOS X frameworks |
580 |
+ |
AC_CHECK_FRAMEWORK(AppKit, []) |
581 |
+ |
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
582 |
+ |
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
583 |
+ |
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>]) |
584 |
|
|
585 |
|
dnl Select system-dependant source files. |
586 |
|
SERIALSRC=serial_unix.cpp |
587 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
588 |
|
SCSISRC=../dummy/scsi_dummy.cpp |
589 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
590 |
+ |
EXTFSSRC=extfs_unix.cpp |
591 |
|
EXTRASYSSRCS= |
592 |
|
CAN_NATIVE_M68K=no |
593 |
|
case "$target_os" in |
621 |
|
;; |
622 |
|
netbsd*) |
623 |
|
CAN_NATIVE_M68K=yes |
624 |
+ |
ETHERSRC=ether_unix.cpp |
625 |
|
;; |
626 |
|
solaris*) |
627 |
|
AUDIOSRC=Solaris/audio_solaris.cpp |
628 |
|
DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS" |
629 |
|
;; |
630 |
|
irix*) |
360 |
– |
ETHERSRC=ether_unix.cpp |
631 |
|
AUDIOSRC=Irix/audio_irix.cpp |
632 |
|
EXTRASYSSRCS=Irix/unaligned.c |
363 |
– |
dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS" |
364 |
– |
DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS" |
633 |
|
LIBS="$LIBS -laudio" |
634 |
|
WANT_ESD=no |
635 |
|
|
639 |
|
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
640 |
|
AC_MSG_CHECKING(if "-IPA" works) |
641 |
|
dnl Do a test compile of an empty function |
642 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
642 |
> |
AC_TRY_COMPILE([#if defined __GNUC__ |
643 |
> |
# error GCC does not support IPA yet |
644 |
> |
#endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
645 |
|
CFLAGS="$ocflags" |
646 |
+ |
;; |
647 |
+ |
darwin*) |
648 |
+ |
ETHERSRC=ether_unix.cpp |
649 |
+ |
if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then |
650 |
+ |
EXTRASYSSRCS="../MacOSX/sys_darwin.cpp" |
651 |
+ |
fi |
652 |
+ |
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
653 |
+ |
EXTFSSRC=../MacOSX/extfs_macosx.cpp |
654 |
+ |
fi |
655 |
+ |
;; |
656 |
+ |
cygwin*) |
657 |
+ |
SERIALSRC="../dummy/serial_dummy.cpp" |
658 |
+ |
EXTRASYSSRCS="../Windows/BasiliskII.rc" |
659 |
+ |
;; |
660 |
+ |
esac |
661 |
|
|
662 |
+ |
dnl Is the slirp library supported? |
663 |
+ |
case "$ac_cv_have_byte_bitfields" in |
664 |
+ |
yes|"guessing yes") |
665 |
+ |
CAN_SLIRP=yes |
666 |
+ |
ETHERSRC=ether_unix.cpp |
667 |
|
;; |
668 |
|
esac |
669 |
+ |
if [[ -n "$CAN_SLIRP" ]]; then |
670 |
+ |
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported]) |
671 |
+ |
SLIRP_SRCS="\ |
672 |
+ |
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ |
673 |
+ |
../slirp/cksum.c ../slirp/mbuf.c ../slirp/tcp_output.c \ |
674 |
+ |
../slirp/debug.c ../slirp/misc.c ../slirp/tcp_subr.c \ |
675 |
+ |
../slirp/if.c ../slirp/sbuf.c ../slirp/tcp_timer.c \ |
676 |
+ |
../slirp/ip_icmp.c ../slirp/slirp.c ../slirp/tftp.c \ |
677 |
+ |
../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c" |
678 |
+ |
fi |
679 |
+ |
AC_SUBST(SLIRP_SRCS) |
680 |
+ |
|
681 |
+ |
dnl SDL overrides |
682 |
+ |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
683 |
+ |
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) |
684 |
+ |
if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then |
685 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m" |
686 |
+ |
fi |
687 |
+ |
fi |
688 |
+ |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
689 |
+ |
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support]) |
690 |
+ |
VIDEOSRCS="../SDL/video_sdl.cpp" |
691 |
+ |
KEYCODES="../SDL/keycodes" |
692 |
+ |
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
693 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" |
694 |
+ |
else |
695 |
+ |
case "$target_os" in |
696 |
+ |
cygwin*) |
697 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp" |
698 |
+ |
;; |
699 |
+ |
*) |
700 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
701 |
+ |
;; |
702 |
+ |
esac |
703 |
+ |
fi |
704 |
+ |
else |
705 |
+ |
VIDEOSRCS="video_x.cpp" |
706 |
+ |
KEYCODES="keycodes" |
707 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp" |
708 |
+ |
fi |
709 |
+ |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
710 |
+ |
AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support]) |
711 |
+ |
AUDIOSRC="../SDL/audio_sdl.cpp" |
712 |
+ |
fi |
713 |
+ |
|
714 |
+ |
dnl BINCUE overrides |
715 |
+ |
|
716 |
+ |
if [[ "x$have_bincue" = "xyes" ]]; then |
717 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp" |
718 |
+ |
fi |
719 |
|
|
720 |
|
dnl Use 68k CPU natively? |
721 |
|
WANT_NATIVE_M68K=no |
731 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
732 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
733 |
|
fi |
734 |
< |
SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
734 |
> |
SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
735 |
|
|
736 |
|
dnl Define a macro that translates a yesno-variable into a C macro definition |
737 |
|
dnl to be put into the config.h file |
738 |
|
dnl $1 -- the macro to define |
739 |
|
dnl $2 -- the value to translate |
740 |
|
dnl $3 -- template name |
741 |
< |
AC_DEFUN(AC_TRANSLATE_DEFINE, [ |
741 |
> |
AC_DEFUN([AC_TRANSLATE_DEFINE], [ |
742 |
|
if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then |
743 |
|
AC_DEFINE($1, 1, $3) |
744 |
|
fi |
745 |
|
]) |
746 |
|
|
747 |
+ |
dnl Check that the host supports TUN/TAP devices |
748 |
+ |
AC_CACHE_CHECK([whether TUN/TAP is supported], |
749 |
+ |
ac_cv_tun_tap_support, [ |
750 |
+ |
AC_TRY_COMPILE([ |
751 |
+ |
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H) |
752 |
+ |
#include <linux/if.h> |
753 |
+ |
#include <linux/if_tun.h> |
754 |
+ |
#endif |
755 |
+ |
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H) |
756 |
+ |
#include <net/if.h> |
757 |
+ |
#include <net/if_tun.h> |
758 |
+ |
#endif |
759 |
+ |
], [ |
760 |
+ |
struct ifreq ifr; |
761 |
+ |
memset(&ifr, 0, sizeof(ifr)); |
762 |
+ |
ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
763 |
+ |
], |
764 |
+ |
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no |
765 |
+ |
) |
766 |
+ |
]) |
767 |
+ |
AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support", |
768 |
+ |
[Define if your system supports TUN/TAP devices.]) |
769 |
+ |
|
770 |
|
dnl Various checks if the system supports vm_allocate() and the like functions. |
771 |
|
have_mach_vm=no |
772 |
|
if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \ |
913 |
|
|
914 |
|
fi dnl HAVE_MMAP_VM |
915 |
|
|
916 |
+ |
dnl Check if we can modify the __PAGEZERO segment for use as Low Memory |
917 |
+ |
AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000], |
918 |
+ |
ac_cv_pagezero_hack, [ |
919 |
+ |
ac_cv_pagezero_hack=no |
920 |
+ |
if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then |
921 |
+ |
ac_cv_pagezero_hack=yes |
922 |
+ |
dnl might as well skip the test for mmap-able low memory |
923 |
+ |
ac_cv_can_map_lm=no |
924 |
+ |
fi |
925 |
+ |
]) |
926 |
+ |
AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack", |
927 |
+ |
[Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.]) |
928 |
+ |
|
929 |
|
dnl Check if we can mmap 0x2000 bytes from 0x0000 |
930 |
|
AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000], |
931 |
|
ac_cv_can_map_lm, [ |
1010 |
|
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall", |
1011 |
|
[Define if your system requires sigactions to be reinstalled.]) |
1012 |
|
|
1013 |
< |
dnl Check if extended signals are supported. |
1014 |
< |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
1015 |
< |
ac_cv_have_extended_signals, [ |
1013 |
> |
dnl Check if Mach exceptions supported. |
1014 |
> |
AC_CACHE_CHECK([whether your system supports Mach exceptions], |
1015 |
> |
ac_cv_have_mach_exceptions, [ |
1016 |
|
AC_LANG_SAVE |
1017 |
|
AC_LANG_CPLUSPLUS |
1018 |
|
AC_TRY_RUN([ |
1019 |
< |
#define HAVE_SIGINFO_T 1 |
1019 |
> |
#define HAVE_UNISTD_H 1 |
1020 |
> |
#define HAVE_MACH_VM 1 |
1021 |
> |
#define HAVE_MACH_TASK_SELF 1 |
1022 |
> |
#define HAVE_MACH_EXCEPTIONS 1 |
1023 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
1024 |
|
#include "vm_alloc.cpp" |
1025 |
|
#include "sigsegv.cpp" |
1026 |
< |
], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no, |
1026 |
> |
], [ |
1027 |
> |
sigsegv_recovery=mach |
1028 |
> |
ac_cv_have_mach_exceptions=yes |
1029 |
> |
], |
1030 |
> |
ac_cv_have_mach_exceptions=no, |
1031 |
|
dnl When cross-compiling, do not assume anything. |
1032 |
< |
ac_cv_have_extended_signals=no |
1032 |
> |
ac_cv_have_mach_exceptions=no |
1033 |
|
) |
1034 |
|
AC_LANG_RESTORE |
1035 |
|
] |
1036 |
|
) |
1037 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
1038 |
< |
[Define if your system support extended signals.]) |
1037 |
> |
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
1038 |
> |
[Define if your system supports Mach exceptions.]) |
1039 |
> |
|
1040 |
> |
dnl Check if Windows exceptions are supported. |
1041 |
> |
AC_CACHE_CHECK([whether your system supports Windows exceptions], |
1042 |
> |
ac_cv_have_win32_exceptions, [ |
1043 |
> |
AC_LANG_SAVE |
1044 |
> |
AC_LANG_CPLUSPLUS |
1045 |
> |
AC_TRY_RUN([ |
1046 |
> |
#define HAVE_WIN32_EXCEPTIONS 1 |
1047 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
1048 |
> |
#include "vm_alloc.cpp" |
1049 |
> |
#include "sigsegv.cpp" |
1050 |
> |
], [ |
1051 |
> |
sigsegv_recovery=win32 |
1052 |
> |
ac_cv_have_win32_exceptions=yes |
1053 |
> |
], |
1054 |
> |
ac_cv_have_win32_exceptions=no, |
1055 |
> |
dnl When cross-compiling, do not assume anything. |
1056 |
> |
ac_cv_have_win32_exceptions=no |
1057 |
> |
) |
1058 |
> |
AC_LANG_RESTORE |
1059 |
> |
] |
1060 |
> |
) |
1061 |
> |
AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions", |
1062 |
> |
[Define if your system supports Windows exceptions.]) |
1063 |
> |
|
1064 |
> |
dnl Otherwise, check if extended signals are supported. |
1065 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
1066 |
> |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
1067 |
> |
ac_cv_have_extended_signals, [ |
1068 |
> |
AC_LANG_SAVE |
1069 |
> |
AC_LANG_CPLUSPLUS |
1070 |
> |
AC_TRY_RUN([ |
1071 |
> |
#define HAVE_SIGINFO_T 1 |
1072 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
1073 |
> |
#include "vm_alloc.cpp" |
1074 |
> |
#include "sigsegv.cpp" |
1075 |
> |
], [ |
1076 |
> |
sigsegv_recovery=siginfo |
1077 |
> |
ac_cv_have_extended_signals=yes |
1078 |
> |
], |
1079 |
> |
ac_cv_have_extended_signals=no, |
1080 |
> |
dnl When cross-compiling, do not assume anything. |
1081 |
> |
ac_cv_have_extended_signals=no |
1082 |
> |
) |
1083 |
> |
AC_LANG_RESTORE |
1084 |
> |
] |
1085 |
> |
) |
1086 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
1087 |
> |
[Define if your system support extended signals.]) |
1088 |
> |
fi |
1089 |
|
|
1090 |
|
dnl Otherwise, check for subterfuges. |
1091 |
< |
if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then |
1091 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
1092 |
|
AC_CACHE_CHECK([whether we then have a subterfuge for your system], |
1093 |
|
ac_cv_have_sigcontext_hack, [ |
1094 |
|
AC_LANG_SAVE |
1098 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
1099 |
|
#include "vm_alloc.cpp" |
1100 |
|
#include "sigsegv.cpp" |
1101 |
< |
], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no, |
1101 |
> |
], [ |
1102 |
> |
sigsegv_recovery=sigcontext |
1103 |
> |
ac_cv_have_sigcontext_hack=yes |
1104 |
> |
], |
1105 |
> |
ac_cv_have_sigcontext_hack=no, |
1106 |
|
dnl When cross-compiling, do not assume anything. |
1107 |
|
ac_cv_have_sigcontext_hack=no |
1108 |
|
) |
1134 |
|
|
1135 |
|
dnl Can we do Video on SEGV Signals ? |
1136 |
|
CAN_VOSF=no |
1137 |
< |
if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
1137 |
> |
if [[ -n "$sigsegv_recovery" ]]; then |
1138 |
|
CAN_VOSF=yes |
1139 |
|
fi |
1140 |
|
|
1141 |
+ |
dnl A dummy program that returns always true |
1142 |
+ |
AC_PATH_PROG([BLESS], "true") |
1143 |
+ |
|
1144 |
+ |
dnl Check for linker script support |
1145 |
+ |
case $target_os:$target_cpu in |
1146 |
+ |
linux*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1147 |
+ |
linux*:x86_64) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";; |
1148 |
+ |
linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";; |
1149 |
+ |
netbsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1150 |
+ |
freebsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";; |
1151 |
+ |
darwin*:*) LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";; |
1152 |
+ |
esac |
1153 |
+ |
if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then |
1154 |
+ |
AC_CACHE_CHECK([whether linker script is usable], |
1155 |
+ |
ac_cv_linker_script_works, [ |
1156 |
+ |
AC_LANG_SAVE |
1157 |
+ |
AC_LANG_CPLUSPLUS |
1158 |
+ |
saved_LDFLAGS="$LDFLAGS" |
1159 |
+ |
LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS" |
1160 |
+ |
AC_TRY_RUN( |
1161 |
+ |
[int main() {if ((char *)&main < (char *)0x70000000) return 1;}], |
1162 |
+ |
[ac_cv_linker_script_works=yes], |
1163 |
+ |
[ac_cv_linker_script_works=no], |
1164 |
+ |
dnl When cross-compiling, assume it works |
1165 |
+ |
[ac_cv_linker_script_works="guessing yes"] |
1166 |
+ |
) |
1167 |
+ |
AC_LANG_RESTORE |
1168 |
+ |
if [[ "$ac_cv_linker_script_works" = "no" ]]; then |
1169 |
+ |
LDFLAGS="$saved_LDFLAGS" |
1170 |
+ |
LINKER_SCRIPT_FLAGS="" |
1171 |
+ |
fi |
1172 |
+ |
]) |
1173 |
+ |
fi |
1174 |
+ |
AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works", |
1175 |
+ |
[Define if there is a linker script to relocate the executable above 0x70000000.]) |
1176 |
+ |
|
1177 |
|
dnl Determine the addressing mode to use |
1178 |
|
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
1179 |
|
ADDRESSING_MODE="real" |
1184 |
|
case $am in |
1185 |
|
real) |
1186 |
|
dnl Requires ability to mmap() Low Memory globals |
1187 |
< |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
1187 |
> |
if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then |
1188 |
|
continue |
1189 |
|
fi |
1190 |
< |
dnl Requires VOSF screen updates |
1190 |
> |
dnl Requires VOSF screen updates |
1191 |
|
if [[ "x$CAN_VOSF" = "xno" ]]; then |
1192 |
|
continue |
1193 |
|
fi |
1195 |
|
ADDRESSING_MODE="real" |
1196 |
|
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
1197 |
|
DEFINES="$DEFINES -DREAL_ADDRESSING" |
1198 |
+ |
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
1199 |
+ |
BLESS=Darwin/lowmem |
1200 |
+ |
LDFLAGS="$LDFLAGS -pagezero_size 0x2000" |
1201 |
+ |
fi |
1202 |
|
break |
1203 |
|
;; |
1204 |
|
direct) |
1251 |
|
dnl Check for GCC 2.7 or higher. |
1252 |
|
HAVE_GCC27=no |
1253 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
1254 |
< |
AC_EGREP_CPP(xyes, |
1255 |
< |
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
1256 |
< |
xyes |
1257 |
< |
#endif |
1258 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
1254 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5) |
1255 |
> |
# error gcc < 2.7 |
1256 |
> |
#endif |
1257 |
> |
]])], |
1258 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC27=yes], |
1259 |
> |
[AC_MSG_RESULT(no)]) |
1260 |
|
|
1261 |
|
dnl Check for GCC 3.0 or higher. |
1262 |
|
HAVE_GCC30=no |
1263 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
1264 |
< |
AC_EGREP_CPP(xyes, |
1265 |
< |
[#if __GNUC__ >= 3 |
1266 |
< |
xyes |
1267 |
< |
#endif |
1268 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1264 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3) |
1265 |
> |
# error gcc < 3 |
1266 |
> |
#endif |
1267 |
> |
]])], |
1268 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC30=yes], |
1269 |
> |
[AC_MSG_RESULT(no)]) |
1270 |
> |
|
1271 |
> |
dnl Check for ICC. |
1272 |
> |
AC_MSG_CHECKING(for ICC) |
1273 |
> |
HAVE_ICC=no |
1274 |
> |
if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then |
1275 |
> |
HAVE_ICC=yes |
1276 |
> |
fi |
1277 |
> |
AC_MSG_RESULT($HAVE_ICC) |
1278 |
|
|
1279 |
|
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher. |
1280 |
|
dnl Also set "-fno-exceptions" for C++ because exception handling requires |
1289 |
|
dnl Official: probably gcc-3.1 (mainline CVS) |
1290 |
|
dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk |
1291 |
|
dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1 |
1292 |
< |
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1292 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1293 |
|
SAVED_CXXFLAGS="$CXXFLAGS" |
1294 |
|
CXXFLAGS="$CXXFLAGS -fno-merge-constants" |
1295 |
|
AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [ |
1303 |
|
fi |
1304 |
|
fi |
1305 |
|
|
1306 |
+ |
dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4 |
1307 |
+ |
dnl However, there are some corner cases exposed on x86-64 |
1308 |
+ |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1309 |
+ |
SAVED_CXXFLAGS="$CXXFLAGS" |
1310 |
+ |
CXXFLAGS="$CXXFLAGS -fno-gcse-sm" |
1311 |
+ |
AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [ |
1312 |
+ |
AC_LANG_SAVE |
1313 |
+ |
AC_LANG_CPLUSPLUS |
1314 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no]) |
1315 |
+ |
AC_LANG_RESTORE |
1316 |
+ |
]) |
1317 |
+ |
if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then |
1318 |
+ |
CXXFLAGS="$SAVED_CXXFLAGS" |
1319 |
+ |
fi |
1320 |
+ |
fi |
1321 |
+ |
|
1322 |
+ |
dnl Add -fno-strict-aliasing for slirp sources |
1323 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1324 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1325 |
+ |
CFLAGS="$CFLAGS -fno-strict-aliasing" |
1326 |
+ |
AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing], |
1327 |
+ |
ac_cv_gcc_no_strict_aliasing, [ |
1328 |
+ |
AC_TRY_COMPILE([],[], |
1329 |
+ |
[ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")], |
1330 |
+ |
[ac_cv_gcc_no_strict_aliasing=no]) |
1331 |
+ |
]) |
1332 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1333 |
+ |
fi |
1334 |
+ |
|
1335 |
+ |
dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X) |
1336 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1337 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1338 |
+ |
CFLAGS="$CFLAGS -mdynamic-no-pic" |
1339 |
+ |
AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic], |
1340 |
+ |
ac_cv_gcc_mdynamic_no_pic, [ |
1341 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no]) |
1342 |
+ |
]) |
1343 |
+ |
if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then |
1344 |
+ |
CXXFLAGS="$CXXFLAGS -mdynamic-no-pic" |
1345 |
+ |
else |
1346 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1347 |
+ |
fi |
1348 |
+ |
fi |
1349 |
+ |
|
1350 |
|
dnl Select appropriate CPU source and REGPARAM define. |
1351 |
|
ASM_OPTIMIZATIONS=none |
1352 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
1371 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
1372 |
|
ASM_OPTIMIZATIONS="x86-64" |
1373 |
|
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
1374 |
+ |
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" |
1375 |
+ |
CAN_JIT=yes |
1376 |
|
fi |
1377 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
1378 |
|
dnl SPARC CPU |
1626 |
|
|
1627 |
|
dnl Remove the "-g" option if set for GCC. |
1628 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1629 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'` |
1630 |
< |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1629 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'` |
1630 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'` |
1631 |
|
fi |
1632 |
|
|
1633 |
|
dnl Or if we have -IPA (MIPSPro compilers) |
1643 |
|
AC_SUBST(SYSSRCS) |
1644 |
|
AC_SUBST(CPUINCLUDES) |
1645 |
|
AC_SUBST(CPUSRCS) |
1646 |
+ |
AC_SUBST(BLESS) |
1647 |
+ |
AC_SUBST(KEYCODES) |
1648 |
|
AC_CONFIG_FILES([Makefile]) |
1649 |
|
AC_OUTPUT |
1650 |
|
|
1652 |
|
echo |
1653 |
|
echo Basilisk II configuration summary: |
1654 |
|
echo |
1655 |
+ |
echo SDL support ............................ : $SDL_SUPPORT |
1656 |
+ |
echo BINCUE support ......................... : $have_bincue |
1657 |
|
echo XFree86 DGA support .................... : $WANT_XF86_DGA |
1658 |
|
echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE |
1659 |
|
echo fbdev DGA support ...................... : $WANT_FBDEV_DGA |
1667 |
|
echo Floating-Point emulation core .......... : $FPE_CORE |
1668 |
|
echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS |
1669 |
|
echo Addressing mode ........................ : $ADDRESSING_MODE |
1670 |
+ |
echo Bad memory access recovery type ........ : $sigsegv_recovery |
1671 |
|
echo |
1672 |
|
echo "Configuration done. Now type \"make\" (or \"gmake\")." |