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]) |
118 |
|
if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then |
119 |
|
AC_MSG_RESULT(yes) |
120 |
|
AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".]) |
121 |
< |
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" |
121 |
> |
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" |
122 |
|
CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass" |
123 |
|
AC_CHECK_LIB(ncurses, tgetent, , |
124 |
|
AC_CHECK_LIB(termcap, tgetent, , |
253 |
|
case "x$WANT_GTK" in |
254 |
|
xgtk2*) |
255 |
|
AM_PATH_GTK_2_0(1.3.15, [ |
256 |
< |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
257 |
< |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
256 |
< |
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
257 |
< |
LIBS="$LIBS $GTK_LIBS" |
258 |
< |
UISRCS=prefs_editor_gtk.cpp |
256 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
257 |
> |
GUI_LIBS="$GTK_LIBS" |
258 |
|
WANT_GTK=gtk2 |
259 |
|
], [ |
260 |
|
case "x${WANT_GTK}x" in |
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" |
278 |
< |
LIBS="$LIBS $GTK_LIBS" |
279 |
< |
UISRCS=prefs_editor_gtk.cpp |
275 |
> |
GUI_CFLAGS="$GTK_CFLAGS" |
276 |
> |
GUI_LIBS="$GTK_LIBS" |
277 |
|
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
278 |
|
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
279 |
|
dnl includes <libintl.h> |
280 |
|
AM_GNU_GETTEXT |
281 |
|
B2_PATH_GNOMEUI([ |
282 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
283 |
< |
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
284 |
< |
LIBS="$LIBS $GNOMEUI_LIBS" |
283 |
> |
GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS" |
284 |
> |
GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS" |
285 |
|
], []) |
286 |
|
], [ |
287 |
|
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
288 |
|
WANT_GTK=no |
289 |
|
]) |
290 |
|
fi |
291 |
+ |
if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then |
292 |
+ |
AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.]) |
293 |
+ |
UISRCS=prefs_editor_gtk.cpp |
294 |
+ |
fi |
295 |
+ |
AC_SUBST(GUI_CFLAGS) |
296 |
+ |
AC_SUBST(GUI_LIBS) |
297 |
+ |
|
298 |
+ |
dnl Build external GUI if requested. |
299 |
+ |
if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then |
300 |
+ |
WANT_STANDALONE_GUI=no |
301 |
+ |
fi |
302 |
+ |
if [[ "$WANT_GTK" = "no" ]]; then |
303 |
+ |
WANT_STANDALONE_GUI=no |
304 |
+ |
fi |
305 |
+ |
AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI]) |
306 |
|
|
307 |
|
dnl We use ESD if possible. |
308 |
|
if [[ "x$WANT_ESD" = "xyes" ]]; then |
507 |
|
]) |
508 |
|
|
509 |
|
dnl Check for some MacOS X frameworks |
510 |
+ |
AC_CHECK_FRAMEWORK(AppKit, []) |
511 |
|
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
512 |
|
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
513 |
|
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>]) |
870 |
|
] |
871 |
|
) |
872 |
|
|
860 |
– |
dnl Check if we have POSIX shared memory support |
861 |
– |
AC_CACHE_CHECK([whether POSIX shared memory is working], |
862 |
– |
ac_cv_have_posix_shm, [ |
863 |
– |
AC_LANG_SAVE |
864 |
– |
AC_LANG_CPLUSPLUS |
865 |
– |
AC_TRY_RUN([ |
866 |
– |
#define HAVE_POSIX_SHM |
867 |
– |
#include "vm_alloc.cpp" |
868 |
– |
int main(void) { /* returns 0 if we have working POSIX shm */ |
869 |
– |
if (vm_init() < 0) exit(2); |
870 |
– |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
871 |
– |
if (m1 == VM_MAP_FAILED) exit(3); |
872 |
– |
vm_exit(); exit(0); |
873 |
– |
} |
874 |
– |
], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no, |
875 |
– |
dnl When cross-compiling, do not assume anything. |
876 |
– |
ac_cv_have_posix_shm="guessing no" |
877 |
– |
) |
878 |
– |
AC_LANG_RESTORE |
879 |
– |
] |
880 |
– |
) |
881 |
– |
AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm", |
882 |
– |
[Define if your system supports POSIX shared memory.]) |
883 |
– |
|
884 |
– |
dnl Check if we have working 33-bit memory addressing |
885 |
– |
AC_CACHE_CHECK([whether 33-bit memory addressing is working], |
886 |
– |
ac_cv_have_33bit_addressing, [ |
887 |
– |
AC_LANG_SAVE |
888 |
– |
AC_LANG_CPLUSPLUS |
889 |
– |
AC_TRY_RUN([ |
890 |
– |
#define USE_33BIT_ADDRESSING 1 |
891 |
– |
#include "vm_alloc.cpp" |
892 |
– |
int main(void) { /* returns 0 if we have working 33-bit addressing */ |
893 |
– |
if (sizeof(void *) < 8) exit(1); |
894 |
– |
if (vm_init() < 0) exit(2); |
895 |
– |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
896 |
– |
if (m1 == VM_MAP_FAILED) exit(3); |
897 |
– |
char *m2 = m1 + (1L << 32); |
898 |
– |
m1[0] = 0x12; if (m2[0] != 0x12) exit(4); |
899 |
– |
m2[0] = 0x34; if (m1[0] != 0x34) exit(5); |
900 |
– |
vm_exit(); exit(0); |
901 |
– |
} |
902 |
– |
], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no, |
903 |
– |
dnl When cross-compiling, do not assume anything. |
904 |
– |
ac_cv_have_33bit_addressing="guessing no" |
905 |
– |
) |
906 |
– |
AC_LANG_RESTORE |
907 |
– |
] |
908 |
– |
) |
909 |
– |
|
873 |
|
dnl Check signal handlers need to be reinstalled |
874 |
|
AC_CACHE_CHECK([whether signal handlers need to be reinstalled], |
875 |
|
ac_cv_signal_need_reinstall, [ |
1063 |
|
case $target_os:$target_cpu in |
1064 |
|
linux*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1065 |
|
linux*:x86_64) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";; |
1066 |
< |
darwin*:powerpc)LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";; |
1066 |
> |
linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";; |
1067 |
> |
netbsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; |
1068 |
> |
freebsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";; |
1069 |
> |
darwin*:*) LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";; |
1070 |
|
esac |
1071 |
|
if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then |
1072 |
|
AC_CACHE_CHECK([whether linker script is usable], |
1291 |
|
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
1292 |
|
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" |
1293 |
|
CAN_JIT=yes |
1328 |
– |
WANT_33BIT_ADDRESSING=yes |
1294 |
|
fi |
1295 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
1296 |
|
dnl SPARC CPU |
1347 |
|
JITSRCS="" |
1348 |
|
fi |
1349 |
|
|
1385 |
– |
dnl Use 33-bit memory addressing? |
1386 |
– |
if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then |
1387 |
– |
use_33bit_addressing=yes |
1388 |
– |
fi |
1389 |
– |
AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing", |
1390 |
– |
[Define to use 33-bit memory addressing on 64-bit JIT capable systems.]) |
1391 |
– |
|
1350 |
|
dnl Utility macro used by next two tests. |
1351 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
1352 |
|
dnl commands examining object file, |