Initial release of Maemo 5 port of gnuplot
[gnuplot] / configure.in
diff --git a/configure.in b/configure.in
new file mode 100755 (executable)
index 0000000..09a9bc8
--- /dev/null
@@ -0,0 +1,1422 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl configure.in for gnuplot on Unix.
+dnl
+dnl $Id: configure.in,v 1.202.2.27 2009/08/29 17:51:19 sfeam Exp $
+dnl
+dnl this is actually major.minor ...
+dnl note that for a non-beta release, we need to
+dnl remove the letter from VERSION
+AC_INIT(gnuplot, 4.2.6)
+AC_CONFIG_SRCDIR(src/graphics.c)
+AC_PREREQ(2.58)
+AM_CONFIG_HEADER(config.h:config.hin)
+AM_INIT_AUTOMAKE(1.7.9)
+
+VERSION_MAJOR="`cat $srcdir/VERSION`"
+PATCHLEVEL="`cat $srcdir/PATCHLEVEL`"
+
+dnl configure.in body
+
+dnl Compiler characteristics
+dnl Check for ANSI C prototypes, the const and inline keywords,
+dnl and ANSI style stringification
+AC_PROG_CC
+AM_C_PROTOTYPES
+AC_PROG_CPP
+AC_C_CONST
+AC_C_INLINE
+AC_C_STRINGIZE
+
+dnl Various programs
+dnl X/Emacs for building lisp packages and creating .texi version of docs
+# If set to t, that means we are running in a shell under Emacs.
+# If you have an Emacs named "t", then use the full path.
+test x"$EMACS" = xt && EMACS=
+AC_CHECK_PROGS(EMACS, emacs xemacs, no)
+AC_CHECK_PROGS(PLAINTEX, tex, no)
+AC_CHECK_PROGS(LATEX, latex latex2e, no)
+AC_CHECK_PROGS(PDFLATEX, pdflatex, no)
+AC_CHECK_PROGS(DVIPS, dvips, no)
+AC_CHECK_PROGS(TROFF, troff, no)
+
+dnl Allow manual specification of kpsexpand 
+AC_ARG_WITH(kpsexpand,dnl
+  [--with-kpsexpand        search for kpsexpand at run-time (default disabled)],
+  [if test "$withval" = yes; then
+    AC_DEFINE(HAVE_KPSEXPAND,1,[ Define if you use have kpsexpand (TeX). ])
+  fi])
+
+dnl X Window System files.
+AC_SUBST(LIBRARIES_FOR_X)
+AC_PATH_XTRA
+
+dnl Needed for LynxOS until AC_PATH_XTRA is fixed
+if test "$ac_cv_func_gethostbyname" = no; then
+  if test "$ac_cv_lib_nsl_gethostbyname" = no; then
+    AC_CHECK_LIB(bsd, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd")
+  fi
+fi
+
+if test "$no_x" != yes; then
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  LIBRARIES_FOR_X="$X_LIBS -lX11 $X_EXTRA_LIBS"
+  GNUPLOT_X11='gnuplot_x11${EXEEXT}'
+  AC_DEFINE(X11,1,[ Define if you are using the X11 window system. ])
+else
+  GNUPLOT_X11=
+fi
+
+AC_SUBST(GNUPLOT_X11)
+
+dnl Operating systems.
+dnl FIXME AC_DEFINE(ISC22)
+dnl FIXME AC_DEFINE(KSR)
+dnl Check for MSDOS and djgpp, NeXT, Apple MacOsX (NeXT like), BeOS
+GP_MSDOS
+GP_NEXT
+GP_APPLE
+GP_BEOS
+GP_ALPHA
+AM_CONDITIONAL(BUILD_SRC_BEOS_SUBDIR, test x$build_beos_subdir = xyes)
+
+dnl Apparently, -lNeXT_s is needed on NeXT
+dnl _instead_ of -lm ...
+AC_CHECK_FUNC(sin,,[AC_CHECK_LIB(m,sin)])
+
+dnl Header files. ANSI first
+dnl We prefer that the absense of a macro is the norm, so in syscfg.h
+dnl configure's HAVE_XXXX defines are translated into NO_XXXX for ANSI
+dnl headers and functions
+AC_HEADER_STDC
+
+dnl Header files
+dnl ANSI/ISO C, POSIX, others
+AC_CHECK_HEADERS(dirent.h errno.h float.h limits.h locale.h math.h stdlib.h \
+  string.h time.h sys/time.h sys/types.h \
+  sys/bsdtypes.h sys/ioctl.h sys/param.h sys/select.h sys/socket.h \
+  sys/stat.h sys/systeminfo.h sys/timeb.h sys/utsname.h \
+  libc.h malloc.h poll.h sgtty.h termios.h values.h pwd.h
+)
+
+AC_HEADER_STDBOOL
+
+if test "$ac_cv_header_math_h" = yes ; then
+  AC_MSG_CHECKING([for struct exception in math.h])
+  AC_TRY_LINK([#include <math.h>],
+    [struct exception *x; x->type; x->name;],
+    [AC_MSG_RESULT(yes)
+     AC_DEFINE(HAVE_STRUCT_EXCEPTION_IN_MATH_H,1,
+               [ Define if math.h declares struct exception for matherr(). ])],
+    AC_MSG_RESULT(no))
+fi
+
+if test "$ac_cv_header_sys_stat_h" = yes; then
+  AC_HEADER_STAT
+fi
+
+dnl check if unistd actually declares anything. On NeXT 3.2 unistd is
+dnl conditionalized for _POSIX_SOURCE
+AC_MSG_CHECKING(for unistd.h)
+AC_EGREP_HEADER(execv, unistd.h,
+  [AC_DEFINE(HAVE_UNISTD_H) AC_MSG_RESULT(yes)],
+   AC_MSG_RESULT(no))
+
+dnl check if errno.h header declares errno
+AC_MSG_CHECKING(if errno variable is declared)
+AC_TRY_COMPILE(
+[#include <stdio.h>
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif],
+  errno=0,AC_MSG_RESULT(yes),
+  [AC_DEFINE(EXTERN_ERRNO,1,[ Define if <errno.h> declares errno. ])
+   AC_MSG_RESULT(no)])
+
+
+dnl Types.
+AC_TYPE_SIZE_T
+AC_MSG_CHECKING(for time_t in time.h)
+AC_EGREP_HEADER(time_t,time.h,
+  [AC_MSG_RESULT(yes)
+   AC_DEFINE(HAVE_TIME_T_IN_TIME_H,1,
+             [ Define if time_t is declared in time.h. ])])
+AC_TYPE_SIGNAL
+
+dnl Functions. Standard first, then others
+
+dnl ANSI/ISO and their predecessors
+dnl sunos 4 has on_exit() in place of atexit()
+dnl gamma is called lgamma on apollos and linux
+dnl we prefer lgamma over gamma, see specfun.c
+dnl math lib is already available, see operating systems part
+AC_CHECK_FUNCS(atexit memcpy memmove memset \
+  on_exit bcopy bzero \
+  setvbuf strerror strchr strrchr strstr \
+  index rindex \
+  isnan \
+  erf erfc gamma lgamma \
+  getcwd poll pclose popen select sleep stpcpy \
+  strcspn strdup strcasecmp stricmp strncasecmp strnicmp \
+  sysinfo tcgetattr vfprintf doprnt usleep
+)
+
+AC_CHECK_FUNCS(snprintf, ,
+ [  AC_MSG_RESULT([ 
+  WARNING: Could not find a working version of snprintf.
+           If a user provides gnuplot with an improper format statement
+          then a buffer overflow and/or segfault can result.
+          Please consider providing snprintf via an external library.
+  ])
+])
+
+
+dnl HBB 20030624: see if signgam is declared by math.h
+AC_CHECK_DECLS([signgam],,,
+[#if HAVE_MATH_H
+#include <math.h>
+#endif
+])
+
+dnl check, if we have sigsetjmp and siglongjmp.
+dnl a trivial AC_CHECK_FUNCS(sigsetjmp) won't do
+dnl because sigsetjmp() might be a macro declared
+dnl in <setjmp.h>. (joze)
+AC_MSG_CHECKING(for sigsetjmp)
+AC_TRY_LINK([#include <setjmp.h>], [jmp_buf env; sigsetjmp(env, 1);],
+  [AC_MSG_RESULT(yes)
+   AC_DEFINE(HAVE_SIGSETJMP,1,
+             [ Define if we have sigsetjmp(). ])],
+  AC_MSG_RESULT(no))
+
+if test "$ac_cv_func_pclose" = yes -a "$ac_cv_func_popen" = yes ; then
+  AC_DEFINE(PIPES,1,[ Define if you do have the popen and pclose functions. ])
+fi
+
+dnl Argument types of select()
+AC_FUNC_SELECT_ARGTYPES
+
+dnl On SVR3.
+dnl FIXME AC_DEFINE(CRIPPLED_SELECT)
+
+dnl Install the lasergnu printer script
+LASERGNU=lasergnu-noinstall
+AC_ARG_WITH(lasergnu,dnl
+[  --with-lasergnu         install lasergnu printer script],
+  test "$withval" = yes && LASERGNU=lasergnu-install)
+
+dnl .gih help file location
+eval gp_datadir=$datadir
+if test "$gp_datadir" = NONE/share; then
+  datadir="/usr/local/share"
+fi
+pkgdatadir="$datadir/$PACKAGE"
+AC_ARG_WITH(gihdir,dnl
+[  --with-gihdir=DIR       location of .gih file
+                          (default PREFIX/share/PACKAGE/VERSION)],
+  GIHDIR="$withval",
+  GIHDIR="$pkgdatadir/$VERSION_MAJOR")
+
+dnl The Linux console driver
+AC_ARG_WITH(linux-vga,dnl
+[  --with-linux-vga        use the Linux SVGA console driver
+                          (requires /usr/lib/libvga)],,
+  test -z "$with_linux_vga" && with_linux_vga=no)
+
+dnl check for installed linux vgalib
+if test "$with_linux_vga" = yes; then
+  AC_MSG_CHECKING(for linux vga library)
+  AC_CHECK_LIB(vga, vga_init,
+    [AC_DEFINE(LINUXVGA,1,
+               [ Define if this is a Linux system with SuperVGA library. ])
+     LINUXSUID='chown root $(bindir)/gnuplot; chmod u+s $(bindir)/gnuplot'
+     TERMLIBS="-lvga $TERMLIBS"],
+    with_linux_vga=no)
+fi
+
+dnl TODO: simplify, get rid of GGI_SUPPORT
+dnl new ggi driver
+GGI_SUPPORT=no
+AC_ARG_WITH(ggi,dnl
+[  --with-ggi[=DIR]        enable the ggi driver (EXPERIMENTAL)],
+  [if test "$withval" != no; then
+     if test -d $withval/include; then
+       CPPFLAGS="$CPPFLAGS -I$withval/include"
+     fi
+     if test -d $withval/lib; then
+       LDFLAGS="$LDFLAGS -L$withval/lib"
+     fi
+     AC_CHECK_LIB(ggi,ggiInit,
+       [TERMLIBS="-lggi $TERMLIBS"
+        AC_DEFINE(USE_GGI_DRIVER,1,
+                  [ Define if you want to use the experimental ggi driver. ])
+        GGI_SUPPORT=yes
+        dnl check if libggiwmh and ggi/wmh.h are found
+        AC_CHECK_LIB(ggiwmh,ggiWmhInit,
+          [TERMLIBS="-lggiwmh $TERMLIBS"
+           AC_CHECK_HEADERS(ggi/wmh.h,,
+             AC_MSG_WARN([found ggiwmh library but not ggi/wmh.h
+please add path to ggi/wmh.h to CPPFLAGS in Makefile]))
+          ])])
+   fi])
+
+AC_ARG_WITH(xmi,dnl
+[  --with-xmi[=DIR]        ggi's xmi support for pm3d (EXPERIMENTAL)],
+  [if test "$withval" != no -a "$GGI_SUPPORT" = yes; then
+     if test -d $withval/include; then
+       CPPFLAGS="$CPPFLAGS -I$withval/include"
+     fi
+     if test -d $withval/lib; then
+       LDFLAGS="$LDFLAGS -L$withval/lib"
+     fi
+     AC_CHECK_LIB(xmi,xmiInit,
+       [TERMLIBS="-lxmi $TERMLIBS"
+        AC_CHECK_HEADERS(ggi/xmi.h)])
+   fi])
+
+dnl Use builtin readline or GNU readline or NetBSD editline
+AC_ARG_WITH(readline,dnl
+[  --with-readline=builtin  use the built-in minimal readline
+  --with-readline=gnu      use the GNU readline library (default; 4.2 or newer required)
+  --with-readline=bsd      use the NetBSD editline library
+  --with-readline=DIR      specify the location of GNU readline
+  --without-readline       do not use any readline function], ,
+  test -z "$with_readline" && with_readline=gnu)
+
+dnl Gnuplot history
+AC_ARG_ENABLE(history-file,dnl
+[  --disable-history-file  do not use history file],,
+  test -z "$enable_history_file" && enable_history_file=yes)
+
+dnl GNU readline and the required terminal library
+if test "$with_readline" != no; then
+  if test "$with_readline" != builtin; then
+
+    if test "$with_readline" = bsd; then
+
+      AC_CHECK_LIB(edit, readline,
+        [TERMLIBS="-ledit $TERMLIBS"],
+       [AC_MSG_WARN([Could not find BSD editline library ])
+        with_readline=builtin],)
+
+      AC_CHECK_LIB(curses, tputs,
+        [TERMLIBS="-lcurses $TERMLIBS"],,)
+
+      if test "$ac_cv_lib_edit_readline" = yes; then
+        AC_DEFINE(HAVE_LIBEDITLINE,1,
+                [ Define if you are using the BSD editline library. ])
+        AC_CHECK_HEADERS(editline/readline.h,,
+          AC_MSG_WARN([found BSD editline library but not readline.h please add path to readline.h to CPPFLAGS in Makefile]))
+
+        if test "$enable_history_file" = yes; then
+            AC_DEFINE(GNUPLOT_HISTORY,1,
+                      [ Define if you want to use a gnuplot history file. ])
+        fi
+      fi
+
+    else # !bsd
+
+    dnl check for terminal library
+    dnl this is a very cool solution from octave's configure.in
+    gp_tcap=""
+    for termlib in ncurses curses termcap terminfo termlib; do
+      AC_CHECK_LIB(${termlib}, tputs, [gp_tcap="$gp_tcap -l$termlib"])
+      case "$gp_tcap" in
+        *-l${termlib}*)
+          break
+        ;;
+      esac
+    done
+
+    if test "$with_readline" = gnu; then
+      AC_CHECK_LIB(readline, remove_history,
+        [TERMLIBS="-lreadline $gp_tcap $TERMLIBS"],, [${gp_tcap}])
+    else
+      if test -d $with_readline/include; then
+        CPPFLAGS="$CPPFLAGS -I$with_readline/include"
+      fi
+      if test -d $with_readline/lib; then
+        LDFLAGS="$LDFLAGS -L$with_readline/lib"
+      fi
+
+      AC_CHECK_LIB(readline, remove_history,
+        [TERMLIBS="-lreadline $gp_tcap $TERMLIBS"],,[${gp_tcap}])
+
+    fi
+
+    if test "$ac_cv_lib_readline_remove_history" = no; then
+      dnl OSX keeps history functions in a separate library
+      AC_CHECK_LIB(history, remove_history,
+        TERMLIBS="-lreadline -lhistory $gp_tcap $TERMLIBS",
+       [ AC_MSG_WARN([GNU readline not found - falling back to builtin readline])
+          with_readline=builtin ]
+       ,[${gp_tcap}])
+    fi
+
+    if [test "$ac_cv_lib_readline_remove_history" != no || test "$ac_cv_lib_history_remove_history" != no]; then
+      if test "$with_readline" = bsd; then
+          AC_DEFINE(HAVE_LIBEDITLINE,1,
+                [ Define if you are using the BSD editline library. ])
+      else
+          AC_DEFINE(HAVE_LIBREADLINE,1,
+                [ Define if you are using the GNU readline library. ])
+      fi
+      AC_CHECK_HEADERS(readline/readline.h,,
+        AC_MSG_WARN([found GNU readline library but not readline.h
+please add path to readline.h to CPPFLAGS in Makefile]))
+      AC_CHECK_HEADERS(readline/history.h,,
+        AC_MSG_WARN([found GNU readline library but not history.h
+please add path to history.h to CPPFLAGS in Makefile]))
+
+      if test "$enable_history_file" = yes; then
+        AC_CHECK_HEADERS(readline/tilde.h,
+          AC_DEFINE(GNUPLOT_HISTORY,1,
+                    [ Define if you want to use a gnuplot history file. ]))
+      fi
+
+    fi # ! ac_cv_lib_readline_readline = no
+
+   fi # ! with_readline = bsd
+
+  fi # ! with_readline != builtin 
+
+  if test "$with_readline" = builtin; then
+    AC_DEFINE(READLINE,1,
+              [ Define if you want to use the included readline function. ])
+    if test "$enable_history_file" = yes; then
+       AC_DEFINE(GNUPLOT_HISTORY,1,
+                [ Define if you want to use a gnuplot history file. ])
+    fi
+  fi
+
+fi
+dnl end readline
+
+dnl If no DIR argument given, use the Unix plot library
+dnl Else use either GNU libplot from plotutils,
+dnl or ancient GNU graphics libplot
+AC_ARG_WITH(plot,dnl
+[  --with-plot[=DIR]       use the Unix plot library],
+  [if test "$withval" = yes; then
+     dnl Unix plot library
+     AC_CHECK_LIB(plot,openpl,
+       [AC_DEFINE(UNIXPLOT,1,
+                  [ Define if you want to use the standard Unix plot library. ])
+        TERMLIBS="-lplot $TERMLIBS"],
+       with_plot=no)
+   elif test "$withval" != no; then
+     dnl GNU plotutils 2.2 or better
+     if test -d $withval/include; then
+       CPPFLAGS="$CPPFLAGS -I$withval/include"
+     fi
+     if test -d $withval/lib; then
+       LDFLAGS="$LDFLAGS -L$withval/lib"
+     fi
+     TERMXLIBS="$X_LIBS -lXaw -lXmu -lXt -lXext -lX11"
+     AC_CHECK_LIB(plot,pl_textangle,
+       [TERMLIBS="-lplot $TERMLIBS"
+        AC_DEFINE(GNUGRAPH,1,
+                  [ Define if you want to use the GNU version of the Unix plot library. ])],
+       [AC_MSG_WARN([GNU plotutils v2.2 or newer required -- disabling gnugraph terminal])
+        TERMXLIBS=
+        with_plot=no],
+       [$TERMXLIBS])
+   fi])
+dnl end libplot
+
+dnl check presence of z library
+dnl TODO: path to zlib includes; -lz -lm specified multiple times
+dnl       we don't do anything about missing png/gd includes either
+AC_CHECK_LIB(z,deflate,
+  [TERMLIBS="$TERMLIBS -lz"
+   AC_DEFINE(HAVE_LIBZ,1,[ Define if you have zlib. ])
+   AC_CHECK_HEADER(zlib.h,,
+     [AC_MSG_WARN([found z library but not zlib.h
+please add path to zlib.h to CPPFLAGS in Makefile])])],
+  AC_MSG_WARN([zlib is required - see http://www.gzip.org/zlib/]))
+
+dnl check presence of gd library
+dnl we don't check for libfreetype and libjpeg locations - if gd requires
+dnl them, the gdlib-config scipt contains all the required information
+AC_ARG_WITH(gd,dnl
+[  --with-gd[=DIR]         where to find Tom Boutell's gd library],,
+  with_gd=yes)
+
+if test "$with_gd" != no; then
+  AC_PATH_PROG([GDLIB_CONFIG], [gdlib-config])
+  if test -n "$GDLIB_CONFIG"; then
+    libgd_CPPFLAGS=`gdlib-config --cflags`
+    libgd_LDFLAGS=`gdlib-config --ldflags`
+  elif test -d "$with_gd"; then
+    libgd_CPPFLAGS="-I$with_gd/include"
+    libgd_LDFLAGS="-L$with_gd/lib"
+  fi
+
+  _cppflags="$CPPFLAGS"
+  _ldflags="$LDFLAGS"
+  CPPFLAGS="$CPPFLAGS $libgd_CPPFLAGS"
+  LDFLAGS="$LDFLAGS $libgd_LDFLAGS"
+
+  AC_CHECK_LIB(gd,gdImageCreate,
+    [dnl found gd library
+     AC_DEFINE(HAVE_LIBGD,1,[ Define if you have gd library. ])
+     AC_CHECK_HEADERS(gd.h,,
+       AC_MSG_WARN([please add path to gd.h to CPPFLAGS in Makefile]))
+
+     dnl gif support in libgd
+     AC_CHECK_LIB(gd,gdImageGif,
+       [AC_DEFINE(HAVE_GD_GIF,1,[ Define if libgd supports gif. ])])
+     AC_CHECK_LIB(gd,gdImageGifAnimBegin,
+       [AC_DEFINE(GIF_ANIMATION,1,[ Define if libgd supports animated gifs. ])])
+
+     _libs="$LIBS"
+     LIBS="$LIBS -ljpeg"
+     dnl jpeg support in libgd
+     AC_CHECK_LIB(gd,gdImageJpeg,
+       [AC_DEFINE(HAVE_GD_JPEG,1,[ Define if libgd supports jpeg. ])
+        libgd_LIBS="$libgd_LIBS -ljpeg"])
+
+     LIBS="$_libs $libgd_LIBS -lfreetype"
+     dnl freetype support in libgd
+     AC_CHECK_LIB(gd,gdImageStringFT,
+       [have_ttf=yes],
+       [AC_CHECK_LIB(gd,gdImageStringTTF,
+         [AC_DEFINE(gdImageStringFT,gdImageStringTTF,
+                    [ libgd versions < 1.8.4 need gdImageStringTTF rather than gdImageStringFT ])
+          have_ttf=yes])])
+
+     if test "$have_ttf" = yes; then
+       AC_DEFINE(HAVE_GD_TTF,1,
+                 [ Define if libgd supports TrueType fonts through libfreetype. ])
+       libgd_LIBS="$libgd_LIBS -lfreetype"
+     fi
+
+     LIBS="$_libs $libgd_LIBS -lpng"
+     dnl png support in libgd
+     AC_CHECK_LIB(gd,gdImagePng,
+       [AC_DEFINE(HAVE_GD_PNG,1,[ Define if libgd supports png. ])
+        libgd_LIBS="$libgd_LIBS -lpng"])
+     LIBS="$_libs"
+
+    ],[dnl gd library not found
+       with_gd=no
+    ])
+
+  if test -n "$GDLIB_CONFIG"; then
+    libgd_LIBS=`gdlib-config --libs`
+  fi
+
+  dnl piece it all together
+  if test "$with_gd" = no; then
+    CPPFLAGS="$_cppflags"
+    LDFLAGS="$_ldflags"
+  else
+    TERMLIBS="$TERMLIBS -lgd $libgd_LIBS"
+  fi
+
+fi
+dnl end gd
+
+dnl The Portable Document Format (PDF) terminal
+AC_ARG_WITH(pdf,dnl
+[  --with-pdf[=DIR]        enable pdf terminal 
+                          (requires PDFLib)],,
+  with_pdf=yes)
+
+if test "$with_pdf" != no; then
+  AC_PATH_PROG([PDFLIB_CONFIG], [pdflib-config])
+  if test -n "$PDFLIB_CONFIG"; then
+    libpdf_CPPFLAGS=`pdflib-config --cflags`
+    # D'oh - libraries don't belong here
+    libpdf_LDFLAGS=`pdflib-config --ldflags |sed 's/ -l[[^ ]][[^ ]]*//g'`
+  elif test -d "$with_pdf"; then
+    libpdf_CPPFLAGS="-I$with_pdf/include"
+    libpdf_LDFLAGS="-L$with_pdf/lib"
+  fi
+
+  _cppflags="$CPPFLAGS"
+  _ldflags="$LDFLAGS"
+  _libs="$LIBS"
+  CPPFLAGS="$CPPFLAGS $libpdf_CPPFLAGS"
+  LDFLAGS="$LDFLAGS $libpdf_LDFLAGS"
+
+  AC_CHECK_LIB(pdf,PDF_get_majorversion,
+    [AC_DEFINE(HAVE_LIBPDF,1,[ Define if you have the pdf library. ])
+     AC_CHECK_HEADERS(pdflib.h,,
+       AC_MSG_WARN([please add path to pdflib.h to CPPFLAGS in Makefile]))
+    ],
+    with_pdf=no)
+
+  if test "$with_pdf" != no; then
+    AC_CHECK_LIB(pdf,PDF_begin_pattern, ,
+      [AC_DEFINE(HAVE_OLD_LIBPDF,1,[ Define if your pdf library is too old to support patterns. ])
+      AC_MSG_WARN([your version of libpdf is too old!])
+      ])
+  fi
+
+  if test "$with_pdf" != no; then
+    AC_CHECK_LIB(pdf,PDF_setdashpattern, ,
+      [AC_DEFINE(HAVE_NODASH_LIBPDF,1,[ Define if your pdf library doesn't support dash patterns. ])
+      AC_MSG_WARN([your version of libpdf is too old!])
+      ])
+  fi
+
+  if test "$with_pdf" != no; then
+    AC_CHECK_LIB(pdf,PDF_begin_document, ,
+      [AC_DEFINE(HAVE_LIBPDF_OPEN_FILE,1,[ Define if your pdf library is too old to use PDF_begin_document. ])
+      AC_MSG_WARN([your version of libpdf is rather old.])
+      ])
+  fi
+
+  LIBS="$_libs"
+  if test "$with_pdf" = no; then
+    CPPFLAGS="$_cppflags"
+    LDFLAGS="$_ldflags"
+  else
+    TERMLIBS="$TERMLIBS -lpdf"
+  fi
+
+fi
+dnl end pdf
+
+dnl How do we detect the Ultrix X libraries?
+dnl Or is it really a server (run-time) problem?
+dnl FIXME AC_DEFINE(ULTRIX_KLUDGE)
+
+dnl Removed enable options for these
+dnl Just autodetect
+
+dnl SCO cgi
+AC_EGREP_CPP(yes,
+[#ifdef SCO
+yes
+#endif
+],AC_CHECK_LIB(ccgi, v_opnwk,
+    [AC_DEFINE(CGI,1,[ Define if you want to use the CGI terminal under SCO. ])
+     TERMLIBS="-lccgi $TERMLIBS"]))
+
+dnl Sun sunview
+AC_EGREP_CPP(yes,
+[#ifdef sun
+yes
+#endif
+],[AC_CHECK_LIB(suntool, window_create,
+     [AC_CHECK_HEADER(suntool/sunview.h,
+        [AC_DEFINE(SUN,1,
+                   [ Define if you want to use the sunview terminal (sun). ])
+         TERMLIBS="-lsuntool -lsunwindow -lpixrect $TERMLIBS"])],,
+    [-lsunwindow -lpixrect])])
+
+dnl Process rest of with and enable options
+
+dnl Use .gnuplot file in current directory
+AC_ARG_WITH(cwdrc,dnl
+[  --with-cwdrc            check current directory for .gnuplot file,
+                          normally disabled for security reasons],,
+  [if test "$withval" = yes; then
+     AC_DEFINE(NOCWDRC,1,
+               [ Define if you do not want to read .gnuplot in the current directory. ])
+   fi])
+
+dnl Whether we want to build the lisp files
+dnl Does nothing here, is passed on to the lisp subdir
+AC_ARG_WITH(lisp-files,dnl
+[  --without-lisp-files    do not build emacs lisp files])
+
+dnl Sort help/subtopic tables by row or column
+AC_ARG_WITH(row-help,dnl
+[  --with-row-help         format help and subtopic tables by row (default)
+  --without-row-help      format help and subtopic tables by column],
+  [if test "$with_row_help" = no; then
+     AC_DEFINE(COLUMN_HELP,1,
+               [ Define if you want online help and subtopic tables sorted by column. ])
+   fi])
+
+dnl Whether we want to create the LaTeX tutorial
+TUTORIAL=tutorial
+AC_ARG_WITH(tutorial,dnl
+[  --without-tutorial      do not build LaTeX tutorial])
+dnl only if latex/2e is found
+if test "$LATEX" = no -o "$with_tutorial" = no ; then
+  TUTORIAL=notutorial
+  with_tutorial=no
+fi
+
+dnl use mouse for x11 interface
+AC_ARG_ENABLE(mouse,dnl
+[  --disable-mouse         disable mouse for the x11 terminal],,
+  test -z "$enable_mouse" && enable_mouse=yes)
+
+if test "$enable_mouse" = yes; then
+  AC_DEFINE(USE_MOUSE,1,
+            [ Define if you want to have mouse support for the x11 terminal. ])
+  AC_DEFINE(PIPE_IPC,1,
+            [ Unix-type of Interprocess Communication is required for mouse support. ])
+fi
+
+dnl enable multi-byte font support in x11 terminal
+AC_ARG_ENABLE(x11-mbfonts,dnl
+[  --disable-x11-mbfonts   disable multi-byte font support for x11 ],,
+  test -z "$enable_x11_mbfonts" && enable_x11_mbfonts=yes)
+  if test "$enable_x11_mbfonts" = yes; then
+
+    _ldflags="$LDFLAGS"
+    LDFLAGS="$LDFLAGS $LIBRARIES_FOR_X"
+
+    AC_MSG_CHECKING([for multi-byte support in x11])
+    AC_CHECK_LIB(X11, XmbDrawString,
+      AC_DEFINE(USE_X11_MULTIBYTE,1,[ Define to enable multi-byte font support for x11 ]),
+      enable_x11_mbfonts=no )
+    
+    LDFLAGS="$_ldflags"
+  
+  fi
+
+dnl binary_data_file
+AC_ARG_ENABLE(binary_data_file,dnl
+[  --disable-binary-data-file          disable binary_data_file],,
+  test -z "$enable_binary_data_file" && enable_binary_data_file=yes)
+
+if test "$enable_binary_data_file" = yes; then
+  AC_DEFINE(BINARY_DATA_FILE,1,[ Define if you want to support files in binary format. ])
+fi
+
+AM_CONDITIONAL(INCLUDE_BINARY_C, test "$enable_binary_data_file" = no)
+
+dnl with_image
+AC_ARG_ENABLE(with_image,dnl
+[  --disable-with-image          disable image support],,
+  test -z "$enable_with_image" && enable_with_image=yes)
+
+if test "$enable_with_image" = yes; then
+  if test "$enable_binary_data_file" = yes; then
+    AC_DEFINE(WITH_IMAGE,1,[ Define if you want to have image plotting support. ])
+  else
+    enable_with_image=no
+    AC_MSG_WARN( [The with-image option requires --enable-binary-data-file. ])
+  fi
+fi
+
+dnl binary_x11_polygon
+AC_ARG_ENABLE(binary_x11_polygon,dnl
+[  --disable-binary-x11-polygon        disable binary_x11_polygon],,
+  test -z "$enable_binary_x11_polygon" && enable_binary_x11_polygon=yes)
+
+if test "$enable_binary_x11_polygon" = yes; then
+  AC_DEFINE(BINARY_X11_POLYGON,1,[ Define if you want the x11 driver to transfer polygon information in binary format. ])
+fi
+
+dnl check for installed linux vgagl lib if
+dnl both linux_vga is defined.
+if test "$with_linux_vga" = yes; then
+  _LIBS="$LIBS"
+  dnl make sure LIBS contains -lvga
+  LIBS="$TERMLIBS $LIBS"
+  AC_MSG_CHECKING(for the vgagl library)
+  AC_CHECK_LIB(vgagl, gl_hline,
+    [LIBS="-lvgagl $LIBS"
+     AC_CHECK_HEADERS(vgagl.h,
+      [AC_DEFINE(VGAGL,1,[ Define if the vgagl libray is present. ])
+       dnl yup, we've the libvgagl.
+       dnl check now, if lib3dkit is found.
+       AC_CHECK_LIB(3dkit, gl_striangle,
+         [AC_CHECK_HEADERS(3dkit.h,
+            [dnl success! If we're here, all checks for
+             dnl the vgagl terminal driver succeeded.
+             AC_DEFINE(THREEDKIT,1,[ Define if the 3dkit libray is present. ])
+             AC_DEFINE(EXTENDED_COLOR_SPECS,1,
+                       [ Define if color information should be passed for each vertex. ])
+             VGAGLLIB="-l3dkit -lvgagl"
+             with_vgagl=yes
+            ],dnl <-- 3dkit.h found
+            [with_vgagl=no
+             AC_MSG_RESULT([unable to find 3dkit.h])
+            ]dnl <-- 3dkit.h not found
+          )
+         ],dnl <-- 3dkit is present
+         [
+          with_vgagl=no
+          AC_MSG_RESULT([unable to find lib3dkit])
+         ]dnl <-- 3dkit is not present
+       )
+      ],dnl <-- vgagl.h is present
+      [
+       with_vgagl=no
+       AC_MSG_RESULT([unable to find vgagl.h])
+      ]dnl <-- vgagl.h is not present
+     )
+    ],dnl <-- libvgagl was found
+    [with_vgagl=no
+     AC_MSG_RESULT([unable to find libvgagl])
+    ]dnl <-- libvgagl was not found
+  )
+  dnl restore LIBS
+  LIBS="$_LIBS"
+else
+  with_vgagl=no
+fi
+
+TERMLIBS="$VGAGLLIB $TERMLIBS"
+
+dnl thin plate splines patch
+AC_ARG_ENABLE(thin-splines,dnl
+[  --enable-thin-splines   enable thin plate splines],
+  [if test "$enableval" = yes; then
+     AC_DEFINE(THIN_PLATE_SPLINES_GRID,1,
+               [ Define to use thin plate spines. ])
+   fi])
+
+dnl strings in datafile
+AC_ARG_ENABLE(datastrings,dnl
+[  --disable-datastrings   disable reading strings from datafiles],,
+  test -z "$enable_datastrings" && enable_datastrings=yes)
+
+  if test "$enable_datastrings" = yes; then
+  AC_DEFINE(EAM_DATASTRINGS,1,
+               [ Define to allow reading strings from datafiles ])
+  fi
+
+dnl histograms
+AC_ARG_ENABLE(histograms,dnl
+[  --disable-histograms    disable histograms plot style ],,
+  test -z "$enable_histograms" && enable_histograms=yes)
+  if test "$enable_histograms" = yes; then
+
+    if test "$enable_datastrings" = yes; then
+      AC_DEFINE(EAM_HISTOGRAMS, 1,
+               [ Define to enable histograms plot style. ])
+    else
+      enable_histograms=no
+      AC_MSG_WARN( [The --enable-histograms option requires --enable-datastrings. ])
+    fi
+
+  fi
+
+dnl rectangles and other objects
+AC_ARG_ENABLE(objects,dnl
+[  --disable-objects       disable rectangles and other objects ],,
+  test -z "$enable_objects" && enable_objects=yes)
+
+  if test "$enable_objects" = yes; then
+  AC_DEFINE(EAM_OBJECTS,1,
+               [ Define to allow placement of rectangles and other objects ])
+  fi
+
+dnl string variables
+AC_ARG_ENABLE(stringvariables,dnl
+[  --disable-stringvariables   disable string variables],,
+  test -z "$enable_stringvariables" && enable_stringvariables=yes)
+  if test "$enable_stringvariables" = yes; then
+  AC_DEFINE(GP_STRING_VARS,2,
+               [ Define to allow string variables. ])
+  fi
+
+dnl command line macros
+AC_ARG_ENABLE(macros,dnl
+[  --disable-macros        disable command line macros],,
+  test -z "$enable_macros" && enable_macros=yes)
+  if test "$enable_macros" = yes; then
+
+    if test "$enable_stringvariables" = yes; then
+      AC_DEFINE(GP_MACROS,1,
+               [ Define to allow command line macros. EXPERIMENTAL ])
+    else
+      enable_macros=no
+      AC_MSG_WARN( [The --enable-macros option requires --enable-stringvariables. ])
+    fi
+
+  fi
+
+dnl IRIS terminal on IRIS4D series computer
+AC_ARG_ENABLE(iris,dnl
+[  --enable-iris           enable IRIS terminal (IRIS4D only)],
+  [if test "$enableval" = yes; then
+     AC_CHECK_LIB(gl_s,winopen,
+       [AC_DEFINE(IRIS,1,
+                  [ Define if you want to use the IRIS terminal on IRIS4D series computers. ])
+        TERMLIBS="-lgl_s $TERMLIBS"],
+       enable_iris=no)
+   fi])
+
+dnl MGR Window system
+AC_ARG_ENABLE(mgr,dnl
+[  --enable-mgr            enable MGR terminal],
+  [if test "$enableval" = yes; then
+     AC_CHECK_LIB(mgr,m_getinfo,
+       [AC_DEFINE(MGR,1,[ Define if you want to use the MGR Window system. ])
+        TERMLIBS="-lmgr -lpixrect $TERMLIBS"],
+       enable_mgr=no,
+       [-lpixrect])
+   fi])
+
+dnl fitting error variables
+AC_ARG_ENABLE(fiterrvars,dnl
+[  --disable-fiterrvars    disable fitting error variables],,
+  [test -z "${enable_fiterrvars}" && enable_fiterrvars=yes])
+if test "$enable_fiterrvars" = yes; then
+  AC_DEFINE(GP_FIT_ERRVARS, 1,
+            [ Define to allow 'fit' to create parameter error variables. ])
+fi
+
+dnl Redwood Graphics Interface Protocol
+AC_ARG_ENABLE(rgip,dnl
+[  --enable-rgip           enable Redwood Graphics Interface Protocol],
+  [if test "$enableval" = yes; then
+     AC_DEFINE(RGIP,1,
+               [ Define if you want to use the Redwood Graphics Interface Protocol. ])
+   fi])
+
+dnl hidden3d compile-time options...
+dnl NOTE: have to check that they're not both turned on --- the code
+dnl doesn't allow that choice.
+AC_ARG_ENABLE(h3d-quadtree,dnl
+[  --disable-h3d-quadtree   disable quadtree optimization in hidden3d code],,
+  [test -z "${enable_h3d_quadtree}" && enable_h3d_quadtree=yes])
+if test "$enable_h3d_quadtree" = yes; then
+     AC_DEFINE(HIDDEN3D_QUADTREE,1,
+              [ Define to enable quadtree optimization in hidden3d code.])
+fi
+
+AC_ARG_ENABLE(h3d-gridbox,dnl
+[  --enable-h3d-gridbox    enable gridbox optimization in hidden3d code],
+  [if test "$enable_h3d_quadtree" = yes; then
+     AC_MSG_ERROR(dnl
+[Only one of the hidden3d options quadtree and gridbox may be enabled.])
+   fi
+   if test "$enableval" = yes; then
+     AC_DEFINE(HIDDEN3D_GRIDBOX,1,
+               [ Define to enable gridbox optimization in hidden3d code.])
+   fi])
+
+AC_DEFINE(HIDDEN3D_VAR_PTSIZE,1,
+       [ Define to enable handling point size in hidden3d code.])
+
+
+dnl
+if test ! -f src/graphics.c ; then
+  AC_MSG_RESULT([Compiling outside source directory - copying needed files])
+  mkdir tutorial >/dev/null 2>&1
+  cp ${srcdir}/tutorial/eg3.dat tutorial
+fi
+
+dnl  wxWidgets terminal
+
+dnl wxWidgets terminal needs C++
+dnl These tests cannot be called conditionally.
+dnl These tests are non-fatal on autoconf 2.58 and 2.59,
+dnl but it may change in future versions, so we redefine AC_MSG_ERROR.
+dnl Even if there is no C++ compiler on the system,
+dnl autoconf will set CXX as g++ : this must be reverted.
+
+m4_pushdef([AC_MSG_ERROR],[cxxerror=yes])
+AC_PROG_CXX
+m4_popdef([AC_MSG_ERROR])
+
+if test "x${cxxerror}" != "xyes"; then
+  AC_LANG_PUSH([C++])
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iostream>]],
+       [[const char hw[] = "Hello, World\n"; std::cout << hw;]])],
+       [cxxerror=no
+       AC_PROG_CXXCPP],
+       [cxxerror=yes
+       CXX=$CC])
+  AC_LANG_POP([C++])
+fi
+
+AC_ARG_ENABLE(wxwidgets,dnl
+[  --disable-wxwidgets      wxWidgets terminal (default enabled)],,
+  [test -z "${enable_wxwidgets}" && enable_wxwidgets=yes])
+
+if test "${enable_wxwidgets}" = yes ; then
+  dnl variable used to determine if all checks pass
+  enable_wxwidgets_ok=yes
+
+  dnl Check for the C++ compiler
+  if test "x${cxxerror}" = "xyes"; then
+    AC_MSG_WARN([No C++ compiler found. The wxWidgets terminal will not be compiled.])
+      enable_wxwidgets_ok=no
+  fi
+
+  dnl The user can specify another path for wx-config
+  WXWIDGETS_PATH="${PATH}"
+  AC_ARG_WITH(wx-config,dnl
+  [--with-wx-config=PATH   Use the given path to wx-config, the wxWidgets configuration program
+    (default search in $PATH)],
+    [ if test "${with_wx_config}" != "no" ; then
+       WXWIDGETS_PATH="${with_wx_config}:${PATH}"
+     fi ])
+
+  dnl Look for wx-config in the path
+  AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWIDGETS_PATH})
+  if test "${WX_CONFIG}" = "no"; then
+    AC_MSG_WARN([wxWidgets can't be found. You can try --with-wx-config-path to give the right path to wx-config. The wxWidgets terminal will not be compiled.])
+    enable_wxwidgets_ok=no
+  else
+
+    dnl Ckeck for wxWidgets version
+    if expr 2.5.3 \> `${WX_CONFIG} --version` >/dev/null; then
+      AC_MSG_WARN([Your development package for wxWidgets is too old, you need at least version 2.5.3. The wxWidgets terminal will not be compiled.])
+      enable_wxwidgets_ok=no
+    fi
+  fi
+
+  dnl Check for Cairo
+  PKG_CHECK_MODULES(CAIROPANGO, [cairo >= 0.9.0 pango >= 1.10 pangocairo >= 1.10],
+    [HAVE_CAIROPANGO=1], dnl not used, but may solve problems with some pkg-config
+    [if test $pkg_failed = yes; then
+       AC_MSG_WARN(dnl
+[Package requirements (cairo >= 0.9.0 pango >= 1.10 pangocairo >= 1.10) for the
+wxWidgets terminal were not met:
+
+$CAIROPANGO_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you can avoid the need to call pkg-config if you set the
+environment variables CAIROPANGO_CFLAGS and CAIROPANGO_LIBS to the
+corresponding flags for cairo, pango, and pangocairo.
+See the pkg-config man page for more details.
+
+The wxWidgets terminal will not be compiled.])
+    elif test $pkg_failed = untried; then
+       AC_MSG_WARN(dnl
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you can avoid the need to call pkg-config if you set the
+environment variables CAIROPANGO_CFLAGS and CAIROPANGO_LIBS to the
+corresponding flags for cairo, pango, and pangocairo.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+
+The wxWidgets terminal will not be compiled.])
+    fi
+    enable_wxwidgets_ok=no])
+
+  dnl Check for buggy Pango 1.10.2
+  PKG_CHECK_MODULES(PANGO_1_10_2, [pango = 1.10.2],
+    [AC_MSG_WARN(dnl
+[Pango 1.10.2 has been found. This version has a bug which gives unexpected
+results in the wxWidgets terminal. If you want to use this terminal, please
+install a different version of Pango.])
+    enable_wxwidgets_ok=no],
+    [AC_MSG_RESULT([no])
+    HAVE_PANGO_1_10_2=0])
+fi
+
+if test "${enable_wxwidgets_ok}" = yes ; then
+  WX_CXXFLAGS="`$WX_CONFIG --cxxflags | sed 's/-fno-exceptions//'` $CAIROPANGO_CFLAGS"
+  WX_LIBS="`$WX_CONFIG --libs` $CAIROPANGO_LIBS"
+
+  dnl Check for fork(), used for the 'persist' effect
+  AC_FUNC_FORK
+
+  dnl Check for gtk (raise/lower tweaks)
+  PKG_CHECK_MODULES(GTK, [gtk+-2.0], have_gtk=yes, have_gtk=no)
+  if  test "${have_gtk}" = yes ; then
+    AC_DEFINE(HAVE_GTK, 1, [Define to use gtk/gdk tweaks])
+    WX_CXXFLAGS="$WX_CXXFLAGS $GTK_CFLAGS"
+    WX_LIBS="$WX_LIBS $GTK_LIBS"
+  fi
+
+  dnl Check for gtk>2.8 for direct rendering to screen
+  PKG_CHECK_MODULES(GTK28, [gtk+-2.0 >= 2.8.0], have_gtk28=yes, have_gtk28=no)
+  if  test "${have_gtk28}" = yes ; then
+    AC_DEFINE(HAVE_GTK28, 1, [Define to use gtk+ functions to handle cairo])
+  fi
+
+  CPPFLAGS="$CPPFLAGS $CAIROPANGO_CFLAGS"
+  CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS"
+  AC_SUBST(WX_LIBS)
+  AC_DEFINE(WXWIDGETS,1, [ Define if you want the wxwidgets terminal. ])
+fi
+
+AM_CONDITIONAL(BUILD_WXWIDGETS, test "${enable_wxwidgets_ok}" = yes)
+
+dnl  End wxWidgets terminal
+
+dnl Enable parsing of deprecated syntax
+AC_ARG_ENABLE(backwards-compatibility,dnl
+[  --disable-backwards-compatibility       disable deprecated syntax ],,
+  test -z "$enable_backwards_compatibility" && enable_backwards_compatibility=yes)
+
+  if test "$enable_backwards_compatibility" = yes; then
+  AC_DEFINE(BACKWARDS_COMPATIBLE,1,
+               [ Define to allow use of deprecated syntax and terminal behaviour ])
+  fi
+
+dnl build lisp files
+if test "$with_lisp_files" != no; then
+  AC_CONFIG_SUBDIRS(lisp)
+  LISPDIR=lisp
+else
+  LISPDIR=
+fi
+AC_SUBST(LISPDIR)
+
+dnl Substitute variables
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION_MAJOR)
+AC_SUBST(VERSION)
+AC_SUBST(GIHDIR)
+AC_SUBST(LASERGNU)
+AC_SUBST(LINUXSUID)
+AC_SUBST(TERMLIBS)
+AC_SUBST(TERMXLIBS)
+AC_SUBST(TUTORIAL)
+
+dnl Write Makefiles and configuration header
+AC_OUTPUT([Makefile
+           config/Makefile
+           demo/Makefile
+           docs/Makefile
+           m4/Makefile
+           man/Makefile
+           share/Makefile
+           share/LaTeX/Makefile
+           src/Makefile
+           src/beos/Makefile
+           src/wxterminal/Makefile
+           term/Makefile
+          maemo/Makefile
+           tutorial/Makefile],
+          [test -z "$CONFIG_HEADERS" || echo timestamp >stamp-h])
+
+dnl Report configuration
+dnl Rationale:
+dnl - if something is disabled by default, show arguments to use to enable.
+dnl - if something has particular dependencies, show them all when they are
+dnl missing (the detailed output will give more details anyway).
+dnl The goal is to give sensible and easily accessible information to users
+dnl and packagers.
+
+AC_MSG_RESULT([])
+AC_MSG_RESULT([** Configuration summary for $PACKAGE $VERSION:])
+AC_MSG_RESULT([])
+
+AC_MSG_RESULT([gnuplot will be compiled with the following terminals:])
+AC_MSG_RESULT([])
+
+AC_MSG_RESULT([  Standalone terminals: yes (always builtin)])
+AC_MSG_RESULT([    (aed512, aed767, aifm, bitgraph, cgm, corel, dumb, dxf, eepic, emf, emtex,])
+AC_MSG_RESULT([    epslatex, epson_180dpi, epson_60dpi, epson_lx800, fig, gpic, hp2623A,])
+AC_MSG_RESULT([    hp2648, hp500c, hpdj, hpgl, hpljii, hppj, imagen, kc_tek40xx, km_tek40xx,])
+AC_MSG_RESULT([    latex, metafont, metapost, mif, pbm, postscript, pslatex, nec_cp6, okidata,])
+AC_MSG_RESULT([    pcl5, pstex, pstricks, qms, regis, selanar, svg, starc, tandy_60dpi,])
+AC_MSG_RESULT([    tek40xx, tek410x, texdraw, tgif, tkcanvas, tpic, vttek)])
+
+if test "$no_x" != yes; then
+  if test "$enable_mouse" = yes; then
+    AC_MSG_RESULT([  x11/xlib terminal: yes (with mouse support)])
+  else
+    AC_MSG_RESULT([  x11/xlib terminal: yes (without mouse support)])
+  fi
+  if test "$enable_x11_mbfonts" = yes; then
+    AC_MSG_RESULT([    (with multi-byte fonts)])
+  else
+    AC_MSG_RESULT([    (without multi-byte fonts, requires support in libX11)])
+  fi
+  if test "$enable_binary_x11_polygon" = yes; then
+    AC_MSG_RESULT([    (with binary polygon protocol)])
+  else
+    AC_MSG_RESULT([    (without binary polygon protocol)])
+  fi
+else
+    AC_MSG_RESULT([  X Window System terminal: no (requires X libraries)])
+fi
+
+if test "$ac_cv_lib_gd_gdImageJpeg" = yes; then
+  AC_MSG_RESULT([  jpeg terminal: yes])
+else
+  AC_MSG_RESULT([  jpeg terminal: no (requires libgd with jpeg support)])
+fi
+
+if test "$ac_cv_lib_gd_gdImageGif" = yes; then
+  if test "$ac_cv_lib_gd_gdImageGifAnimBegin" = yes; then
+    AC_MSG_RESULT([  gif terminal: yes (with animated gif)])
+  else
+    AC_MSG_RESULT([  gif terminal: yes (without animated gif, requires libgd support)])
+  fi
+else
+  AC_MSG_RESULT([  gif terminal: no (requires libgd with gif support)])
+fi
+
+
+if test "$ac_cv_lib_gd_gdImagePng" = yes; then
+  AC_MSG_RESULT([  png terminal: yes])
+else
+  AC_MSG_RESULT([  png terminal: no (requires libgd with png support)])
+fi
+
+if test "$have_ttf" = yes; then
+  AC_MSG_RESULT([    (jpeg, gif and png terminals can use TTF fonts)])
+else
+  AC_MSG_RESULT([    (jpeg, gif and png terminals cannot use TTF fonts, requires libgd support)])
+fi
+
+if test "$ac_cv_header_pdflib_h" = yes; then
+  AC_MSG_RESULT([  pdf terminal: yes])
+  if test "$ac_cv_lib_pdf_PDF_begin_pattern" != yes; then
+    AC_MSG_RESULT([      (pattern fills not supported, libpdf too old)])
+  fi
+  if test "$ac_cv_lib_pdf_PDF_setdashpattern" != yes; then
+    AC_MSG_RESULT([      (dash patterns not supported, libpdf too old)])
+  fi
+else
+  AC_MSG_RESULT([  pdf terminal: no (requires libpdf)])
+fi
+
+if test x"$with_plot" != x; then
+  if test "$with_plot" = yes; then
+    AC_MSG_RESULT([  plot library terminal: yes (unixplot - UNIX version)])
+  elif test "$with_plot" != no; then
+    AC_MSG_RESULT([  plot library terminal: yes (gnugraph - GNU version)])
+  else
+    AC_MSG_RESULT([  plot library terminal: no (requires GNU plotutils or UNIX plot)])
+  fi
+else
+    AC_MSG_RESULT([  plot library terminal: no (use --with-plot to enable, requires GNU plotutils])
+    AC_MSG_RESULT([                             or UNIX plot)])
+fi
+
+if test "$with_linux_vga" = yes; then
+    AC_MSG_RESULT([  linux terminal (vga console): yes])
+  if test "$with_vgagl" = yes; then
+    AC_MSG_RESULT([  vgagl terminal ((s)vga console): yes])
+  else
+    AC_MSG_RESULT([  vgagl terminal ((s)vga console): no (requires vgagl)])
+  fi
+  AC_MSG_RESULT([    SECURITY NOTICE: SVGAlib requires that gnuplot is installed suid root!])
+else
+  AC_MSG_RESULT([  linux terminal (vga console): no (use --with-linux-vga to enable,])
+  AC_MSG_RESULT([                                       requires SVGAlib)])
+  AC_MSG_RESULT([  vgagl terminal ((s)vga console): no (use --with-linux-vga to enable,])
+  AC_MSG_RESULT([                                       requires SVGAlib with vgagl)])
+fi
+
+if test "$GGI_SUPPORT" = yes; then
+  if test "$ac_cv_header_ggi_xmi_h" = yes; then
+    AC_MSG_RESULT([  ggi terminal: yes (EXPERIMENTAL) (with pm3d support)])
+  else
+    AC_MSG_RESULT([  ggi terminal: yes (EXPERIMENTAL) (without pm3d support, requires libxmi)])
+  fi
+else
+  AC_MSG_RESULT([  ggi terminal: no (use --with-ggi to enable, requires libggi)])
+fi
+
+if test "$enable_iris" = yes; then
+  AC_MSG_RESULT([  iris4d terminal: yes])
+else
+  AC_MSG_RESULT([  iris4d terminal: no (use --enable-iris to enable, requires libgl_s)])
+fi
+
+if test "$enable_mgr" = yes; then
+  AC_MSG_RESULT([  mgr terminal: yes])
+else
+  AC_MSG_RESULT([  mgr terminal: no (use --enable-mgr to enable, requires libpixrect)])
+fi
+
+if test "$enable_rgip" = yes ; then
+  AC_MSG_RESULT([  rgip/uniplex terminal: yes])
+else
+  AC_MSG_RESULT([  rgip/uniplex terminal: no (use --enable-rgip to enable)])
+fi
+
+if test "$is_msdos" = yes; then
+  AC_MSG_RESULT([  svga terminal (MSDOS/djgpp): yes])
+else
+  AC_MSG_RESULT([  svga terminal (MSDOS/djgpp): no])
+fi
+
+if test "$build_src_beos_subdir" = yes; then
+  AC_MSG_RESULT([  be terminal (BeOS): yes])
+else
+  AC_MSG_RESULT([  be terminal (BeOS): no])
+fi
+
+if test "$is_next" = yes; then
+  AC_MSG_RESULT([  next terminal: yes])
+else
+  AC_MSG_RESULT([  next terminal: no])
+fi
+
+if test "$is_apple" = yes; then
+  AC_MSG_RESULT([  aqua terminal (MacOS X): yes])
+else
+  AC_MSG_RESULT([  aqua terminal (MacOS X): no])
+fi
+
+if test "$enable_wxwidgets_ok" = yes; then
+  AC_MSG_RESULT([  wxt terminal: yes ])
+else
+  AC_MSG_RESULT([  wxt terminal: no (requires C++, wxWidgets>2.6, cairo>0.9, pango>1.10)])
+fi
+
+AC_MSG_RESULT([])
+AC_MSG_RESULT([  Additional terminals are availaible in platform-specific makefiles:])
+AC_MSG_RESULT([   amiga (makefile.amg and makefile.ami), apollo/gpr (makefile.unx), atari/vdi])
+AC_MSG_RESULT([   (makefile.st), cgi (makefile.unx), mtos (makefile.mto), pm (makefile.os2),])
+AC_MSG_RESULT([   sun (makefile.unx), unixpc (makefile.unx), windows (various Windows])
+AC_MSG_RESULT([   makefiles)])
+
+AC_MSG_RESULT([  Additional terminals are built automatically if possible at compile-time:])
+AC_MSG_RESULT([   vesa (MSDOS), emxvga (MSDOS, OS/2), ega/vga/svga/ssvga/hercules (Windows with])
+AC_MSG_RESULT([   Zortec compiler), macintosh])
+
+
+AC_MSG_RESULT([])
+AC_MSG_RESULT([gnuplot will be compiled with the following features:])
+AC_MSG_RESULT([])
+
+if test "$enable_fiterrvars" = yes; then
+  AC_MSG_RESULT([  Fitting error variables: yes])
+else
+  AC_MSG_RESULT([  Fitting error variables: no])
+fi
+
+if test "$enable_datastrings" = yes; then
+  AC_MSG_RESULT([  String-handling in datafiles: yes])
+else
+  AC_MSG_RESULT([  String-handling in datafiles: no])
+fi
+
+if test "$enable_histograms" = yes; then
+  AC_MSG_RESULT([  Plot style histograms: yes])
+else
+  AC_MSG_RESULT([  Plot style histograms: no (requires string-handling in datafiles)])
+fi
+
+if test "$enable_stringvariables" = yes; then
+  AC_MSG_RESULT([  String variables: yes])
+else
+  AC_MSG_RESULT([  String variables: no])
+fi
+
+if test "$enable_macros" = yes; then
+  AC_MSG_RESULT([  Command line macros: yes (EXPERIMENTAL)])
+else
+  AC_MSG_RESULT([  Command line macros: no (requires string variables)])
+fi
+
+if test "$enable_objects" = yes; then
+  AC_MSG_RESULT([  Placement of rectangles and other objects: yes (EXPERIMENTAL)])
+else
+  AC_MSG_RESULT([  Placement of rectangles and other objects: no])
+fi
+
+if test "$enable_with_image" = yes; then
+  AC_MSG_RESULT([  Plot style image: yes (EXPERIMENTAL)])
+else
+  AC_MSG_RESULT([  Plot style image: no])
+fi
+
+if test "$enable_binary_data_file" = yes; then
+  AC_MSG_RESULT([  General binary data file reading: yes (EXPERIMENTAL)])
+else
+  AC_MSG_RESULT([  General binary data file reading: no])
+fi
+
+AC_MSG_RESULT([])
+AC_MSG_RESULT([gnuplot will be compiled with the following options:])
+AC_MSG_RESULT([])
+
+if test "$with_readline" = no; then
+  AC_MSG_RESULT([  No readline support (use --with-readline=gnu or --with-readline=builtin)])
+fi
+
+  if test "$with_readline" = bsd; then
+    if test -n "$gp_tcap"; then
+      AC_MSG_RESULT([  Readline library: BSD editline with $gp_tcap])
+    else
+      AC_MSG_RESULT([  Readline library: BSD editline library])
+    fi
+  else if test "$with_readline" != builtin; then
+    if test -n "$gp_tcap"; then
+      AC_MSG_RESULT([  Readline library: GNU readline library with $gp_tcap])
+    else
+      AC_MSG_RESULT([  Readline library: GNU readline library])
+    fi
+  else
+    AC_MSG_RESULT([  Readline library: builtin minimal (use --with-readline=gnu for GNU readline)])
+  fi
+fi
+
+if test "$enable_history_file" = yes; then
+  AC_MSG_RESULT([  Command-line history file: yes])
+else
+  AC_MSG_RESULT([  Command-line history file: no])
+fi
+
+if test "$with_cwdrc" = yes; then
+  AC_MSG_RESULT([  Check current directory for .gnuplot file: yes])
+else
+  AC_MSG_RESULT([  Check current directory for .gnuplot file: no (use --with-cwdrc to enable)])
+fi
+
+if test "$with_row_help" = no; then
+  AC_MSG_RESULT([  Sort help/subtopic tables by column: yes])
+else
+  AC_MSG_RESULT([  Sort help/subtopic tables by column: no (use --without-row-help to enable)])
+fi
+
+if test "$with_kpsexpand" = yes; then
+  AC_MSG_RESULT([  Use TeX kpsexpand to search for fonts: yes])
+else
+  AC_MSG_RESULT([  Use TeX kpsexpand to search for fonts: no (use --with-kpsexpand to enable)])
+fi
+
+if test "$enable_thin_splines" = yes; then
+  AC_MSG_RESULT([  Thin plate splines: yes])
+else
+  AC_MSG_RESULT([  Thin plate splines: no (use --enable-thin-spline to enable)])
+fi
+
+if test "$enable_h3d_gridbox" = yes; then
+  AC_MSG_RESULT([  Hidden3d optimization: gridbox])
+else
+  if test "$enable_h3d_quadtree" = no; then
+    AC_MSG_RESULT([  Hidden3d optimization: none])
+  else
+    AC_MSG_RESULT([  Hidden3d optimization: quadtree])
+  fi
+fi
+
+if test "$enable_backwards_compatibility" = yes; then
+  AC_MSG_RESULT([  Deprecated syntax and terminal options : yes])
+else
+  AC_MSG_RESULT([  Deprecated syntax and terminal options : no (use --enable-backwards-compatibility to enable)])
+fi
+
+
+AC_MSG_RESULT([])
+AC_MSG_RESULT([gnuplot will install the following additional materials:])
+AC_MSG_RESULT([])
+
+if test "$with_lasergnu" = yes; then
+  AC_MSG_RESULT([  lasergnu printer script: yes])
+else
+  AC_MSG_RESULT([  lasergnu printer script: no (use --with-lasergnu to enable)])
+fi
+
+if test "$with_lisp_files" != no; then
+  AC_MSG_RESULT([  gnuplot-mode for X/Emacs: yes])
+else
+  AC_MSG_RESULT([  gnuplot-mode for X/Emacs: no])
+fi
+
+if test "$TUTORIAL" = tutorial; then
+  AC_MSG_RESULT([  LaTeX tutorial: yes])
+else
+  AC_MSG_RESULT([  LaTeX tutorial: no])
+fi
+
+AC_MSG_RESULT([  Help file: yes (always), in $GIHDIR/gnuplot.gih])
+
+AC_MSG_RESULT([  PostScript prologue files: yes (always)])
+
+dnl end config report
+
+dnl end configure.in