-AC_CHECK_FUNC(getopt_long,,
- AC_MSG_ERROR(`This application depends upon getopt_long'))
-
-
+if test x"$with_libplot" != x"no" ; then
+ AC_CHECK_LIB(plot, pl_newpl_r,,
+ AC_MSG_ERROR([You must install libplot (or use --without-libplot)])
+ )
+fi
+AM_CONDITIONAL(WITHCHARTS, test x"$with_libplot" != x"no")
+
+dnl Check that off_t is defined as an integer type.
+dnl Solaris sometimes declares it as a struct, if it
+dnl thinks that the compiler does not support `long long'.
+AC_COMPILE_IFELSE([#include <sys/types.h>
+#include <unistd.h>
+off_t x = 0;
+int main (void)
+{
+ lseek (0, 1, 2);
+ return 0;
+}], [], [AC_MSG_ERROR(
+[Your system's definition of off_t is broken. You are probably
+using Solaris. You can probably fix the problem with
+`--disable-largefile' or `CFLAGS=-ansi'.])])
+
+AC_CHECK_LIB(gslcblas,main,,AC_MSG_ERROR([You must install libgslcblas]))
+AC_CHECK_LIB(gsl, gsl_cdf_chisq_Q,,
+ AC_MSG_ERROR([You must install libgsl version 1.4 or later]))
+
+AC_ARG_WITH(ncurses,
+[ --without-ncurses don't compile in ncurses command line editing])
+
+if test "x$with_ncurses" = x"yes"; then