25 |
|
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes]) |
26 |
|
AC_ARG_WITH(dgcc, [ --with-dgcc=COMPILER use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval]) |
27 |
|
|
28 |
+ |
dnl Addressing mode |
29 |
+ |
AC_ARG_ENABLE(addressing, |
30 |
+ |
[ --enable-addressing=AM set the addressing mode to use [default=real]], |
31 |
+ |
[case "$enableval" in |
32 |
+ |
real) WANT_ADDRESSING_MODE="real";; |
33 |
+ |
direct) WANT_ADDRESSING_MODE="direct";; |
34 |
+ |
direct,0x*) WANT_ADDRESSING_MODE="direct"; NATMEM_OFFSET=`echo "$enableval" | sed -n '/direct,\(0[[xX]][[0-9A-Fa-f]]*\)/s//\1/p'`;; |
35 |
+ |
esac], |
36 |
+ |
[WANT_ADDRESSING_MODE="real"] |
37 |
+ |
) |
38 |
+ |
|
39 |
|
dnl SDL options. |
40 |
|
AC_ARG_ENABLE(sdl-static, [ --enable-sdl-static use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no]) |
41 |
|
AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no]) |
769 |
|
WANT_VOSF=no |
770 |
|
fi |
771 |
|
|
772 |
+ |
dnl Check addressing mode to use |
773 |
+ |
AC_MSG_CHECKING([for addressing mode to use]) |
774 |
+ |
if [[ "$EMULATED_PPC" != "yes" ]]; then |
775 |
+ |
if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then |
776 |
+ |
AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.]) |
777 |
+ |
WANT_ADDRESSING_MODE="real" |
778 |
+ |
fi |
779 |
+ |
fi |
780 |
+ |
if [[ "$WANT_ADDRESSING_MODE" = "direct" ]]; then |
781 |
+ |
if [[ -n "$NATMEM_OFFSET" ]]; then |
782 |
+ |
NATMEM_OFFSET_DEF="-DNATMEM_OFFSET=$NATMEM_OFFSET" |
783 |
+ |
fi |
784 |
+ |
AC_LANG_SAVE |
785 |
+ |
AC_LANG_CPLUSPLUS |
786 |
+ |
cat confdefs.h > conftest.$ac_ext |
787 |
+ |
cat >> conftest.$ac_ext << EOF |
788 |
+ |
#include <stdio.h> |
789 |
+ |
#include <string.h> |
790 |
+ |
#include "vm_alloc.cpp" |
791 |
+ |
|
792 |
+ |
int main(void) |
793 |
+ |
{ |
794 |
+ |
if (vm_init() < 0) |
795 |
+ |
return 1; |
796 |
+ |
|
797 |
+ |
static const struct { |
798 |
+ |
unsigned long base; |
799 |
+ |
unsigned int size; |
800 |
+ |
} ranges[[]] = { |
801 |
+ |
{ 0x00000000, 0x0003000 }, |
802 |
+ |
{ 0x10000000, 0x2000000 }, |
803 |
+ |
{ 0x40800000, 0x0400000 }, |
804 |
+ |
{ 0x68070000, 0x0010000 }, |
805 |
+ |
{ 0x69000000, 0x0080000 }, |
806 |
+ |
{ 0x68ffe000, 0x0002000 }, |
807 |
+ |
{ 0x5fffe000, 0x0002000 }, |
808 |
+ |
{ 0x60000000, 0x0040000 }, |
809 |
+ |
}; |
810 |
+ |
const int n_ranges = sizeof(ranges)/ sizeof(ranges[[0]]); |
811 |
+ |
|
812 |
+ |
#ifdef NATMEM_OFFSET |
813 |
+ |
unsigned long ofs = NATMEM_OFFSET; |
814 |
+ |
#else |
815 |
+ |
for (unsigned long ofs = 0x10000000; ofs <= 0x90000000; ofs += 0x10000000) |
816 |
+ |
#endif |
817 |
+ |
for (int i = 0; i < n_ranges; i++) { |
818 |
+ |
char *m = (char *)(ranges[[i]].base + ofs); |
819 |
+ |
if (vm_acquire_fixed(m, ranges[[i]].size) != 0) |
820 |
+ |
break; |
821 |
+ |
memset(m, 0, ranges[[i]].size); |
822 |
+ |
vm_release(m, ranges[[i]].size); |
823 |
+ |
if (i == n_ranges - 1) { |
824 |
+ |
printf("0x%08x\n", ofs); |
825 |
+ |
return 0; |
826 |
+ |
} |
827 |
+ |
} |
828 |
+ |
|
829 |
+ |
vm_exit(); |
830 |
+ |
return 1; |
831 |
+ |
} |
832 |
+ |
EOF |
833 |
+ |
doit='$CXX conftest.$ac_ext -o conftest.$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS $NATMEM_OFFSET_DEF >& AS_MESSAGE_LOG_FD' |
834 |
+ |
if AC_TRY_EVAL(doit); then |
835 |
+ |
NATMEM_OFFSET=`./conftest.$ac_exeext` |
836 |
+ |
if [[ -z "$NATMEM_OFFSET" ]]; then |
837 |
+ |
AC_MSG_ERROR([could not determine a sensible NATMEM_OFFSET value]) |
838 |
+ |
else |
839 |
+ |
WANT_ADDRESSING_MODE="direct,$NATMEM_OFFSET" |
840 |
+ |
fi |
841 |
+ |
fi |
842 |
+ |
rm -f conftest* |
843 |
+ |
AC_LANG_RESTORE |
844 |
+ |
fi |
845 |
+ |
AC_MSG_RESULT($WANT_ADDRESSING_MODE) |
846 |
+ |
|
847 |
+ |
if [[ -z "$NATMEM_OFFSET" ]]; then |
848 |
+ |
NATMEM_OFFSET=0 |
849 |
+ |
fi |
850 |
+ |
AC_DEFINE_UNQUOTED(NATMEM_OFFSET, $NATMEM_OFFSET, |
851 |
+ |
[Define constant offset for Mac address translation]) |
852 |
+ |
|
853 |
|
dnl Platform specific binary postprocessor |
854 |
|
AC_PATH_PROG(BLESS, "true") |
855 |
|
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
883 |
|
fi |
884 |
|
AC_MSG_RESULT($HAVE_ICC) |
885 |
|
|
886 |
< |
# Test if the compiler can generate ELF objects |
886 |
> |
dnl Test if the compiler can generate ELF objects |
887 |
|
AC_CACHE_CHECK([whether the compiler can generate ELF objects], |
888 |
|
ac_cv_elf_objects, [ |
889 |
|
echo 'int i;' > conftest.$ac_ext |
1041 |
|
echo ESD sound support ................ : $WANT_ESD |
1042 |
|
echo GTK user interface ............... : $WANT_GTK |
1043 |
|
echo mon debugger support ............. : $WANT_MON |
1044 |
+ |
echo Addressing mode .................. : $WANT_ADDRESSING_MODE |
1045 |
|
echo Bad memory access recovery type .. : $sigsegv_recovery |
1046 |
|
echo |
1047 |
|
echo "Configuration done. Now type \"make\"." |