mirror of https://github.com/bochs-emu/Bochs
- check for sizeof int*
- check for snprintf, strtoull - check if empty structs allowed - check for hash_map.h - check for blank labels as in void main () { int x=2; label: } - if debugger, turn on disasm too
This commit is contained in:
parent
4534c19e9e
commit
76bbd83325
|
@ -262,6 +262,7 @@
|
|||
#define SIZEOF_UNSIGNED_INT 0
|
||||
#define SIZEOF_UNSIGNED_LONG 0
|
||||
#define SIZEOF_UNSIGNED_LONG_LONG 0
|
||||
#define SIZEOF_INT_P 0
|
||||
|
||||
#if BX_WITH_WIN32
|
||||
typedef unsigned char Bit8u;
|
||||
|
@ -327,6 +328,18 @@
|
|||
#endif // BX_WITH_WIN32
|
||||
|
||||
|
||||
// create an unsigned integer type that is the same size as a pointer.
|
||||
// You can typecast a pointer to a bx_pr_equiv_t without losing any
|
||||
// bits (and without getting the compiler excited). This is used in
|
||||
// the FPU emulation code, where pointers and integers are often
|
||||
// used interchangeably.
|
||||
#if SIZEOF_INT_P == 4
|
||||
typedef Bit32u bx_ptr_equiv_t;
|
||||
#elif SIZEOF_INT_P == 8
|
||||
typedef Bit64u bx_ptr_equiv_t;
|
||||
#else
|
||||
# error "could define bx_ptr_equiv_t to size of int*"
|
||||
#endif
|
||||
|
||||
|
||||
#if BX_WITH_MACOS == 0
|
||||
|
@ -389,6 +402,25 @@ typedef unsigned int Boolean;
|
|||
#define BX_SUPPORT_FPU 0
|
||||
|
||||
#define BX_HAVE_SELECT 0
|
||||
#define BX_HAVE_SNPRINTF 0
|
||||
#define BX_HAVE_STRTOULL 0
|
||||
|
||||
// set if your compiler does not permit an empty struct
|
||||
#define BX_NO_EMPTY_STRUCTS 0
|
||||
|
||||
// set if your compiler does not understand __attribute__ after a struct
|
||||
#define BX_NO_ATTRIBUTES 0
|
||||
#if BX_NO_ATTRIBUTES
|
||||
#define GCC_ATTRIBUTE(x) /* attribute not supported */
|
||||
#else
|
||||
#define GCC_ATTRIBUTE __attribute__
|
||||
#endif
|
||||
|
||||
// set if your compiler does not allow label at the end of a {} block
|
||||
#define BX_NO_BLANK_LABELS 0
|
||||
|
||||
// set if you don't have <hash_map.h>, used in debug/dbg_main.c
|
||||
#define BX_HAVE_HASH_MAP 0
|
||||
|
||||
// Support x86 hardware debugger registers and facilites.
|
||||
// These are the debug facilites offered by the x86 architecture,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -21,8 +21,44 @@ AC_CHECK_SIZEOF(unsigned short)
|
|||
AC_CHECK_SIZEOF(unsigned int)
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
AC_CHECK_SIZEOF(unsigned long long)
|
||||
AC_CHECK_SIZEOF(int *)
|
||||
AC_CHECK_FUNCS(select, AC_DEFINE(BX_HAVE_SELECT))
|
||||
AC_CHECK_FUNCS(snprintf, AC_DEFINE(BX_HAVE_SNPRINTF))
|
||||
AC_CHECK_FUNCS(strtoull, AC_DEFINE(BX_HAVE_STRTOULL))
|
||||
|
||||
AC_MSG_CHECKING(if compiler allows empty structs)
|
||||
AC_TRY_COMPILE([], [typedef struct { } junk;],
|
||||
AC_MSG_RESULT(yes),
|
||||
[
|
||||
AC_DEFINE(BX_NO_EMPTY_STRUCTS)
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(if compiler allows __attribute__)
|
||||
AC_TRY_COMPILE([], [typedef struct { } __attribute__ ((packed)) junk;],
|
||||
AC_MSG_RESULT(yes),
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_NO_ATTRIBUTES)
|
||||
])
|
||||
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_MSG_CHECKING(for hash_map.h)
|
||||
AC_TRY_COMPILE([#include <hash_map.h>], [],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(BX_HAVE_HASH_MAP)
|
||||
], AC_MSG_RESULT(no))
|
||||
|
||||
AC_MSG_CHECKING(if compiler allows blank labels)
|
||||
AC_TRY_COMPILE([], [ { label1: } ],
|
||||
AC_MSG_RESULT(yes),
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_NO_BLANK_LABELS)
|
||||
])
|
||||
AC_LANG_RESTORE
|
||||
|
||||
AC_MSG_CHECKING(for cpu level)
|
||||
AC_ARG_ENABLE(cpu-level,
|
||||
|
@ -214,15 +250,19 @@ AC_ARG_ENABLE(debugger,
|
|||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(BX_DEBUGGER, 1)
|
||||
DEBUGGER_VAR='$(DEBUGGER_LIB)'
|
||||
bx_debugger=1
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_DEBUGGER, 0)
|
||||
DEBUGGER_VAR=''
|
||||
fi],
|
||||
bx_debugger=0
|
||||
fi
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_DEBUGGER, 0)
|
||||
DEBUGGER_VAR=''
|
||||
bx_debugger=0
|
||||
]
|
||||
)
|
||||
AC_SUBST(DEBUGGER_VAR)
|
||||
|
@ -236,13 +276,23 @@ AC_ARG_ENABLE(disasm,
|
|||
DISASM_VAR='$(DISASM_LIB)'
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$bx_debugger" = 1; then
|
||||
echo "ERROR: debugger is enabled, so --enable-disasm is required"
|
||||
exit 1
|
||||
fi
|
||||
AC_DEFINE(BX_DISASM, 0)
|
||||
DISASM_VAR=''
|
||||
fi],
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_DISASM, 0)
|
||||
DISASM_VAR=''
|
||||
if test "$bx_debugger" = 1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(BX_DISASM, 1)
|
||||
DISASM_VAR='$(DISASM_LIB)'
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_DISASM, 0)
|
||||
DISASM_VAR=''
|
||||
fi
|
||||
]
|
||||
)
|
||||
AC_SUBST(DISASM_VAR)
|
||||
|
|
Loading…
Reference in New Issue