-AC_CHECK_LIB(gmp, mpf_get_str,,
- AC_CHECK_LIB(gmp, __gmpf_get_str,,
- AC_MSG_ERROR([You must install libgmp])
- )
-)
+AC_ARG_WITH(libplot, [ --without-libplot don't compile in support of charts (using libplot)])
+
+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'.])])