+dnl ** check for readline, for Hugs and hslibs' Readline
+dnl ncurses supersedes termcap and curses, but for compatibility,
+dnl we have to check for all...
+AC_CHECK_LIB(ncurses, tputs, HaveLibTermcap=YES; LibTermcap=ncurses,
+ AC_CHECK_LIB(termcap, tputs, HaveLibTermcap=YES; LibTermcap=termcap,
+ AC_CHECK_LIB(curses, tputs, HaveLibTermcap=YES; LibTermcap=curses,
+ HaveLibTermcap=NO; LibTermcap=not-installed)))
+
+if test $HaveLibTermcap = YES ; then
+ LIBS="-l$LibTermcap $LIBS"
+ AC_CHECK_LIB(readline, readline, HaveLibReadline=YES, HaveLibReadline=NO)
+fi
+
+if test $HaveLibTermcap = YES && test x"$HaveLibReadline" = xYES ; then
+ AC_DEFINE(HAVE_READLINE_LIBS,1)
+ LibsReadline="readline $LibTermcap"
+else
+ AC_DEFINE(HAVE_READLINE_LIBS,0)
+ LibsReadline=
+fi
+AC_SUBST(LibsReadline)
+
+if test "$HaveLibReadline"; then
+ AC_CHECK_LIB(readline, rl_erase_empty_line,
+ [AC_DEFINE(HAVE_READLINE_4, 1)],
+ [AC_DEFINE(HAVE_READLINE_4, 0)])
+ AC_CHECK_LIB(readline, rl_free_undo_list,
+ [AC_DEFINE(HAVE_READLINE_4_2, 1)],
+ [AC_DEFINE(HAVE_READLINE_4_2, 0)])
+else
+ AC_DEFINE(HAVE_READLINE_4, 0)
+ AC_DEFINE(HAVE_READLINE_4_2, 0)
+fi
+
+dnl ** check for math library
+FPTOOLS_CHECK_LIBM()
+AC_SUBST(LIBM)
+
+case $HostOS_CPP in
+cygwin32) ;;
+mingw32) ;;
+*) AC_PATH_XTRA() ;;
+esac
+
+dnl ################################################################
+dnl Check for libraries
+dnl ################################################################
+
+AC_CHECK_LIB(dl, dlopen,
+ [HaveLibDL=YES
+ AC_DEFINE(HAVE_LIBDL)
+ LIBS="$LIBS -ldl"],
+ [HaveLibDL=NO])
+AC_CHECK_FUNCS(dlopen)
+AC_SUBST(HaveLibDL)
+
+FPTOOLS_CHECK_LIB_NOWARN(m, atan)
+
+dnl --------------------------------------------------
+dnl * test for GTK+
+dnl --------------------------------------------------
+
+AC_PATH_PROGS(GTK_CONFIG, gtk-config gtk12-config)
+if test "$GTK_CONFIG" != ""; then
+ AC_CACHE_CHECK([for version of GTK+], fptools_cv_gtk_version, [
+ fptools_cv_gtk_version=`$GTK_CONFIG --version`
+ ])
+ GTK_VERSION=$fptools_cv_gtk_version
+else
+ GTK_VERSION=
+fi
+
+case $fptools_cv_gtk_version in
+ 1.[[23]].*) ;;
+ *) AC_MSG_WARN([GTK+ not usable; need at least version 1.2])
+ GTK_CONFIG=
+ ;;
+esac
+
+AC_SUBST(GTK_CONFIG)
+AC_SUBST(GTK_VERSION)
+
+dnl --------------------------------------------------
+dnl * Miscellaneous feature tests
+dnl --------------------------------------------------
+