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]) |
120 |
|
if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then |
121 |
|
AC_MSG_RESULT(yes) |
122 |
|
AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".]) |
123 |
< |
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" |
123 |
> |
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" |
124 |
|
CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass" |
125 |
|
AC_CHECK_LIB(ncurses, tgetent, , |
126 |
< |
AC_CHECK_LIB(termcap, tgetent, , |
127 |
< |
AC_CHECK_LIB(termlib, tgetent, , |
128 |
< |
AC_CHECK_LIB(terminfo, tgetent, , |
129 |
< |
AC_CHECK_LIB(Hcurses, tgetent, , |
130 |
< |
AC_CHECK_LIB(curses, tgetent)))))) |
126 |
> |
[AC_CHECK_LIB(termcap, tgetent, , |
127 |
> |
[AC_CHECK_LIB(termlib, tgetent, , |
128 |
> |
[AC_CHECK_LIB(terminfo, tgetent, , |
129 |
> |
[AC_CHECK_LIB(Hcurses, tgetent, , |
130 |
> |
[AC_CHECK_LIB(curses, tgetent)])])])])]) |
131 |
|
AC_CHECK_LIB(readline, readline) |
132 |
|
else |
133 |
|
AC_MSG_RESULT(no) |
142 |
|
AC_CHECK_LIB(rt, shm_open) |
143 |
|
AC_CHECK_LIB(m, cos) |
144 |
|
|
145 |
+ |
dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES) |
146 |
+ |
dnl AC_TRY_LINK uses main() but SDL needs main to take args, |
147 |
+ |
dnl therefore main is undefined with #undef. |
148 |
+ |
dnl Framework can be in an custom location. |
149 |
+ |
AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [ |
150 |
+ |
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1]) |
151 |
+ |
AC_CACHE_CHECK([whether compiler supports framework $1], |
152 |
+ |
ac_Framework, [ |
153 |
+ |
saved_LIBS="$LIBS" |
154 |
+ |
LIBS="$LIBS -framework $1" |
155 |
+ |
if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then |
156 |
+ |
if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then |
157 |
+ |
LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1" |
158 |
+ |
fi |
159 |
+ |
fi |
160 |
+ |
saved_CPPFLAGS="$CPPFLAGS" |
161 |
+ |
CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers" |
162 |
+ |
AC_TRY_LINK( |
163 |
+ |
[$2 |
164 |
+ |
#undef main], [], |
165 |
+ |
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); |
166 |
+ |
LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"] |
167 |
+ |
) |
168 |
+ |
]) |
169 |
+ |
AS_IF([test AS_VAR_GET(ac_Framework) = yes], |
170 |
+ |
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])] |
171 |
+ |
) |
172 |
+ |
AS_VAR_POPDEF([ac_Framework]) |
173 |
+ |
]) |
174 |
+ |
|
175 |
|
dnl Do we need SDL? |
176 |
|
WANT_SDL=no |
177 |
|
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
186 |
|
SDL_SUPPORT="$SDL_SUPPORT audio" |
187 |
|
fi |
188 |
|
if [[ "x$WANT_SDL" = "xyes" ]]; then |
189 |
< |
AC_PATH_PROG(sdl_config, "sdl-config") |
190 |
< |
if [[ -n "$sdl_config" ]]; then |
157 |
< |
case $target_os in |
158 |
< |
# Special treatment for Cygwin so that we can still use the POSIX layer |
159 |
< |
*cygwin*) |
160 |
< |
sdl_cflags="-I`$sdl_config --prefix`/include/SDL" |
161 |
< |
sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" |
162 |
< |
;; |
163 |
< |
*) |
164 |
< |
sdl_cflags=`$sdl_config --cflags` |
165 |
< |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
166 |
< |
sdl_libs=`$sdl_config --static-libs` |
167 |
< |
else |
168 |
< |
sdl_libs=`$sdl_config --libs` |
169 |
< |
fi |
170 |
< |
;; |
171 |
< |
esac |
172 |
< |
CFLAGS="$CFLAGS $sdl_cflags" |
173 |
< |
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
174 |
< |
LIBS="$LIBS $sdl_libs" |
189 |
> |
if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then |
190 |
> |
AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>]) |
191 |
|
else |
192 |
< |
WANT_SDL=no |
192 |
> |
ac_cv_framework_SDL=no |
193 |
> |
fi |
194 |
> |
if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then |
195 |
> |
AC_PATH_PROG(sdl_config, "sdl-config") |
196 |
> |
if [[ -n "$sdl_config" ]]; then |
197 |
> |
case $target_os in |
198 |
> |
# Special treatment for Cygwin so that we can still use the POSIX layer |
199 |
> |
*cygwin*) |
200 |
> |
sdl_cflags="-I`$sdl_config --prefix`/include/SDL" |
201 |
> |
sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" |
202 |
> |
;; |
203 |
> |
*) |
204 |
> |
sdl_cflags=`$sdl_config --cflags` |
205 |
> |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
206 |
> |
sdl_libs=`$sdl_config --static-libs` |
207 |
> |
else |
208 |
> |
sdl_libs=`$sdl_config --libs` |
209 |
> |
fi |
210 |
> |
;; |
211 |
> |
esac |
212 |
> |
CFLAGS="$CFLAGS $sdl_cflags" |
213 |
> |
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
214 |
> |
LIBS="$LIBS $sdl_libs" |
215 |
> |
else |
216 |
> |
WANT_SDL=no |
217 |
> |
fi |
218 |
|
fi |
219 |
|
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"` |
220 |
|
else |
292 |
|
case "x$WANT_GTK" in |
293 |
|
xgtk2*) |
294 |
|
AM_PATH_GTK_2_0(1.3.15, [ |
295 |
< |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
296 |
< |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
256 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
257 |
< |
LIBS="$LIBS $GTK_LIBS" |
258 |
< |
UISRCS=prefs_editor_gtk.cpp |
295 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
296 |
> |
GUI_LIBS="$GTK_LIBS" |
297 |
|
WANT_GTK=gtk2 |
298 |
|
], [ |
299 |
|
case "x${WANT_GTK}x" in |
311 |
|
esac |
312 |
|
if [[ "x$WANT_GTK" = "xgtk" ]]; then |
313 |
|
AM_PATH_GTK(1.2.0, [ |
314 |
< |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
315 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
278 |
< |
LIBS="$LIBS $GTK_LIBS" |
279 |
< |
UISRCS=prefs_editor_gtk.cpp |
314 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
315 |
> |
GUI_LIBS="$GTK_LIBS" |
316 |
|
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
317 |
|
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
318 |
|
dnl includes <libintl.h> |
319 |
|
AM_GNU_GETTEXT |
320 |
|
B2_PATH_GNOMEUI([ |
321 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
322 |
< |
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
323 |
< |
LIBS="$LIBS $GNOMEUI_LIBS" |
322 |
> |
GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS" |
323 |
> |
GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS" |
324 |
|
], []) |
325 |
|
], [ |
326 |
|
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
327 |
|
WANT_GTK=no |
328 |
|
]) |
329 |
|
fi |
330 |
+ |
if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then |
331 |
+ |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
332 |
+ |
UISRCS=prefs_editor_gtk.cpp |
333 |
+ |
fi |
334 |
+ |
AC_SUBST(GUI_CFLAGS) |
335 |
+ |
AC_SUBST(GUI_LIBS) |
336 |
+ |
|
337 |
+ |
dnl Build external GUI if requested. |
338 |
+ |
if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then |
339 |
+ |
WANT_STANDALONE_GUI=no |
340 |
+ |
fi |
341 |
+ |
if [[ "$WANT_GTK" = "no" ]]; then |
342 |
+ |
WANT_STANDALONE_GUI=no |
343 |
+ |
fi |
344 |
+ |
AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI]) |
345 |
|
|
346 |
|
dnl We use ESD if possible. |
347 |
|
if [[ "x$WANT_ESD" = "xyes" ]]; then |
451 |
|
*-*-cygwin*) |
452 |
|
no_dev_ptmx=1 |
453 |
|
;; |
454 |
+ |
*-*-darwin*) |
455 |
+ |
no_dev_ptmx=1 |
456 |
+ |
;; |
457 |
|
esac |
458 |
|
|
459 |
|
if test -z "$no_dev_ptmx" ; then |
472 |
|
have_dev_ptc=1 |
473 |
|
] |
474 |
|
) |
421 |
– |
|
475 |
|
dnl (end of code from openssh-3.2.2p1 configure.ac) |
476 |
|
|
424 |
– |
|
477 |
|
dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK) |
478 |
|
dnl doesn't work or is unimplemented. On these systems (mostly older |
479 |
|
dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4] |
620 |
|
EXTRASYSSRCS="../MacOSX/sys_darwin.cpp" |
621 |
|
fi |
622 |
|
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
623 |
< |
EXTFSSRC=../MacOSX/extfs_macosx.mm |
623 |
> |
EXTFSSRC=../MacOSX/extfs_macosx.cpp |
624 |
|
fi |
625 |
|
;; |
626 |
|
cygwin*) |
651 |
|
dnl SDL overrides |
652 |
|
if [[ "x$WANT_SDL" = "xyes" ]]; then |
653 |
|
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) |
654 |
+ |
if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then |
655 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m" |
656 |
+ |
fi |
657 |
|
fi |
658 |
|
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
659 |
|
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support]) |
913 |
|
] |
914 |
|
) |
915 |
|
|
861 |
– |
dnl Check if we have POSIX shared memory support |
862 |
– |
AC_CACHE_CHECK([whether POSIX shared memory is working], |
863 |
– |
ac_cv_have_posix_shm, [ |
864 |
– |
AC_LANG_SAVE |
865 |
– |
AC_LANG_CPLUSPLUS |
866 |
– |
AC_TRY_RUN([ |
867 |
– |
#define HAVE_POSIX_SHM |
868 |
– |
#include "vm_alloc.cpp" |
869 |
– |
int main(void) { /* returns 0 if we have working POSIX shm */ |
870 |
– |
if (vm_init() < 0) exit(2); |
871 |
– |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
872 |
– |
if (m1 == VM_MAP_FAILED) exit(3); |
873 |
– |
vm_exit(); exit(0); |
874 |
– |
} |
875 |
– |
], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no, |
876 |
– |
dnl When cross-compiling, do not assume anything. |
877 |
– |
ac_cv_have_posix_shm="guessing no" |
878 |
– |
) |
879 |
– |
AC_LANG_RESTORE |
880 |
– |
] |
881 |
– |
) |
882 |
– |
AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm", |
883 |
– |
[Define if your system supports POSIX shared memory.]) |
884 |
– |
|
885 |
– |
dnl Check if we have working 33-bit memory addressing |
886 |
– |
AC_CACHE_CHECK([whether 33-bit memory addressing is working], |
887 |
– |
ac_cv_have_33bit_addressing, [ |
888 |
– |
AC_LANG_SAVE |
889 |
– |
AC_LANG_CPLUSPLUS |
890 |
– |
AC_TRY_RUN([ |
891 |
– |
#define USE_33BIT_ADDRESSING 1 |
892 |
– |
#include "vm_alloc.cpp" |
893 |
– |
int main(void) { /* returns 0 if we have working 33-bit addressing */ |
894 |
– |
if (sizeof(void *) < 8) exit(1); |
895 |
– |
if (vm_init() < 0) exit(2); |
896 |
– |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
897 |
– |
if (m1 == VM_MAP_FAILED) exit(3); |
898 |
– |
char *m2 = m1 + (1L << 32); |
899 |
– |
m1[0] = 0x12; if (m2[0] != 0x12) exit(4); |
900 |
– |
m2[0] = 0x34; if (m1[0] != 0x34) exit(5); |
901 |
– |
vm_exit(); exit(0); |
902 |
– |
} |
903 |
– |
], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no, |
904 |
– |
dnl When cross-compiling, do not assume anything. |
905 |
– |
ac_cv_have_33bit_addressing="guessing no" |
906 |
– |
) |
907 |
– |
AC_LANG_RESTORE |
908 |
– |
] |
909 |
– |
) |
910 |
– |
|
916 |
|
dnl Check signal handlers need to be reinstalled |
917 |
|
AC_CACHE_CHECK([whether signal handlers need to be reinstalled], |
918 |
|
ac_cv_signal_need_reinstall, [ |
980 |
|
AC_LANG_SAVE |
981 |
|
AC_LANG_CPLUSPLUS |
982 |
|
AC_TRY_RUN([ |
983 |
+ |
#define HAVE_UNISTD_H 1 |
984 |
+ |
#define HAVE_MACH_VM 1 |
985 |
+ |
#define HAVE_MACH_TASK_SELF 1 |
986 |
|
#define HAVE_MACH_EXCEPTIONS 1 |
987 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
988 |
|
#include "vm_alloc.cpp" |
1337 |
|
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
1338 |
|
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" |
1339 |
|
CAN_JIT=yes |
1332 |
– |
WANT_33BIT_ADDRESSING=yes |
1340 |
|
fi |
1341 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
1342 |
|
dnl SPARC CPU |
1393 |
|
JITSRCS="" |
1394 |
|
fi |
1395 |
|
|
1389 |
– |
dnl Use 33-bit memory addressing? |
1390 |
– |
if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then |
1391 |
– |
use_33bit_addressing=yes |
1392 |
– |
fi |
1393 |
– |
AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing", |
1394 |
– |
[Define to use 33-bit memory addressing on 64-bit JIT capable systems.]) |
1395 |
– |
|
1396 |
|
dnl Utility macro used by next two tests. |
1397 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
1398 |
|
dnl commands examining object file, |