d2203e662f
handling part, so I need to figure out how control-C's and control-Z's will get mapped into keystrokes.
744 lines
18 KiB
Plaintext
744 lines
18 KiB
Plaintext
dnl // Process this file with autoconf to produce a configure script.
|
|
|
|
AC_PREREQ(2.4)
|
|
AC_INIT(bochs.h)
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
changequote(<<, >>)
|
|
changequote([, ])
|
|
|
|
AC_PROG_CC
|
|
AC_PROG_CXX
|
|
AC_PROG_MAKE_SET
|
|
AC_PROG_RANLIB
|
|
|
|
AC_PATH_XTRA
|
|
|
|
AC_C_BIGENDIAN
|
|
AC_C_INLINE
|
|
AC_CHECK_SIZEOF(unsigned char)
|
|
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_CHECK_FUNCS(strdup, AC_DEFINE(BX_HAVE_STRDUP))
|
|
|
|
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(if compiler allows LL for 64-bit constants)
|
|
AC_TRY_COMPILE([], [ { 42LL; } ],
|
|
AC_MSG_RESULT(yes),
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_64BIT_CONSTANTS_USE_LL, 0)
|
|
])
|
|
AC_LANG_RESTORE
|
|
|
|
AC_MSG_CHECKING(for cpu level)
|
|
AC_ARG_ENABLE(cpu-level,
|
|
[ --enable-cpu-level select cpu level (3,4,5)],
|
|
[case "$enableval" in
|
|
3)
|
|
AC_MSG_RESULT(3)
|
|
AC_DEFINE(BX_CPU_LEVEL, 3)
|
|
AC_DEFINE(BX_CPU_LEVEL_HACKED, 3)
|
|
;;
|
|
4)
|
|
AC_MSG_RESULT(4)
|
|
AC_DEFINE(BX_CPU_LEVEL, 4)
|
|
AC_DEFINE(BX_CPU_LEVEL_HACKED, 4)
|
|
;;
|
|
5)
|
|
AC_MSG_RESULT(5)
|
|
AC_DEFINE(BX_CPU_LEVEL, 5)
|
|
AC_DEFINE(BX_CPU_LEVEL_HACKED, 5)
|
|
;;
|
|
*)
|
|
echo " "
|
|
echo "ERROR: you must supply a valid CPU level to --enable-cpu-level"
|
|
exit 1
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
AC_MSG_RESULT(5)
|
|
AC_DEFINE(BX_CPU_LEVEL, 5)
|
|
AC_DEFINE(BX_CPU_LEVEL_HACKED, 5)
|
|
]
|
|
)
|
|
|
|
|
|
AC_MSG_CHECKING(for dynamic translation support)
|
|
AC_ARG_ENABLE(dynamic,
|
|
[ --enable-dynamic enable dynamic translation support],
|
|
[if test "$enableval" = no; then
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_DYNAMIC_TRANSLATION, 0)
|
|
DYNAMIC_VAR=''
|
|
AS_DYNAMIC_OBJS=''
|
|
AS_DYNAMIC_INCS=''
|
|
else
|
|
if test "$enableval" = yes; then
|
|
echo " "
|
|
echo \!\!\!Error\!\!\!
|
|
echo "You must specify a CPU type to dynamic-translation option"
|
|
echo \!\!\!Error\!\!\!
|
|
exit 1
|
|
fi
|
|
case "$enableval" in
|
|
i386)
|
|
AC_DEFINE(BX_DYNAMIC_CPU_I386, 1)
|
|
AS_DYNAMIC_OBJS='$(X86_OBJS)'
|
|
AS_DYNAMIC_INCS='$(X86_H)'
|
|
;;
|
|
sparc)
|
|
AC_DEFINE(BX_DYNAMIC_CPU_SPARC, 1)
|
|
AS_DYNAMIC_OBJS='$(SPARC_OBJS).o'
|
|
AS_DYNAMIC_INCS='$(SPARC_H)'
|
|
;;
|
|
*)
|
|
echo " "
|
|
echo \!\!\!Error\!\!\!
|
|
echo "Sorry, dynamic translation is not yet available on your platform"
|
|
echo \!\!\!Error\!\!\!
|
|
AS_DYNAMIC_OBJS=''
|
|
AS_DYNAMIC_INCS=''
|
|
exit 1 ;;
|
|
esac
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_DYNAMIC_TRANSLATION, 1)
|
|
DYNAMIC_VAR='$(DYNAMIC_LIB)'
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_DYNAMIC_TRANSLATION, 0)
|
|
DYNAMIC_VAR=''
|
|
AS_DYNAMIC_OBJS=''
|
|
AS_DYNAMIC_INCS=''
|
|
]
|
|
)
|
|
AC_SUBST(DYNAMIC_VAR)
|
|
AC_SUBST(AS_DYNAMIC_OBJS)
|
|
AC_SUBST(AS_DYNAMIC_INCS)
|
|
|
|
AC_MSG_CHECKING(for split hard disk image support)
|
|
AC_ARG_ENABLE(split-hd,
|
|
[ --enable-split-hd allows split hard disk image],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_SPLIT_HD_SUPPORT, 1)
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_SPLIT_HD_SUPPORT, 0)
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_SPLIT_HD_SUPPORT, 0)
|
|
]
|
|
)
|
|
AC_SUBST(BX_SPLIT_HD_SUPPORT)
|
|
|
|
AC_MSG_CHECKING(for NE2000 support)
|
|
AC_ARG_ENABLE(ne2000,
|
|
[ --enable-ne2000 enable limited ne2000 support],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_NE2K_SUPPORT, 1)
|
|
NE2K_OBJS='ne2k.o eth.o eth_fbsd.o eth_null.o'
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_NE2K_SUPPORT, 0)
|
|
NE2K_OBJS=''
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_NE2K_SUPPORT, 0)
|
|
NE2K_OBJS=''
|
|
]
|
|
)
|
|
AC_SUBST(NE2K_OBJS)
|
|
|
|
|
|
AC_MSG_CHECKING(for i440FX PCI support)
|
|
AC_ARG_ENABLE(pci,
|
|
[ --enable-pci enable limited i440FX PCI support],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_PCI_SUPPORT, 1)
|
|
PCI_OBJ='pci.o'
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_PCI_SUPPORT, 0)
|
|
PCI_OBJ=''
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_PCI_SUPPORT, 0)
|
|
PCI_OBJ=''
|
|
]
|
|
)
|
|
AC_SUBST(PCI_OBJ)
|
|
|
|
|
|
AC_MSG_CHECKING(for port e9 hack)
|
|
AC_ARG_ENABLE(port-e9-hack,
|
|
[ --enable-port-e9-hack writes to port e9 go to console],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_PORT_E9_HACK, 1)
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_PORT_E9_HACK, 0)
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_PORT_E9_HACK, 0)
|
|
]
|
|
)
|
|
|
|
|
|
AC_MSG_CHECKING(for use of .cpp as suffix)
|
|
AC_ARG_ENABLE(cpp,
|
|
[ --enable-cpp use .cpp as C++ suffix],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
SUFFIX_LINE='.SUFFIXES: .cpp'
|
|
CPP_SUFFIX='cpp'
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
SUFFIX_LINE='.SUFFIXES: .cc'
|
|
CPP_SUFFIX='cc'
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
SUFFIX_LINE='.SUFFIXES: .cc'
|
|
CPP_SUFFIX='cc'
|
|
]
|
|
)
|
|
AC_SUBST(SUFFIX_LINE)
|
|
AC_SUBST(CPP_SUFFIX)
|
|
|
|
if test "$enable_cpp" = yes; then
|
|
echo "moving .cc source files to .cpp"
|
|
sourcefiles=`find . -name "*.cc" -print`
|
|
if test "$sourcefiles" != ""; then
|
|
for ccname in $sourcefiles
|
|
do
|
|
cppname=`echo $ccname | sed -e "s/\.cc$/.cpp/"`
|
|
echo "mv $ccname $cppname"
|
|
mv $ccname $cppname
|
|
done
|
|
else
|
|
echo "no more .cc source files to rename"
|
|
fi
|
|
fi
|
|
|
|
|
|
AC_MSG_CHECKING(for Bochs internal debugger support)
|
|
AC_ARG_ENABLE(debugger,
|
|
[ --enable-debugger compile in support for Bochs internal debugger],
|
|
[if test "$enableval" = yes; then
|
|
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=''
|
|
bx_debugger=0
|
|
fi
|
|
],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_DEBUGGER, 0)
|
|
DEBUGGER_VAR=''
|
|
bx_debugger=0
|
|
]
|
|
)
|
|
AC_SUBST(DEBUGGER_VAR)
|
|
|
|
AC_MSG_CHECKING(for disassembler support)
|
|
AC_ARG_ENABLE(disasm,
|
|
[ --enable-disasm compile in support for disassembler],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_DISASM, 1)
|
|
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],
|
|
[
|
|
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)
|
|
|
|
AC_MSG_CHECKING(for loader support)
|
|
AC_ARG_ENABLE(loader,
|
|
[ --enable-loader support calling external loader from debugger],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_USE_LOADER, 1)
|
|
BX_LOADER_OBJS='bx_loader.o loader.o'
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_USE_LOADER, 0)
|
|
BX_LOADER_OBJS=''
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_USE_LOADER, 0)
|
|
BX_LOADER_OBJS=''
|
|
]
|
|
)
|
|
AC_SUBST(BX_LOADER_OBJS)
|
|
|
|
|
|
|
|
INSTRUMENT_DIR='instrument/stubs'
|
|
|
|
AC_MSG_CHECKING(for instrumentation support)
|
|
AC_ARG_ENABLE(instrumentation,
|
|
[ --enable-instrumentation compile in support for instrumentation],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_INSTRUMENTATION, 1)
|
|
INSTRUMENT_VAR='$(INSTRUMENT_LIB)'
|
|
elif test "$enableval" = no; then
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_INSTRUMENTATION, 0)
|
|
INSTRUMENT_VAR=''
|
|
else
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_INSTRUMENTATION, 1)
|
|
INSTRUMENT_DIR=$enableval
|
|
INSTRUMENT_VAR='$(INSTRUMENT_LIB)'
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_INSTRUMENTATION, 0)
|
|
INSTRUMENT_VAR=''
|
|
]
|
|
)
|
|
AC_SUBST(INSTRUMENT_DIR)
|
|
AC_SUBST(INSTRUMENT_VAR)
|
|
|
|
AC_ARG_ENABLE(simid,
|
|
[ --enable-simid=0 or 1 CPU simulator ID if using more than one],
|
|
[if test "$enableval" = yes; then
|
|
AC_DEFINE(BX_SIM_ID, 0)
|
|
elif test "$enableval" = no; then
|
|
AC_DEFINE(BX_SIM_ID, 0)
|
|
else
|
|
AC_DEFINE_UNQUOTED(BX_SIM_ID, $enableval)
|
|
fi],
|
|
[
|
|
AC_DEFINE(BX_SIM_ID, 0)
|
|
]
|
|
)
|
|
|
|
AC_ARG_ENABLE(num-sim,
|
|
[ --enable-num-sim=1 or 2 number of CPU simulators],
|
|
[if test "$enableval" = yes; then
|
|
AC_DEFINE(BX_NUM_SIMULATORS, 1)
|
|
elif test "$enableval" = no; then
|
|
AC_DEFINE(BX_NUM_SIMULATORS, 1)
|
|
else
|
|
AC_DEFINE_UNQUOTED(BX_NUM_SIMULATORS, $enableval)
|
|
fi],
|
|
[
|
|
AC_DEFINE(BX_NUM_SIMULATORS, 1)
|
|
]
|
|
)
|
|
|
|
AC_ARG_ENABLE(time0,
|
|
[ --enable-time0=n start at n instead of using time()],
|
|
[if test "$enableval" = yes; then
|
|
AC_DEFINE(BX_USE_SPECIFIED_TIME0, 917385580)
|
|
elif test "$enableval" = no; then
|
|
AC_DEFINE(BX_USE_SPECIFIED_TIME0, 0)
|
|
else
|
|
AC_DEFINE_UNQUOTED(BX_USE_SPECIFIED_TIME0, $enableval)
|
|
fi],
|
|
[
|
|
AC_DEFINE(BX_USE_SPECIFIED_TIME0, 0)
|
|
]
|
|
)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for VGA emulation)
|
|
AC_ARG_ENABLE(vga,
|
|
[ --enable-vga use VGA emulation],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_SUPPORT_VGA, 1)
|
|
VIDEO_OBJS='$(VIDEO_OBJS_VGA)'
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_SUPPORT_VGA, 0)
|
|
VIDEO_OBJS='$(VIDEO_OBJS_HGA)'
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_SUPPORT_VGA, 1)
|
|
VIDEO_OBJS='$(VIDEO_OBJS_VGA)'
|
|
]
|
|
)
|
|
AC_SUBST(VIDEO_OBJS)
|
|
|
|
AC_MSG_CHECKING(for FPU emulation)
|
|
FPU_VAR=''
|
|
FPU_GLUE_OBJ=''
|
|
AC_ARG_ENABLE(fpu,
|
|
[ --enable-fpu pass dir of external FPU emulation],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_SUPPORT_FPU, 1)
|
|
FPU_VAR='$(FPU_LIB)'
|
|
FPU_GLUE_OBJ='$(FPU_GLUE_OBJ)'
|
|
elif test "$enableval" = no; then
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_SUPPORT_FPU, 0)
|
|
else
|
|
echo " "
|
|
echo "ERROR: --enable-fpu does not accept a path"
|
|
exit 1
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_SUPPORT_FPU, 0)
|
|
]
|
|
)
|
|
AC_SUBST(FPU_VAR)
|
|
AC_SUBST(FPU_GLUE_OBJ)
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for x86 debugger support)
|
|
AC_ARG_ENABLE(x86-debugger,
|
|
[ --enable-x86-debugger x86 debugger support],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_X86_DEBUGGER, 1)
|
|
elif test "$enableval" = no; then
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_X86_DEBUGGER, 0)
|
|
else
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(BX_X86_DEBUGGER, 1)
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
AC_DEFINE(BX_X86_DEBUGGER, 0)
|
|
]
|
|
)
|
|
|
|
AC_MSG_CHECKING(for CDROM support)
|
|
AC_ARG_ENABLE(cdrom,
|
|
[ --enable-cdrom CDROM support],
|
|
[if test "$enableval" = yes; then
|
|
AC_MSG_RESULT(yes)
|
|
CDROM_OBJS='cdrom.o'
|
|
AC_DEFINE(BX_SUPPORT_CDROM, 1)
|
|
elif test "$enableval" = no; then
|
|
AC_MSG_RESULT(no)
|
|
CDROM_OBJS=''
|
|
AC_DEFINE(BX_SUPPORT_CDROM, 0)
|
|
else
|
|
AC_MSG_RESULT(yes)
|
|
CDROM_OBJS='cdrom.o'
|
|
AC_DEFINE(BX_SUPPORT_CDROM, 1)
|
|
fi],
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
CDROM_OBJS=''
|
|
AC_DEFINE(BX_SUPPORT_CDROM, 0)
|
|
]
|
|
)
|
|
AC_SUBST(CDROM_OBJS)
|
|
|
|
|
|
AC_MSG_CHECKING(for Sound Blaster 16 support)
|
|
AC_ARG_ENABLE(sb16,
|
|
[ --enable-sb16 Sound Blaster 16 Support],
|
|
[if test "$enableval" = no; then
|
|
AC_MSG_RESULT(no)
|
|
SB16_OBJS=''
|
|
AC_DEFINE(BX_SUPPORT_SB16, 0)
|
|
else
|
|
case "$enableval" in
|
|
dummy)
|
|
SB16_OBJS='$(SB16_DUMMY_OBJS)'
|
|
AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_output_c)
|
|
AC_MSG_RESULT(dummy)
|
|
;;
|
|
linux)
|
|
SB16_OBJS='$(SB16_LINUX_OBJS)'
|
|
AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_linux_c)
|
|
AC_MSG_RESULT(linux)
|
|
;;
|
|
win)
|
|
SB16_OBJS='$(SB16_WIN_OBJS)'
|
|
AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_windows_c)
|
|
AC_MSG_RESULT(win)
|
|
;;
|
|
*)
|
|
echo " "
|
|
echo \!\!\!Error\!\!\!
|
|
echo "You must pass one of dummy, linux, win to --enable-sb16"
|
|
exit 1 ;;
|
|
esac
|
|
AC_DEFINE(BX_SUPPORT_SB16, 1)
|
|
fi],
|
|
|
|
[
|
|
AC_MSG_RESULT(no)
|
|
SB16_OBJS=''
|
|
AC_DEFINE(BX_SUPPORT_SB16, 0)
|
|
]
|
|
)
|
|
AC_SUBST(SB16_OBJS)
|
|
|
|
|
|
AC_ARG_ENABLE(hga-dumps,
|
|
[ --enable-hga-dumps=Nmicroseconds copy memory to HGA video buffer every N useconds],
|
|
AC_DEFINE_UNQUOTED(BX_EMULATE_HGA_DUMPS, $enableval),
|
|
)
|
|
|
|
PRIMARY_TARGET='bochs'
|
|
|
|
AC_ARG_ENABLE(external-device-models,
|
|
[ --enable-external-device-models use external hardware device models],
|
|
[
|
|
AC_DEFINE(BX_PROVIDE_DEVICE_MODELS, 0)
|
|
IODEV_LIB_VAR=''
|
|
PRIMARY_TARGET='libbochs_cpu.a'
|
|
],
|
|
[
|
|
AC_DEFINE(BX_PROVIDE_DEVICE_MODELS, 1)
|
|
IODEV_LIB_VAR='iodev/libiodev.a'
|
|
]
|
|
)
|
|
AC_SUBST(IODEV_LIB_VAR)
|
|
|
|
AC_ARG_ENABLE(external-cpu-memory,
|
|
[ --enable-external-cpu-memory use external CPU+memory simulation environment],
|
|
[
|
|
AC_DEFINE(BX_PROVIDE_CPU_MEMORY, 0)
|
|
NONINLINE_VAR='$(EXTERN_ENVIRONMENT_OBJS)'
|
|
INLINE_VAR=''
|
|
PRIMARY_TARGET='libbochs.a'
|
|
EXTERNAL_DEPENDENCY='libbochs.a: iodev/libiodev.a $(EXTERN_ENVIRONMENT_OBJS)'
|
|
],
|
|
[
|
|
AC_DEFINE(BX_PROVIDE_CPU_MEMORY, 1)
|
|
NONINLINE_VAR='$(NONINLINE_OBJS)'
|
|
]
|
|
)
|
|
AC_SUBST(NONINLINE_VAR)
|
|
AC_SUBST(INLINE_VAR)
|
|
AC_SUBST(EXTERNAL_DEPENDENCY)
|
|
|
|
|
|
AC_ARG_WITH(x11,
|
|
[ --with-x11 use X11 GUI],
|
|
)
|
|
|
|
AC_ARG_WITH(beos,
|
|
[ --with-beos use BeOS GUI],
|
|
)
|
|
|
|
AC_ARG_WITH(win32,
|
|
[ --with-win32 use Win32 GUI],
|
|
)
|
|
|
|
AC_ARG_WITH(win32-vcpp,
|
|
[ --with-win32-vcpp use Win32 GUI/Visual C++ environment],
|
|
)
|
|
|
|
AC_ARG_WITH(macos,
|
|
[ --with-macos use Macintosh/CodeWarrior environment],
|
|
)
|
|
|
|
AC_ARG_WITH(nogui,
|
|
[ --with-nogui no native GUI, just use blank stubs],
|
|
)
|
|
|
|
AC_ARG_WITH(term,
|
|
[ --with-term textmode terminal environment],
|
|
)
|
|
|
|
dnl // make sure X Windows is default if no other chosen
|
|
if (test "$with_x11" != yes) && \
|
|
(test "$with_beos" != yes) && \
|
|
(test "$with_win32" != yes) && \
|
|
(test "$with_nogui" != yes) && \
|
|
(test "$with_win32_vcpp" != yes) && \
|
|
(test "$with_term" != yes) && \
|
|
(test "$with_macos" != yes); then
|
|
with_x11=yes
|
|
fi
|
|
|
|
dnl // DASH is option prefix for your platform
|
|
dnl // SLASH is directory for your platform
|
|
dnl // CXXFP is C++ File Prefix; the flag that tells the compiler
|
|
dnl // this is a C++ source file
|
|
dnl // CFP is C File Prefix; the flag that tells the compiler
|
|
dnl // this is a C source file
|
|
dnl // OFP is Object File Prefix; the flag that tells the compiler
|
|
dnl // generate an object file with this name
|
|
DASH="-"
|
|
SLASH="/"
|
|
CXXFP=""
|
|
CFP=""
|
|
OFP="-o "
|
|
MAKELIB="ar rv \$@"
|
|
RMCOMMAND="rm -f "
|
|
LINK="\$(CXX) -o \$@ \$(CXXFLAGS)"
|
|
EXE=""
|
|
COMMAND_SEPARATOR="&& \\"
|
|
CD_UP_ONE="echo done"
|
|
CD_UP_TWO="echo done"
|
|
|
|
if test "$with_x11" = yes; then
|
|
AC_DEFINE(BX_WITH_X11, 1)
|
|
GUI_OBJS='$(GUI_OBJS_X11)'
|
|
GUI_LINK_OPTS='$(GUI_LINK_OPTS_X)'
|
|
elif test "$with_win32" = yes; then
|
|
AC_DEFINE(BX_WITH_WIN32, 1)
|
|
GUI_OBJS='$(GUI_OBJS_WIN32)'
|
|
GUI_LINK_OPTS='$(GUI_LINK_OPTS_WIN32)'
|
|
elif test "$with_beos" = yes; then
|
|
AC_DEFINE(BX_WITH_BEOS, 1)
|
|
GUI_OBJS='$(GUI_OBJS_BEOS)'
|
|
GUI_LINK_OPTS='$(GUI_LINK_OPTS_BEOS)'
|
|
elif test "$with_win32_vcpp" = yes; then
|
|
AC_DEFINE(BX_WITH_WIN32, 1)
|
|
GUI_OBJS='$(GUI_OBJS_WIN32)'
|
|
GUI_LINK_OPTS='$(GUI_LINK_OPTS_WIN32_VCPP)'
|
|
|
|
CC="cl"
|
|
CFLAGS="/nologo /G6 /MT /W3 /GX /O2 /DNDEBUG /DWIN32 /D_WINDOWS"
|
|
CXX="$CC"
|
|
CXXFLAGS="$CFLAGS"
|
|
DASH="/"
|
|
SLASH="\\"
|
|
CXXFP="/Tp"
|
|
CFP="/Tc"
|
|
OFP="/Fo"
|
|
MAKELIB="lib.exe /nologo /subsystem:console /machine:I386 /verbose /out:\$@"
|
|
RMCOMMAND="-del"
|
|
RANLIB="echo"
|
|
LINK="link /nologo /subsystem:console /incremental:no /machine:I386 /out:\$@ BINMODE.OBJ"
|
|
EXE=".exe"
|
|
PRIMARY_TARGET="bochs.exe"
|
|
COMMAND_SEPARATOR=""
|
|
CD_UP_ONE="cd .."
|
|
CD_UP_TWO="cd ..\.."
|
|
AC_DEFINE(BX_64BIT_CONSTANTS_USE_LL, 0)
|
|
AC_DEFINE(inline, __inline)
|
|
AC_DEFINE(BX_NO_EMPTY_STRUCTS, 1)
|
|
AC_DEFINE(BX_NO_ATTRIBUTES, 1)
|
|
AC_DEFINE(BX_HAVE_HASH_MAP, 0)
|
|
elif test "$with_macos" = yes; then
|
|
AC_DEFINE(BX_WITH_MACOS, 1)
|
|
AC_DEFINE(BX_HAVE_STRDUP, 0)
|
|
GUI_OBJS='$(GUI_OBJS_MACOS)'
|
|
GUI_LINK_OPTS='$(GUI_LINK_OPTS_MACOS)'
|
|
elif test "$with_term" = yes; then
|
|
AC_DEFINE(BX_WITH_TERM, 1)
|
|
GUI_OBJS='$(GUI_OBJS_TERM)'
|
|
GUI_LINK_OPTS='$(GUI_LINK_OPTS_TERM)'
|
|
use_curses=yes
|
|
else
|
|
AC_DEFINE(BX_WITH_NOGUI, 1)
|
|
GUI_OBJS='$(GUI_OBJS_NOGUI)'
|
|
GUI_LINK_OPTS='$(GUI_LINK_OPTS_NOGUI)'
|
|
fi
|
|
|
|
if test "$use_curses" = yes; then
|
|
AC_CHECK_LIB(curses, mvaddch, GUI_LINK_OPTS_TERM='-lcurses')
|
|
AC_CHECK_LIB(ncurses, mvaddch, GUI_LINK_OPTS_TERM='-lncurses')
|
|
AC_CHECK_LIB(termlib, mvaddch, GUI_LINK_OPTS_TERM='-ltermlib')
|
|
if test "$GUI_LINK_OPTS_TERM" = ""; then
|
|
echo Curses library not found: tried curses, ncurses, and termlib.
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
|
|
AC_SUBST(GUI_OBJS)
|
|
AC_SUBST(GUI_LINK_OPTS)
|
|
AC_SUBST(GUI_LINK_OPTS_TERM)
|
|
AC_SUBST(DASH)
|
|
AC_SUBST(SLASH)
|
|
AC_SUBST(CXXFP)
|
|
AC_SUBST(CFP)
|
|
AC_SUBST(OFP)
|
|
AC_SUBST(MAKELIB)
|
|
AC_SUBST(RMCOMMAND)
|
|
AC_SUBST(LINK)
|
|
AC_SUBST(EXE)
|
|
AC_SUBST(PRIMARY_TARGET)
|
|
AC_SUBST(COMMAND_SEPARATOR)
|
|
AC_SUBST(CD_UP_ONE)
|
|
AC_SUBST(CD_UP_TWO)
|
|
|
|
|
|
AC_OUTPUT(Makefile iodev/Makefile debug/Makefile bios/Makefile \
|
|
cpu/Makefile memory/Makefile gui/Makefile disasm/Makefile \
|
|
${INSTRUMENT_DIR}/Makefile misc/Makefile dynamic/Makefile \
|
|
fpu/Makefile)
|