Like many other open source projects, Bochs uses a configure script created with autoconf. The configure script generates all makefiles and a set of header and support files from templates.
This example shows how to add an option to the template file configure.in.
The resulting configure script sets up symbols like BX_SUPPORT_BUSMOUSE
in the output file config.h and replaces @BUSM_OBJS@
entries in the makefile output.
BUSM_OBJS='' AC_MSG_CHECKING(for Busmouse support) AC_ARG_ENABLE(busmouse, AS_HELP_STRING([--enable-busmouse], [enable Busmouse support (InPort)]), [if test "$enableval" = yes; then AC_MSG_RESULT(yes) AC_DEFINE(BX_SUPPORT_BUSMOUSE, 1) BUSM_OBJS='busmouse.o' else AC_MSG_RESULT(no) AC_DEFINE(BX_SUPPORT_BUSMOUSE, 0) fi], [ AC_DEFINE(BX_SUPPORT_BUSMOUSE, 0) AC_MSG_RESULT(no)] ) AC_SUBST(BUSM_OBJS)
These output files are generated by the configure script in addition to the makefiles.
config.h - the main header file
ltdlconf.h - header file required for compiling with libtool
bxversion.h - header file containing version strings
bxversion.rc - resource file for Windows with version information
build/linux/bochs-dlx - DLX Linux shortcut script (Linux only)
build/macosx/Info.plist - property list file for MacOSX
build/win32/nsis/bochs.nsi - NSIS script for creating Windows installer package