dnl dnl configure.in for TI85 Emulator, (c) 2001 Milan Pikula dnl dnl Init AC_INIT(src/main.c) AM_INIT_AUTOMAKE(ti85emu, 0.1.0) AM_CONFIG_HEADER(config.h) AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PROG_RANLIB dnl *** AC_PROG_MAKE_SET dnl portability? AC_MINIX AC_ISC_POSIX AC_AIX AC_CHECK_HEADERS(string.h) dnl Look at the GUI option AC_DEFUN(TEST_LIB,[ AC_CHECK_LIB($1,$2,,AC_MSG_ERROR(*** Missing library $1 ***)) ]) AC_DEFUN(TEST_LIBS,[ AC_CHECK_LIB($1,$2,,AC_MSG_ERROR(*** Missing library $1 ***),$3) ]) dnl AC_MSG_CHECKING(for GUI to use) AC_ARG_WITH(gui, [ --with-gui=X specify the graphical user interface (GUI) to: gtk use GTK user interface fltk use FLTK user interface], [ dnl AC_MSG_RESULT(${withval} (forced)) gui="${withval}"], [gui="unset"]) AC_ARG_ENABLE(fltk-flashing, [ --enable-fltk-flashing enable this to get faster emulator, at the cost of flashing display. This is suitable for use on slow machines with LCD display, such as Agenda VR3d. Default is DISABLE.], [ if test "$enable_fltk_flashing" = "yes"; then AC_DEFINE(FLTK_FLASHING) fi ], []) AC_ARG_ENABLE(fltk-relevant, [ --enable-fltk-relevant enable this to avoid unnecessary screen redrawing. This improves the speed if running over network or on a slow X display, but slightly increases the on slow machines with LCD display, such as Agenda VR3d. Default is ENABLE.], [ if test "$enable_fltk_relevant" = "yes"; then AC_DEFINE(FLTK_RELEVANT) fi ], [AC_DEFINE(FLTK_RELEVANT)]) AC_ARG_ENABLE(gtk-relevant, [ --enable-gtk-relevant enable this to avoid unnecessary screen redrawing. This improves the speed if running over network or on a slow X display, but slightly increases the on slow machines with LCD display, such as Agenda VR3d. Default is ENABLE.], [ if test "$enable_gtk_relevant" = "yes"; then AC_DEFINE(GTK_RELEVANT) fi ], [AC_DEFINE(GTK_RELEVANT)]) if test "$gui" = "unset"; then AC_CHECK_LIB(gtk,main,[ dnl AC_MSG_RESULT(gtk) gui=gtk ],[],[-lgdk]) fi if test "$gui" = "unset"; then AC_CHECK_LIB(fltk,main,[ dnl AC_MSG_RESULT(fltk) gui=fltk ],[]) fi dnl Check, if the given GUI is correct guifile="0" if test "$gui" = "gtk"; then dnl TEST_LIB(X11,XCreateSimpleWindow) dnl TEST_LIB(Xext,XMissingExtension) dnl TEST_LIBS(gtk,gtk_window_new,[-lgdk]) dnl TEST_LIB(gdk,gdk_init) AM_PATH_GLIB(1.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" ,AC_MSG_ERROR(*** GLIB >= 1.0.0 required ***)) AM_PATH_GTK(1.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" ,AC_MSG_ERROR(*** GTK >= 1.0.0 required ***)) AC_DEFINE(GUI_GTK) guifile="ti85emu_gtk" msxfile="libmsx.a" fi if test "$gui" = "fltk"; then TEST_LIB(stdc++,cout) TEST_LIB(X11,XCreateSimpleWindow) TEST_LIB(Xext,XMissingExtension) TEST_LIB(fltk,fl_yes) AC_DEFINE(GUI_FLTK) guifile="ti85emu_fltk" msxfile="libxmsx.a" fi if test "$guifile" = "0"; then AC_MSG_ERROR(*** Cannot find a GUI. Try ./configure --help ***) fi AC_ARG_WITH(speed, [ --with-speed=X set the speed of emulation to: full run at FULL SPEED including idle time of calculator (this kills the machine and also turns the calculator off too often) freal run at FULL SPEED during computations, REAL SPEED when idle. (this enables the fast computations and graphs, while preserves the real blinking of cursor and power off) (default) real run at REAL SPEED in computations and when idle. (this mode is suitable for playing games and running assembler software)], [ speed="${withval}"], [speed="freal"]) if test "$speed" = "full"; then AC_DEFINE(SPEED_FULL) fi if test "$speed" = "freal"; then AC_DEFINE(SPEED_FREAL) fi if test "$speed" = "real"; then AC_DEFINE(SPEED_REAL) fi AC_ARG_WITH(snapfile, [ --with-snapfile=X sets the file name for a snapshot file, used to store the state of the calculator. Default is '85snap.sna' in the current directory.], [ AC_DEFINE_UNQUOTED(SNAPFILE,"${withval}")], [AC_DEFINE_UNQUOTED(SNAPFILE,"85snap.sna")]) AC_ARG_WITH(romfile, [ --with-romfile=X sets the file name for a ROM image file. Default is '/usr/share/ti85rom.bin'.], [ AC_DEFINE_UNQUOTED(ROMFILE,"${withval}")], [AC_DEFINE_UNQUOTED(ROMFILE,"/usr/share/ti85rom.bin")]) AC_SUBST(guifile) AC_SUBST(msxfile) AC_SUBST(GUI_FLTK) AC_SUBST(FLTK_FLASHING) AC_SUBST(FLTK_RELEVANT) AC_SUBST(GUI_GTK) AC_SUBST(GTK_RELEVANT) AC_SUBST(SPEED_FULL) AC_SUBST(SPEED_FREAL) AC_SUBST(SPEED_REAL) AC_SUBST(SNAPFILE) AC_SUBST(ROMFILE) AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_OUTPUT(Makefile src/Makefile src/MSX/Makefile)