dnl Process this file with autoconf to produce a configure script.
AC_INIT(ucblogo, 6.1)
AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_ARG_ENABLE([objects],
[AS_HELP_STRING([--enable-objects],
[enable object oriented logo features (default is no)])],
[AC_DEFINE(OBJECTS)])
WXCONFIG=wx-config
AC_ARG_WITH(wx-config,
[[ --with-wx-config=FILE Use the given path to wx-config when determining
wxWidgets configuration; defaults to "wx-config"]],
[
if test "$withval" != "yes" -a "$withval" != ""; then
WXCONFIG=$withval
fi
])
TERMOFILE="term.o"
TERMFILE="term.c"
GRAPHICSOFILE=" xgraphics.o "
GRAPHICSFILE=" xgraphics.c "
AC_MSG_CHECKING([wxWidgets version])
if wxversion=`$WXCONFIG --version`; then
AC_MSG_RESULT([$wxversion])
AC_DEFINE(HAVE_WX)
WXOFILES="wxMain.o wxTerminal.o wxTurtleGraphics.o TextEditor.o"
WXSRCFILES="wxMain.cpp wxTerminal.cpp wxTurtleGraphics.cpp TextEditor.cpp"
LIBS="$LIBS "`$WXCONFIG --libs`;
CC="`$WXCONFIG --cc`"
CXX="`$WXCONFIG --cxx`"
CXXFLAGS="$CXXFLAGS -DHAVE_WX `$WXCONFIG --cxxflags`";
CFLAGS="$CFLAGS -DHAVE_WX "
TERMOFILE="wxterm.o"
TERMFILE="wxterm.c"
GRAPHICSOFILE=""
GRAPHICSFILE=""
LINKER="`$WXCONFIG --ld`"
else
AC_MSG_RESULT([not found])
LINKER='$(CC)'
fi
dnl Checks for libraries.
AC_PATH_XTRA
AC_CHECK_LIB(m, atan)
AC_CHECK_LIB(BSD, signal)
AC_CHECK_LIB(bsd, signal)
tcap=no
AC_CHECK_LIB(termcap, tgetstr,
AC_DEFINE(HAVE_LIBTERMCAP) LIBS="$LIBS -ltermcap" tcap=yes)
if test $tcap = no; then
AC_CHECK_LIB(termlib, tgetstr,
AC_DEFINE(HAVE_LIBTERMLIB) LIBS="$LIBS -ltermlib" tcap=yes)
fi
if test $tcap = no; then
AC_CHECK_LIB(curses, tgetstr,
AC_DEFINE(HAVE_LIBCURSES) LIBS="$LIBS -lcurses" tcap=yes)
fi
if test $tcap = no; then
AC_CHECK_LIB(ncurses, tgetstr,
AC_DEFINE(HAVE_LIBCURSES) LIBS="$LIBS -lncurses" tcap=yes)
fi
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sgtty.h termio.h unistd.h string.h termcap.h termlib.h curses.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
dnl Checks for library functions.
AC_CHECK_FUNCS(usleep srandom sigvec sigsetmask drem irint memcpy)
AC_PROG_GCC_TRADITIONAL
dnl AC_TYPE_SIGNAL
if test "$no_x" != yes; then
LIBS="$LIBS -lX11"
fi
AC_SUBST(WXOFILES)
AC_SUBST(WXSRCFILES)
AC_SUBST(TERMOFILE)
AC_SUBST(TERMFILE)
AC_SUBST(LINKER)
AC_SUBST(GRAPHICSOFILE)
AC_SUBST(GRAPHICSFILE)
AC_OUTPUT(makefile)