Icons are changed
[gnuplot] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl configure.in for gnuplot on Unix.
3 dnl
4 dnl $Id: configure.in,v 1.202.2.27 2009/08/29 17:51:19 sfeam Exp $
5 dnl
6 dnl this is actually major.minor ...
7 dnl note that for a non-beta release, we need to
8 dnl remove the letter from VERSION
9 AC_INIT(gnuplot, 4.2.6)
10 AC_CONFIG_SRCDIR(src/graphics.c)
11 AC_PREREQ(2.58)
12 AM_CONFIG_HEADER(config.h:config.hin)
13 AM_INIT_AUTOMAKE(1.7.9)
14
15 VERSION_MAJOR="`cat $srcdir/VERSION`"
16 PATCHLEVEL="`cat $srcdir/PATCHLEVEL`"
17
18 dnl configure.in body
19
20 dnl Compiler characteristics
21 dnl Check for ANSI C prototypes, the const and inline keywords,
22 dnl and ANSI style stringification
23 AC_PROG_CC
24 AM_C_PROTOTYPES
25 AC_PROG_CPP
26 AC_C_CONST
27 AC_C_INLINE
28 AC_C_STRINGIZE
29
30 dnl Various programs
31 dnl X/Emacs for building lisp packages and creating .texi version of docs
32 # If set to t, that means we are running in a shell under Emacs.
33 # If you have an Emacs named "t", then use the full path.
34 test x"$EMACS" = xt && EMACS=
35 AC_CHECK_PROGS(EMACS, emacs xemacs, no)
36 AC_CHECK_PROGS(PLAINTEX, tex, no)
37 AC_CHECK_PROGS(LATEX, latex latex2e, no)
38 AC_CHECK_PROGS(PDFLATEX, pdflatex, no)
39 AC_CHECK_PROGS(DVIPS, dvips, no)
40 AC_CHECK_PROGS(TROFF, troff, no)
41
42 dnl Allow manual specification of kpsexpand 
43 AC_ARG_WITH(kpsexpand,dnl
44   [--with-kpsexpand        search for kpsexpand at run-time (default disabled)],
45   [if test "$withval" = yes; then
46     AC_DEFINE(HAVE_KPSEXPAND,1,[ Define if you use have kpsexpand (TeX). ])
47   fi])
48
49 dnl X Window System files.
50 AC_SUBST(LIBRARIES_FOR_X)
51 AC_PATH_XTRA
52
53 dnl Needed for LynxOS until AC_PATH_XTRA is fixed
54 if test "$ac_cv_func_gethostbyname" = no; then
55   if test "$ac_cv_lib_nsl_gethostbyname" = no; then
56     AC_CHECK_LIB(bsd, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd")
57   fi
58 fi
59
60 if test "$no_x" != yes; then
61   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
62   LIBRARIES_FOR_X="$X_LIBS -lX11 $X_EXTRA_LIBS"
63   GNUPLOT_X11='gnuplot_x11${EXEEXT}'
64   AC_DEFINE(X11,1,[ Define if you are using the X11 window system. ])
65 else
66   GNUPLOT_X11=
67 fi
68
69 AC_SUBST(GNUPLOT_X11)
70
71 dnl Operating systems.
72 dnl FIXME AC_DEFINE(ISC22)
73 dnl FIXME AC_DEFINE(KSR)
74 dnl Check for MSDOS and djgpp, NeXT, Apple MacOsX (NeXT like), BeOS
75 GP_MSDOS
76 GP_NEXT
77 GP_APPLE
78 GP_BEOS
79 GP_ALPHA
80 AM_CONDITIONAL(BUILD_SRC_BEOS_SUBDIR, test x$build_beos_subdir = xyes)
81
82 dnl Apparently, -lNeXT_s is needed on NeXT
83 dnl _instead_ of -lm ...
84 AC_CHECK_FUNC(sin,,[AC_CHECK_LIB(m,sin)])
85
86 dnl Header files. ANSI first
87 dnl We prefer that the absense of a macro is the norm, so in syscfg.h
88 dnl configure's HAVE_XXXX defines are translated into NO_XXXX for ANSI
89 dnl headers and functions
90 AC_HEADER_STDC
91
92 dnl Header files
93 dnl ANSI/ISO C, POSIX, others
94 AC_CHECK_HEADERS(dirent.h errno.h float.h limits.h locale.h math.h stdlib.h \
95   string.h time.h sys/time.h sys/types.h \
96   sys/bsdtypes.h sys/ioctl.h sys/param.h sys/select.h sys/socket.h \
97   sys/stat.h sys/systeminfo.h sys/timeb.h sys/utsname.h \
98   libc.h malloc.h poll.h sgtty.h termios.h values.h pwd.h
99 )
100
101 AC_HEADER_STDBOOL
102
103 if test "$ac_cv_header_math_h" = yes ; then
104   AC_MSG_CHECKING([for struct exception in math.h])
105   AC_TRY_LINK([#include <math.h>],
106     [struct exception *x; x->type; x->name;],
107     [AC_MSG_RESULT(yes)
108      AC_DEFINE(HAVE_STRUCT_EXCEPTION_IN_MATH_H,1,
109                [ Define if math.h declares struct exception for matherr(). ])],
110     AC_MSG_RESULT(no))
111 fi
112
113 if test "$ac_cv_header_sys_stat_h" = yes; then
114   AC_HEADER_STAT
115 fi
116
117 dnl check if unistd actually declares anything. On NeXT 3.2 unistd is
118 dnl conditionalized for _POSIX_SOURCE
119 AC_MSG_CHECKING(for unistd.h)
120 AC_EGREP_HEADER(execv, unistd.h,
121   [AC_DEFINE(HAVE_UNISTD_H) AC_MSG_RESULT(yes)],
122    AC_MSG_RESULT(no))
123
124 dnl check if errno.h header declares errno
125 AC_MSG_CHECKING(if errno variable is declared)
126 AC_TRY_COMPILE(
127 [#include <stdio.h>
128 #ifdef HAVE_ERRNO_H
129 #include <errno.h>
130 #endif],
131   errno=0,AC_MSG_RESULT(yes),
132   [AC_DEFINE(EXTERN_ERRNO,1,[ Define if <errno.h> declares errno. ])
133    AC_MSG_RESULT(no)])
134
135
136 dnl Types.
137 AC_TYPE_SIZE_T
138 AC_MSG_CHECKING(for time_t in time.h)
139 AC_EGREP_HEADER(time_t,time.h,
140   [AC_MSG_RESULT(yes)
141    AC_DEFINE(HAVE_TIME_T_IN_TIME_H,1,
142              [ Define if time_t is declared in time.h. ])])
143 AC_TYPE_SIGNAL
144  
145
146 dnl Functions. Standard first, then others
147
148 dnl ANSI/ISO and their predecessors
149 dnl sunos 4 has on_exit() in place of atexit()
150 dnl gamma is called lgamma on apollos and linux
151 dnl we prefer lgamma over gamma, see specfun.c
152 dnl math lib is already available, see operating systems part
153 AC_CHECK_FUNCS(atexit memcpy memmove memset \
154   on_exit bcopy bzero \
155   setvbuf strerror strchr strrchr strstr \
156   index rindex \
157   isnan \
158   erf erfc gamma lgamma \
159   getcwd poll pclose popen select sleep stpcpy \
160   strcspn strdup strcasecmp stricmp strncasecmp strnicmp \
161   sysinfo tcgetattr vfprintf doprnt usleep
162 )
163
164 AC_CHECK_FUNCS(snprintf, ,
165  [  AC_MSG_RESULT([ 
166   WARNING: Could not find a working version of snprintf.
167            If a user provides gnuplot with an improper format statement
168            then a buffer overflow and/or segfault can result.
169            Please consider providing snprintf via an external library.
170   ])
171 ])
172
173
174 dnl HBB 20030624: see if signgam is declared by math.h
175 AC_CHECK_DECLS([signgam],,,
176 [#if HAVE_MATH_H
177 #include <math.h>
178 #endif
179 ])
180
181 dnl check, if we have sigsetjmp and siglongjmp.
182 dnl a trivial AC_CHECK_FUNCS(sigsetjmp) won't do
183 dnl because sigsetjmp() might be a macro declared
184 dnl in <setjmp.h>. (joze)
185 AC_MSG_CHECKING(for sigsetjmp)
186 AC_TRY_LINK([#include <setjmp.h>], [jmp_buf env; sigsetjmp(env, 1);],
187   [AC_MSG_RESULT(yes)
188    AC_DEFINE(HAVE_SIGSETJMP,1,
189              [ Define if we have sigsetjmp(). ])],
190   AC_MSG_RESULT(no))
191
192 if test "$ac_cv_func_pclose" = yes -a "$ac_cv_func_popen" = yes ; then
193   AC_DEFINE(PIPES,1,[ Define if you do have the popen and pclose functions. ])
194 fi
195
196 dnl Argument types of select()
197 AC_FUNC_SELECT_ARGTYPES
198
199 dnl On SVR3.
200 dnl FIXME AC_DEFINE(CRIPPLED_SELECT)
201
202 dnl Install the lasergnu printer script
203 LASERGNU=lasergnu-noinstall
204 AC_ARG_WITH(lasergnu,dnl
205 [  --with-lasergnu         install lasergnu printer script],
206   test "$withval" = yes && LASERGNU=lasergnu-install)
207
208 dnl .gih help file location
209 eval gp_datadir=$datadir
210 if test "$gp_datadir" = NONE/share; then
211   datadir="/usr/local/share"
212 fi
213 pkgdatadir="$datadir/$PACKAGE"
214 AC_ARG_WITH(gihdir,dnl
215 [  --with-gihdir=DIR       location of .gih file
216                           (default PREFIX/share/PACKAGE/VERSION)],
217   GIHDIR="$withval",
218   GIHDIR="$pkgdatadir/$VERSION_MAJOR")
219
220 dnl The Linux console driver
221 AC_ARG_WITH(linux-vga,dnl
222 [  --with-linux-vga        use the Linux SVGA console driver
223                           (requires /usr/lib/libvga)],,
224   test -z "$with_linux_vga" && with_linux_vga=no)
225
226 dnl check for installed linux vgalib
227 if test "$with_linux_vga" = yes; then
228   AC_MSG_CHECKING(for linux vga library)
229   AC_CHECK_LIB(vga, vga_init,
230     [AC_DEFINE(LINUXVGA,1,
231                [ Define if this is a Linux system with SuperVGA library. ])
232      LINUXSUID='chown root $(bindir)/gnuplot; chmod u+s $(bindir)/gnuplot'
233      TERMLIBS="-lvga $TERMLIBS"],
234     with_linux_vga=no)
235 fi
236
237 dnl TODO: simplify, get rid of GGI_SUPPORT
238 dnl new ggi driver
239 GGI_SUPPORT=no
240 AC_ARG_WITH(ggi,dnl
241 [  --with-ggi[=DIR]        enable the ggi driver (EXPERIMENTAL)],
242   [if test "$withval" != no; then
243      if test -d $withval/include; then
244        CPPFLAGS="$CPPFLAGS -I$withval/include"
245      fi
246      if test -d $withval/lib; then
247        LDFLAGS="$LDFLAGS -L$withval/lib"
248      fi
249      AC_CHECK_LIB(ggi,ggiInit,
250        [TERMLIBS="-lggi $TERMLIBS"
251         AC_DEFINE(USE_GGI_DRIVER,1,
252                   [ Define if you want to use the experimental ggi driver. ])
253         GGI_SUPPORT=yes
254         dnl check if libggiwmh and ggi/wmh.h are found
255         AC_CHECK_LIB(ggiwmh,ggiWmhInit,
256           [TERMLIBS="-lggiwmh $TERMLIBS"
257            AC_CHECK_HEADERS(ggi/wmh.h,,
258              AC_MSG_WARN([found ggiwmh library but not ggi/wmh.h
259 please add path to ggi/wmh.h to CPPFLAGS in Makefile]))
260           ])])
261    fi])
262
263 AC_ARG_WITH(xmi,dnl
264 [  --with-xmi[=DIR]        ggi's xmi support for pm3d (EXPERIMENTAL)],
265   [if test "$withval" != no -a "$GGI_SUPPORT" = yes; then
266      if test -d $withval/include; then
267        CPPFLAGS="$CPPFLAGS -I$withval/include"
268      fi
269      if test -d $withval/lib; then
270        LDFLAGS="$LDFLAGS -L$withval/lib"
271      fi
272      AC_CHECK_LIB(xmi,xmiInit,
273        [TERMLIBS="-lxmi $TERMLIBS"
274         AC_CHECK_HEADERS(ggi/xmi.h)])
275    fi])
276
277 dnl Use builtin readline or GNU readline or NetBSD editline
278 AC_ARG_WITH(readline,dnl
279 [  --with-readline=builtin  use the built-in minimal readline
280   --with-readline=gnu      use the GNU readline library (default; 4.2 or newer required)
281   --with-readline=bsd      use the NetBSD editline library
282   --with-readline=DIR      specify the location of GNU readline
283   --without-readline       do not use any readline function], ,
284   test -z "$with_readline" && with_readline=gnu)
285
286 dnl Gnuplot history
287 AC_ARG_ENABLE(history-file,dnl
288 [  --disable-history-file  do not use history file],,
289   test -z "$enable_history_file" && enable_history_file=yes)
290
291 dnl GNU readline and the required terminal library
292 if test "$with_readline" != no; then
293   if test "$with_readline" != builtin; then
294
295     if test "$with_readline" = bsd; then
296
297       AC_CHECK_LIB(edit, readline,
298         [TERMLIBS="-ledit $TERMLIBS"],
299         [AC_MSG_WARN([Could not find BSD editline library ])
300          with_readline=builtin],)
301
302       AC_CHECK_LIB(curses, tputs,
303         [TERMLIBS="-lcurses $TERMLIBS"],,)
304
305       if test "$ac_cv_lib_edit_readline" = yes; then
306         AC_DEFINE(HAVE_LIBEDITLINE,1,
307                 [ Define if you are using the BSD editline library. ])
308         AC_CHECK_HEADERS(editline/readline.h,,
309           AC_MSG_WARN([found BSD editline library but not readline.h please add path to readline.h to CPPFLAGS in Makefile]))
310
311         if test "$enable_history_file" = yes; then
312             AC_DEFINE(GNUPLOT_HISTORY,1,
313                       [ Define if you want to use a gnuplot history file. ])
314         fi
315       fi
316
317     else # !bsd
318
319     dnl check for terminal library
320     dnl this is a very cool solution from octave's configure.in
321     gp_tcap=""
322     for termlib in ncurses curses termcap terminfo termlib; do
323       AC_CHECK_LIB(${termlib}, tputs, [gp_tcap="$gp_tcap -l$termlib"])
324       case "$gp_tcap" in
325         *-l${termlib}*)
326           break
327         ;;
328       esac
329     done
330
331     if test "$with_readline" = gnu; then
332       AC_CHECK_LIB(readline, remove_history,
333         [TERMLIBS="-lreadline $gp_tcap $TERMLIBS"],, [${gp_tcap}])
334     else
335       if test -d $with_readline/include; then
336         CPPFLAGS="$CPPFLAGS -I$with_readline/include"
337       fi
338       if test -d $with_readline/lib; then
339         LDFLAGS="$LDFLAGS -L$with_readline/lib"
340       fi
341
342       AC_CHECK_LIB(readline, remove_history,
343         [TERMLIBS="-lreadline $gp_tcap $TERMLIBS"],,[${gp_tcap}])
344
345     fi
346
347     if test "$ac_cv_lib_readline_remove_history" = no; then
348       dnl OSX keeps history functions in a separate library
349       AC_CHECK_LIB(history, remove_history,
350         TERMLIBS="-lreadline -lhistory $gp_tcap $TERMLIBS",
351         [ AC_MSG_WARN([GNU readline not found - falling back to builtin readline])
352           with_readline=builtin ]
353         ,[${gp_tcap}])
354     fi
355
356     if [test "$ac_cv_lib_readline_remove_history" != no || test "$ac_cv_lib_history_remove_history" != no]; then
357       if test "$with_readline" = bsd; then
358           AC_DEFINE(HAVE_LIBEDITLINE,1,
359                 [ Define if you are using the BSD editline library. ])
360       else
361           AC_DEFINE(HAVE_LIBREADLINE,1,
362                 [ Define if you are using the GNU readline library. ])
363       fi
364       AC_CHECK_HEADERS(readline/readline.h,,
365         AC_MSG_WARN([found GNU readline library but not readline.h
366 please add path to readline.h to CPPFLAGS in Makefile]))
367       AC_CHECK_HEADERS(readline/history.h,,
368         AC_MSG_WARN([found GNU readline library but not history.h
369 please add path to history.h to CPPFLAGS in Makefile]))
370
371       if test "$enable_history_file" = yes; then
372         AC_CHECK_HEADERS(readline/tilde.h,
373           AC_DEFINE(GNUPLOT_HISTORY,1,
374                     [ Define if you want to use a gnuplot history file. ]))
375       fi
376
377     fi # ! ac_cv_lib_readline_readline = no
378
379    fi # ! with_readline = bsd
380
381   fi # ! with_readline != builtin 
382
383   if test "$with_readline" = builtin; then
384     AC_DEFINE(READLINE,1,
385               [ Define if you want to use the included readline function. ])
386     if test "$enable_history_file" = yes; then
387        AC_DEFINE(GNUPLOT_HISTORY,1,
388                 [ Define if you want to use a gnuplot history file. ])
389     fi
390   fi
391
392 fi
393 dnl end readline
394
395 dnl If no DIR argument given, use the Unix plot library
396 dnl Else use either GNU libplot from plotutils,
397 dnl or ancient GNU graphics libplot
398 AC_ARG_WITH(plot,dnl
399 [  --with-plot[=DIR]       use the Unix plot library],
400   [if test "$withval" = yes; then
401      dnl Unix plot library
402      AC_CHECK_LIB(plot,openpl,
403        [AC_DEFINE(UNIXPLOT,1,
404                   [ Define if you want to use the standard Unix plot library. ])
405         TERMLIBS="-lplot $TERMLIBS"],
406        with_plot=no)
407    elif test "$withval" != no; then
408      dnl GNU plotutils 2.2 or better
409      if test -d $withval/include; then
410        CPPFLAGS="$CPPFLAGS -I$withval/include"
411      fi
412      if test -d $withval/lib; then
413        LDFLAGS="$LDFLAGS -L$withval/lib"
414      fi
415      TERMXLIBS="$X_LIBS -lXaw -lXmu -lXt -lXext -lX11"
416      AC_CHECK_LIB(plot,pl_textangle,
417        [TERMLIBS="-lplot $TERMLIBS"
418         AC_DEFINE(GNUGRAPH,1,
419                   [ Define if you want to use the GNU version of the Unix plot library. ])],
420        [AC_MSG_WARN([GNU plotutils v2.2 or newer required -- disabling gnugraph terminal])
421         TERMXLIBS=
422         with_plot=no],
423        [$TERMXLIBS])
424    fi])
425 dnl end libplot
426
427 dnl check presence of z library
428 dnl TODO: path to zlib includes; -lz -lm specified multiple times
429 dnl       we don't do anything about missing png/gd includes either
430 AC_CHECK_LIB(z,deflate,
431   [TERMLIBS="$TERMLIBS -lz"
432    AC_DEFINE(HAVE_LIBZ,1,[ Define if you have zlib. ])
433    AC_CHECK_HEADER(zlib.h,,
434      [AC_MSG_WARN([found z library but not zlib.h
435 please add path to zlib.h to CPPFLAGS in Makefile])])],
436   AC_MSG_WARN([zlib is required - see http://www.gzip.org/zlib/]))
437
438 dnl check presence of gd library
439 dnl we don't check for libfreetype and libjpeg locations - if gd requires
440 dnl them, the gdlib-config scipt contains all the required information
441 AC_ARG_WITH(gd,dnl
442 [  --with-gd[=DIR]         where to find Tom Boutell's gd library],,
443   with_gd=yes)
444
445 if test "$with_gd" != no; then
446   AC_PATH_PROG([GDLIB_CONFIG], [gdlib-config])
447   if test -n "$GDLIB_CONFIG"; then
448     libgd_CPPFLAGS=`gdlib-config --cflags`
449     libgd_LDFLAGS=`gdlib-config --ldflags`
450   elif test -d "$with_gd"; then
451     libgd_CPPFLAGS="-I$with_gd/include"
452     libgd_LDFLAGS="-L$with_gd/lib"
453   fi
454
455   _cppflags="$CPPFLAGS"
456   _ldflags="$LDFLAGS"
457   CPPFLAGS="$CPPFLAGS $libgd_CPPFLAGS"
458   LDFLAGS="$LDFLAGS $libgd_LDFLAGS"
459
460   AC_CHECK_LIB(gd,gdImageCreate,
461     [dnl found gd library
462      AC_DEFINE(HAVE_LIBGD,1,[ Define if you have gd library. ])
463      AC_CHECK_HEADERS(gd.h,,
464        AC_MSG_WARN([please add path to gd.h to CPPFLAGS in Makefile]))
465
466      dnl gif support in libgd
467      AC_CHECK_LIB(gd,gdImageGif,
468        [AC_DEFINE(HAVE_GD_GIF,1,[ Define if libgd supports gif. ])])
469      AC_CHECK_LIB(gd,gdImageGifAnimBegin,
470        [AC_DEFINE(GIF_ANIMATION,1,[ Define if libgd supports animated gifs. ])])
471
472      _libs="$LIBS"
473      LIBS="$LIBS -ljpeg"
474      dnl jpeg support in libgd
475      AC_CHECK_LIB(gd,gdImageJpeg,
476        [AC_DEFINE(HAVE_GD_JPEG,1,[ Define if libgd supports jpeg. ])
477         libgd_LIBS="$libgd_LIBS -ljpeg"])
478
479      LIBS="$_libs $libgd_LIBS -lfreetype"
480      dnl freetype support in libgd
481      AC_CHECK_LIB(gd,gdImageStringFT,
482        [have_ttf=yes],
483        [AC_CHECK_LIB(gd,gdImageStringTTF,
484          [AC_DEFINE(gdImageStringFT,gdImageStringTTF,
485                     [ libgd versions < 1.8.4 need gdImageStringTTF rather than gdImageStringFT ])
486           have_ttf=yes])])
487
488      if test "$have_ttf" = yes; then
489        AC_DEFINE(HAVE_GD_TTF,1,
490                  [ Define if libgd supports TrueType fonts through libfreetype. ])
491        libgd_LIBS="$libgd_LIBS -lfreetype"
492      fi
493
494      LIBS="$_libs $libgd_LIBS -lpng"
495      dnl png support in libgd
496      AC_CHECK_LIB(gd,gdImagePng,
497        [AC_DEFINE(HAVE_GD_PNG,1,[ Define if libgd supports png. ])
498         libgd_LIBS="$libgd_LIBS -lpng"])
499      LIBS="$_libs"
500
501     ],[dnl gd library not found
502        with_gd=no
503     ])
504
505   if test -n "$GDLIB_CONFIG"; then
506     libgd_LIBS=`gdlib-config --libs`
507   fi
508
509   dnl piece it all together
510   if test "$with_gd" = no; then
511     CPPFLAGS="$_cppflags"
512     LDFLAGS="$_ldflags"
513   else
514     TERMLIBS="$TERMLIBS -lgd $libgd_LIBS"
515   fi
516
517 fi
518 dnl end gd
519
520 dnl The Portable Document Format (PDF) terminal
521 AC_ARG_WITH(pdf,dnl
522 [  --with-pdf[=DIR]        enable pdf terminal 
523                           (requires PDFLib)],,
524   with_pdf=yes)
525
526 if test "$with_pdf" != no; then
527   AC_PATH_PROG([PDFLIB_CONFIG], [pdflib-config])
528   if test -n "$PDFLIB_CONFIG"; then
529     libpdf_CPPFLAGS=`pdflib-config --cflags`
530     # D'oh - libraries don't belong here
531     libpdf_LDFLAGS=`pdflib-config --ldflags |sed 's/ -l[[^ ]][[^ ]]*//g'`
532   elif test -d "$with_pdf"; then
533     libpdf_CPPFLAGS="-I$with_pdf/include"
534     libpdf_LDFLAGS="-L$with_pdf/lib"
535   fi
536
537   _cppflags="$CPPFLAGS"
538   _ldflags="$LDFLAGS"
539   _libs="$LIBS"
540   CPPFLAGS="$CPPFLAGS $libpdf_CPPFLAGS"
541   LDFLAGS="$LDFLAGS $libpdf_LDFLAGS"
542
543   AC_CHECK_LIB(pdf,PDF_get_majorversion,
544     [AC_DEFINE(HAVE_LIBPDF,1,[ Define if you have the pdf library. ])
545      AC_CHECK_HEADERS(pdflib.h,,
546        AC_MSG_WARN([please add path to pdflib.h to CPPFLAGS in Makefile]))
547     ],
548     with_pdf=no)
549
550   if test "$with_pdf" != no; then
551     AC_CHECK_LIB(pdf,PDF_begin_pattern, ,
552       [AC_DEFINE(HAVE_OLD_LIBPDF,1,[ Define if your pdf library is too old to support patterns. ])
553       AC_MSG_WARN([your version of libpdf is too old!])
554       ])
555   fi
556
557   if test "$with_pdf" != no; then
558     AC_CHECK_LIB(pdf,PDF_setdashpattern, ,
559       [AC_DEFINE(HAVE_NODASH_LIBPDF,1,[ Define if your pdf library doesn't support dash patterns. ])
560       AC_MSG_WARN([your version of libpdf is too old!])
561       ])
562   fi
563
564   if test "$with_pdf" != no; then
565     AC_CHECK_LIB(pdf,PDF_begin_document, ,
566       [AC_DEFINE(HAVE_LIBPDF_OPEN_FILE,1,[ Define if your pdf library is too old to use PDF_begin_document. ])
567       AC_MSG_WARN([your version of libpdf is rather old.])
568       ])
569   fi
570
571   LIBS="$_libs"
572   if test "$with_pdf" = no; then
573     CPPFLAGS="$_cppflags"
574     LDFLAGS="$_ldflags"
575   else
576     TERMLIBS="$TERMLIBS -lpdf"
577   fi
578
579 fi
580 dnl end pdf
581
582 dnl How do we detect the Ultrix X libraries?
583 dnl Or is it really a server (run-time) problem?
584 dnl FIXME AC_DEFINE(ULTRIX_KLUDGE)
585
586 dnl Removed enable options for these
587 dnl Just autodetect
588
589 dnl SCO cgi
590 AC_EGREP_CPP(yes,
591 [#ifdef SCO
592 yes
593 #endif
594 ],AC_CHECK_LIB(ccgi, v_opnwk,
595     [AC_DEFINE(CGI,1,[ Define if you want to use the CGI terminal under SCO. ])
596      TERMLIBS="-lccgi $TERMLIBS"]))
597
598 dnl Sun sunview
599 AC_EGREP_CPP(yes,
600 [#ifdef sun
601 yes
602 #endif
603 ],[AC_CHECK_LIB(suntool, window_create,
604      [AC_CHECK_HEADER(suntool/sunview.h,
605         [AC_DEFINE(SUN,1,
606                    [ Define if you want to use the sunview terminal (sun). ])
607          TERMLIBS="-lsuntool -lsunwindow -lpixrect $TERMLIBS"])],,
608     [-lsunwindow -lpixrect])])
609
610 dnl Process rest of with and enable options
611
612 dnl Use .gnuplot file in current directory
613 AC_ARG_WITH(cwdrc,dnl
614 [  --with-cwdrc            check current directory for .gnuplot file,
615                           normally disabled for security reasons],,
616   [if test "$withval" = yes; then
617      AC_DEFINE(NOCWDRC,1,
618                [ Define if you do not want to read .gnuplot in the current directory. ])
619    fi])
620
621 dnl Whether we want to build the lisp files
622 dnl Does nothing here, is passed on to the lisp subdir
623 AC_ARG_WITH(lisp-files,dnl
624 [  --without-lisp-files    do not build emacs lisp files])
625
626 dnl Sort help/subtopic tables by row or column
627 AC_ARG_WITH(row-help,dnl
628 [  --with-row-help         format help and subtopic tables by row (default)
629   --without-row-help      format help and subtopic tables by column],
630   [if test "$with_row_help" = no; then
631      AC_DEFINE(COLUMN_HELP,1,
632                [ Define if you want online help and subtopic tables sorted by column. ])
633    fi])
634
635 dnl Whether we want to create the LaTeX tutorial
636 TUTORIAL=tutorial
637 AC_ARG_WITH(tutorial,dnl
638 [  --without-tutorial      do not build LaTeX tutorial])
639 dnl only if latex/2e is found
640 if test "$LATEX" = no -o "$with_tutorial" = no ; then
641   TUTORIAL=notutorial
642   with_tutorial=no
643 fi
644
645 dnl use mouse for x11 interface
646 AC_ARG_ENABLE(mouse,dnl
647 [  --disable-mouse         disable mouse for the x11 terminal],,
648   test -z "$enable_mouse" && enable_mouse=yes)
649
650 if test "$enable_mouse" = yes; then
651   AC_DEFINE(USE_MOUSE,1,
652             [ Define if you want to have mouse support for the x11 terminal. ])
653   AC_DEFINE(PIPE_IPC,1,
654             [ Unix-type of Interprocess Communication is required for mouse support. ])
655 fi
656
657 dnl enable multi-byte font support in x11 terminal
658 AC_ARG_ENABLE(x11-mbfonts,dnl
659 [  --disable-x11-mbfonts   disable multi-byte font support for x11 ],,
660   test -z "$enable_x11_mbfonts" && enable_x11_mbfonts=yes)
661   if test "$enable_x11_mbfonts" = yes; then
662
663     _ldflags="$LDFLAGS"
664     LDFLAGS="$LDFLAGS $LIBRARIES_FOR_X"
665
666     AC_MSG_CHECKING([for multi-byte support in x11])
667     AC_CHECK_LIB(X11, XmbDrawString,
668       AC_DEFINE(USE_X11_MULTIBYTE,1,[ Define to enable multi-byte font support for x11 ]),
669       enable_x11_mbfonts=no )
670     
671     LDFLAGS="$_ldflags"
672   
673   fi
674
675 dnl binary_data_file
676 AC_ARG_ENABLE(binary_data_file,dnl
677 [  --disable-binary-data-file          disable binary_data_file],,
678   test -z "$enable_binary_data_file" && enable_binary_data_file=yes)
679
680 if test "$enable_binary_data_file" = yes; then
681   AC_DEFINE(BINARY_DATA_FILE,1,[ Define if you want to support files in binary format. ])
682 fi
683
684 AM_CONDITIONAL(INCLUDE_BINARY_C, test "$enable_binary_data_file" = no)
685
686 dnl with_image
687 AC_ARG_ENABLE(with_image,dnl
688 [  --disable-with-image          disable image support],,
689   test -z "$enable_with_image" && enable_with_image=yes)
690
691 if test "$enable_with_image" = yes; then
692   if test "$enable_binary_data_file" = yes; then
693     AC_DEFINE(WITH_IMAGE,1,[ Define if you want to have image plotting support. ])
694   else
695     enable_with_image=no
696     AC_MSG_WARN( [The with-image option requires --enable-binary-data-file. ])
697   fi
698 fi
699
700 dnl binary_x11_polygon
701 AC_ARG_ENABLE(binary_x11_polygon,dnl
702 [  --disable-binary-x11-polygon        disable binary_x11_polygon],,
703   test -z "$enable_binary_x11_polygon" && enable_binary_x11_polygon=yes)
704
705 if test "$enable_binary_x11_polygon" = yes; then
706   AC_DEFINE(BINARY_X11_POLYGON,1,[ Define if you want the x11 driver to transfer polygon information in binary format. ])
707 fi
708
709 dnl check for installed linux vgagl lib if
710 dnl both linux_vga is defined.
711 if test "$with_linux_vga" = yes; then
712   _LIBS="$LIBS"
713   dnl make sure LIBS contains -lvga
714   LIBS="$TERMLIBS $LIBS"
715   AC_MSG_CHECKING(for the vgagl library)
716   AC_CHECK_LIB(vgagl, gl_hline,
717     [LIBS="-lvgagl $LIBS"
718      AC_CHECK_HEADERS(vgagl.h,
719       [AC_DEFINE(VGAGL,1,[ Define if the vgagl libray is present. ])
720        dnl yup, we've the libvgagl.
721        dnl check now, if lib3dkit is found.
722        AC_CHECK_LIB(3dkit, gl_striangle,
723          [AC_CHECK_HEADERS(3dkit.h,
724             [dnl success! If we're here, all checks for
725              dnl the vgagl terminal driver succeeded.
726              AC_DEFINE(THREEDKIT,1,[ Define if the 3dkit libray is present. ])
727              AC_DEFINE(EXTENDED_COLOR_SPECS,1,
728                        [ Define if color information should be passed for each vertex. ])
729              VGAGLLIB="-l3dkit -lvgagl"
730              with_vgagl=yes
731             ],dnl <-- 3dkit.h found
732             [with_vgagl=no
733              AC_MSG_RESULT([unable to find 3dkit.h])
734             ]dnl <-- 3dkit.h not found
735           )
736          ],dnl <-- 3dkit is present
737          [
738           with_vgagl=no
739           AC_MSG_RESULT([unable to find lib3dkit])
740          ]dnl <-- 3dkit is not present
741        )
742       ],dnl <-- vgagl.h is present
743       [
744        with_vgagl=no
745        AC_MSG_RESULT([unable to find vgagl.h])
746       ]dnl <-- vgagl.h is not present
747      )
748     ],dnl <-- libvgagl was found
749     [with_vgagl=no
750      AC_MSG_RESULT([unable to find libvgagl])
751     ]dnl <-- libvgagl was not found
752   )
753   dnl restore LIBS
754   LIBS="$_LIBS"
755 else
756   with_vgagl=no
757 fi
758
759 TERMLIBS="$VGAGLLIB $TERMLIBS"
760
761 dnl thin plate splines patch
762 AC_ARG_ENABLE(thin-splines,dnl
763 [  --enable-thin-splines   enable thin plate splines],
764   [if test "$enableval" = yes; then
765      AC_DEFINE(THIN_PLATE_SPLINES_GRID,1,
766                [ Define to use thin plate spines. ])
767    fi])
768
769 dnl strings in datafile
770 AC_ARG_ENABLE(datastrings,dnl
771 [  --disable-datastrings   disable reading strings from datafiles],,
772   test -z "$enable_datastrings" && enable_datastrings=yes)
773
774   if test "$enable_datastrings" = yes; then
775   AC_DEFINE(EAM_DATASTRINGS,1,
776                [ Define to allow reading strings from datafiles ])
777   fi
778
779 dnl histograms
780 AC_ARG_ENABLE(histograms,dnl
781 [  --disable-histograms    disable histograms plot style ],,
782   test -z "$enable_histograms" && enable_histograms=yes)
783   if test "$enable_histograms" = yes; then
784
785     if test "$enable_datastrings" = yes; then
786       AC_DEFINE(EAM_HISTOGRAMS, 1,
787                [ Define to enable histograms plot style. ])
788     else
789       enable_histograms=no
790       AC_MSG_WARN( [The --enable-histograms option requires --enable-datastrings. ])
791     fi
792
793   fi
794
795 dnl rectangles and other objects
796 AC_ARG_ENABLE(objects,dnl
797 [  --disable-objects       disable rectangles and other objects ],,
798   test -z "$enable_objects" && enable_objects=yes)
799
800   if test "$enable_objects" = yes; then
801   AC_DEFINE(EAM_OBJECTS,1,
802                [ Define to allow placement of rectangles and other objects ])
803   fi
804
805 dnl string variables
806 AC_ARG_ENABLE(stringvariables,dnl
807 [  --disable-stringvariables   disable string variables],,
808   test -z "$enable_stringvariables" && enable_stringvariables=yes)
809   if test "$enable_stringvariables" = yes; then
810   AC_DEFINE(GP_STRING_VARS,2,
811                [ Define to allow string variables. ])
812   fi
813
814 dnl command line macros
815 AC_ARG_ENABLE(macros,dnl
816 [  --disable-macros        disable command line macros],,
817   test -z "$enable_macros" && enable_macros=yes)
818   if test "$enable_macros" = yes; then
819
820     if test "$enable_stringvariables" = yes; then
821       AC_DEFINE(GP_MACROS,1,
822                [ Define to allow command line macros. EXPERIMENTAL ])
823     else
824       enable_macros=no
825       AC_MSG_WARN( [The --enable-macros option requires --enable-stringvariables. ])
826     fi
827
828   fi
829
830 dnl IRIS terminal on IRIS4D series computer
831 AC_ARG_ENABLE(iris,dnl
832 [  --enable-iris           enable IRIS terminal (IRIS4D only)],
833   [if test "$enableval" = yes; then
834      AC_CHECK_LIB(gl_s,winopen,
835        [AC_DEFINE(IRIS,1,
836                   [ Define if you want to use the IRIS terminal on IRIS4D series computers. ])
837         TERMLIBS="-lgl_s $TERMLIBS"],
838        enable_iris=no)
839    fi])
840
841 dnl MGR Window system
842 AC_ARG_ENABLE(mgr,dnl
843 [  --enable-mgr            enable MGR terminal],
844   [if test "$enableval" = yes; then
845      AC_CHECK_LIB(mgr,m_getinfo,
846        [AC_DEFINE(MGR,1,[ Define if you want to use the MGR Window system. ])
847         TERMLIBS="-lmgr -lpixrect $TERMLIBS"],
848        enable_mgr=no,
849        [-lpixrect])
850    fi])
851
852 dnl fitting error variables
853 AC_ARG_ENABLE(fiterrvars,dnl
854 [  --disable-fiterrvars    disable fitting error variables],,
855   [test -z "${enable_fiterrvars}" && enable_fiterrvars=yes])
856 if test "$enable_fiterrvars" = yes; then
857   AC_DEFINE(GP_FIT_ERRVARS, 1,
858             [ Define to allow 'fit' to create parameter error variables. ])
859 fi
860
861 dnl Redwood Graphics Interface Protocol
862 AC_ARG_ENABLE(rgip,dnl
863 [  --enable-rgip           enable Redwood Graphics Interface Protocol],
864   [if test "$enableval" = yes; then
865      AC_DEFINE(RGIP,1,
866                [ Define if you want to use the Redwood Graphics Interface Protocol. ])
867    fi])
868
869 dnl hidden3d compile-time options...
870 dnl NOTE: have to check that they're not both turned on --- the code
871 dnl doesn't allow that choice.
872 AC_ARG_ENABLE(h3d-quadtree,dnl
873 [  --disable-h3d-quadtree   disable quadtree optimization in hidden3d code],,
874   [test -z "${enable_h3d_quadtree}" && enable_h3d_quadtree=yes])
875 if test "$enable_h3d_quadtree" = yes; then
876      AC_DEFINE(HIDDEN3D_QUADTREE,1,
877                [ Define to enable quadtree optimization in hidden3d code.])
878 fi
879
880 AC_ARG_ENABLE(h3d-gridbox,dnl
881 [  --enable-h3d-gridbox    enable gridbox optimization in hidden3d code],
882   [if test "$enable_h3d_quadtree" = yes; then
883      AC_MSG_ERROR(dnl
884 [Only one of the hidden3d options quadtree and gridbox may be enabled.])
885    fi
886    if test "$enableval" = yes; then
887      AC_DEFINE(HIDDEN3D_GRIDBOX,1,
888                [ Define to enable gridbox optimization in hidden3d code.])
889    fi])
890
891 AC_DEFINE(HIDDEN3D_VAR_PTSIZE,1,
892         [ Define to enable handling point size in hidden3d code.])
893
894
895 dnl
896 if test ! -f src/graphics.c ; then
897   AC_MSG_RESULT([Compiling outside source directory - copying needed files])
898   mkdir tutorial >/dev/null 2>&1
899   cp ${srcdir}/tutorial/eg3.dat tutorial
900 fi
901
902 dnl  wxWidgets terminal
903
904 dnl wxWidgets terminal needs C++
905 dnl These tests cannot be called conditionally.
906 dnl These tests are non-fatal on autoconf 2.58 and 2.59,
907 dnl but it may change in future versions, so we redefine AC_MSG_ERROR.
908 dnl Even if there is no C++ compiler on the system,
909 dnl autoconf will set CXX as g++ : this must be reverted.
910
911 m4_pushdef([AC_MSG_ERROR],[cxxerror=yes])
912 AC_PROG_CXX
913 m4_popdef([AC_MSG_ERROR])
914
915 if test "x${cxxerror}" != "xyes"; then
916   AC_LANG_PUSH([C++])
917   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iostream>]],
918         [[const char hw[] = "Hello, World\n"; std::cout << hw;]])],
919         [cxxerror=no
920         AC_PROG_CXXCPP],
921         [cxxerror=yes
922         CXX=$CC])
923   AC_LANG_POP([C++])
924 fi
925
926 AC_ARG_ENABLE(wxwidgets,dnl
927 [  --disable-wxwidgets      wxWidgets terminal (default enabled)],,
928   [test -z "${enable_wxwidgets}" && enable_wxwidgets=yes])
929
930 if test "${enable_wxwidgets}" = yes ; then
931   dnl variable used to determine if all checks pass
932   enable_wxwidgets_ok=yes
933
934   dnl Check for the C++ compiler
935   if test "x${cxxerror}" = "xyes"; then
936     AC_MSG_WARN([No C++ compiler found. The wxWidgets terminal will not be compiled.])
937       enable_wxwidgets_ok=no
938   fi
939
940   dnl The user can specify another path for wx-config
941   WXWIDGETS_PATH="${PATH}"
942   AC_ARG_WITH(wx-config,dnl
943   [--with-wx-config=PATH   Use the given path to wx-config, the wxWidgets configuration program
944     (default search in $PATH)],
945     [ if test "${with_wx_config}" != "no" ; then
946         WXWIDGETS_PATH="${with_wx_config}:${PATH}"
947      fi ])
948
949   dnl Look for wx-config in the path
950   AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWIDGETS_PATH})
951   if test "${WX_CONFIG}" = "no"; then
952     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.])
953     enable_wxwidgets_ok=no
954   else
955
956     dnl Ckeck for wxWidgets version
957     if expr 2.5.3 \> `${WX_CONFIG} --version` >/dev/null; then
958       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.])
959       enable_wxwidgets_ok=no
960     fi
961   fi
962
963   dnl Check for Cairo
964   PKG_CHECK_MODULES(CAIROPANGO, [cairo >= 0.9.0 pango >= 1.10 pangocairo >= 1.10],
965     [HAVE_CAIROPANGO=1], dnl not used, but may solve problems with some pkg-config
966     [if test $pkg_failed = yes; then
967         AC_MSG_WARN(dnl
968 [Package requirements (cairo >= 0.9.0 pango >= 1.10 pangocairo >= 1.10) for the
969 wxWidgets terminal were not met:
970
971 $CAIROPANGO_PKG_ERRORS
972
973 Consider adjusting the PKG_CONFIG_PATH environment variable if you
974 installed software in a non-standard prefix.
975
976 Alternatively, you can avoid the need to call pkg-config if you set the
977 environment variables CAIROPANGO_CFLAGS and CAIROPANGO_LIBS to the
978 corresponding flags for cairo, pango, and pangocairo.
979 See the pkg-config man page for more details.
980
981 The wxWidgets terminal will not be compiled.])
982     elif test $pkg_failed = untried; then
983         AC_MSG_WARN(dnl
984 [The pkg-config script could not be found or is too old.  Make sure it
985 is in your PATH or set the PKG_CONFIG environment variable to the full
986 path to pkg-config.
987
988 Alternatively, you can avoid the need to call pkg-config if you set the
989 environment variables CAIROPANGO_CFLAGS and CAIROPANGO_LIBS to the
990 corresponding flags for cairo, pango, and pangocairo.
991 See the pkg-config man page for more details.
992
993 To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
994
995 The wxWidgets terminal will not be compiled.])
996     fi
997     enable_wxwidgets_ok=no])
998
999   dnl Check for buggy Pango 1.10.2
1000   PKG_CHECK_MODULES(PANGO_1_10_2, [pango = 1.10.2],
1001     [AC_MSG_WARN(dnl
1002 [Pango 1.10.2 has been found. This version has a bug which gives unexpected
1003 results in the wxWidgets terminal. If you want to use this terminal, please
1004 install a different version of Pango.])
1005     enable_wxwidgets_ok=no],
1006     [AC_MSG_RESULT([no])
1007     HAVE_PANGO_1_10_2=0])
1008 fi
1009
1010 if test "${enable_wxwidgets_ok}" = yes ; then
1011   WX_CXXFLAGS="`$WX_CONFIG --cxxflags | sed 's/-fno-exceptions//'` $CAIROPANGO_CFLAGS"
1012   WX_LIBS="`$WX_CONFIG --libs` $CAIROPANGO_LIBS"
1013
1014   dnl Check for fork(), used for the 'persist' effect
1015   AC_FUNC_FORK
1016
1017   dnl Check for gtk (raise/lower tweaks)
1018   PKG_CHECK_MODULES(GTK, [gtk+-2.0], have_gtk=yes, have_gtk=no)
1019   if  test "${have_gtk}" = yes ; then
1020     AC_DEFINE(HAVE_GTK, 1, [Define to use gtk/gdk tweaks])
1021     WX_CXXFLAGS="$WX_CXXFLAGS $GTK_CFLAGS"
1022     WX_LIBS="$WX_LIBS $GTK_LIBS"
1023   fi
1024
1025   dnl Check for gtk>2.8 for direct rendering to screen
1026   PKG_CHECK_MODULES(GTK28, [gtk+-2.0 >= 2.8.0], have_gtk28=yes, have_gtk28=no)
1027   if  test "${have_gtk28}" = yes ; then
1028     AC_DEFINE(HAVE_GTK28, 1, [Define to use gtk+ functions to handle cairo])
1029   fi
1030
1031   CPPFLAGS="$CPPFLAGS $CAIROPANGO_CFLAGS"
1032   CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS"
1033   AC_SUBST(WX_LIBS)
1034   AC_DEFINE(WXWIDGETS,1, [ Define if you want the wxwidgets terminal. ])
1035 fi
1036
1037 AM_CONDITIONAL(BUILD_WXWIDGETS, test "${enable_wxwidgets_ok}" = yes)
1038
1039 dnl  End wxWidgets terminal
1040
1041 dnl Enable parsing of deprecated syntax
1042 AC_ARG_ENABLE(backwards-compatibility,dnl
1043 [  --disable-backwards-compatibility       disable deprecated syntax ],,
1044   test -z "$enable_backwards_compatibility" && enable_backwards_compatibility=yes)
1045
1046   if test "$enable_backwards_compatibility" = yes; then
1047   AC_DEFINE(BACKWARDS_COMPATIBLE,1,
1048                [ Define to allow use of deprecated syntax and terminal behaviour ])
1049   fi
1050
1051 dnl build lisp files
1052 if test "$with_lisp_files" != no; then
1053   AC_CONFIG_SUBDIRS(lisp)
1054   LISPDIR=lisp
1055 else
1056   LISPDIR=
1057 fi
1058 AC_SUBST(LISPDIR)
1059
1060 dnl Substitute variables
1061 AC_SUBST(PACKAGE)
1062 AC_SUBST(VERSION_MAJOR)
1063 AC_SUBST(VERSION)
1064 AC_SUBST(GIHDIR)
1065 AC_SUBST(LASERGNU)
1066 AC_SUBST(LINUXSUID)
1067 AC_SUBST(TERMLIBS)
1068 AC_SUBST(TERMXLIBS)
1069 AC_SUBST(TUTORIAL)
1070
1071 dnl Write Makefiles and configuration header
1072 AC_OUTPUT([Makefile
1073            config/Makefile
1074            demo/Makefile
1075            docs/Makefile
1076            m4/Makefile
1077            man/Makefile
1078            share/Makefile
1079            share/LaTeX/Makefile
1080            src/Makefile
1081            src/beos/Makefile
1082            src/wxterminal/Makefile
1083            term/Makefile
1084            maemo/Makefile
1085            tutorial/Makefile],
1086           [test -z "$CONFIG_HEADERS" || echo timestamp >stamp-h])
1087
1088 dnl Report configuration
1089 dnl Rationale:
1090 dnl - if something is disabled by default, show arguments to use to enable.
1091 dnl - if something has particular dependencies, show them all when they are
1092 dnl missing (the detailed output will give more details anyway).
1093 dnl The goal is to give sensible and easily accessible information to users
1094 dnl and packagers.
1095
1096 AC_MSG_RESULT([])
1097 AC_MSG_RESULT([** Configuration summary for $PACKAGE $VERSION:])
1098 AC_MSG_RESULT([])
1099
1100 AC_MSG_RESULT([gnuplot will be compiled with the following terminals:])
1101 AC_MSG_RESULT([])
1102
1103 AC_MSG_RESULT([  Standalone terminals: yes (always builtin)])
1104 AC_MSG_RESULT([    (aed512, aed767, aifm, bitgraph, cgm, corel, dumb, dxf, eepic, emf, emtex,])
1105 AC_MSG_RESULT([    epslatex, epson_180dpi, epson_60dpi, epson_lx800, fig, gpic, hp2623A,])
1106 AC_MSG_RESULT([    hp2648, hp500c, hpdj, hpgl, hpljii, hppj, imagen, kc_tek40xx, km_tek40xx,])
1107 AC_MSG_RESULT([    latex, metafont, metapost, mif, pbm, postscript, pslatex, nec_cp6, okidata,])
1108 AC_MSG_RESULT([    pcl5, pstex, pstricks, qms, regis, selanar, svg, starc, tandy_60dpi,])
1109 AC_MSG_RESULT([    tek40xx, tek410x, texdraw, tgif, tkcanvas, tpic, vttek)])
1110
1111 if test "$no_x" != yes; then
1112   if test "$enable_mouse" = yes; then
1113     AC_MSG_RESULT([  x11/xlib terminal: yes (with mouse support)])
1114   else
1115     AC_MSG_RESULT([  x11/xlib terminal: yes (without mouse support)])
1116   fi
1117   if test "$enable_x11_mbfonts" = yes; then
1118     AC_MSG_RESULT([    (with multi-byte fonts)])
1119   else
1120     AC_MSG_RESULT([    (without multi-byte fonts, requires support in libX11)])
1121   fi
1122   if test "$enable_binary_x11_polygon" = yes; then
1123     AC_MSG_RESULT([    (with binary polygon protocol)])
1124   else
1125     AC_MSG_RESULT([    (without binary polygon protocol)])
1126   fi
1127 else
1128     AC_MSG_RESULT([  X Window System terminal: no (requires X libraries)])
1129 fi
1130
1131 if test "$ac_cv_lib_gd_gdImageJpeg" = yes; then
1132   AC_MSG_RESULT([  jpeg terminal: yes])
1133 else
1134   AC_MSG_RESULT([  jpeg terminal: no (requires libgd with jpeg support)])
1135 fi
1136
1137 if test "$ac_cv_lib_gd_gdImageGif" = yes; then
1138   if test "$ac_cv_lib_gd_gdImageGifAnimBegin" = yes; then
1139     AC_MSG_RESULT([  gif terminal: yes (with animated gif)])
1140   else
1141     AC_MSG_RESULT([  gif terminal: yes (without animated gif, requires libgd support)])
1142   fi
1143 else
1144   AC_MSG_RESULT([  gif terminal: no (requires libgd with gif support)])
1145 fi
1146
1147
1148 if test "$ac_cv_lib_gd_gdImagePng" = yes; then
1149   AC_MSG_RESULT([  png terminal: yes])
1150 else
1151   AC_MSG_RESULT([  png terminal: no (requires libgd with png support)])
1152 fi
1153
1154 if test "$have_ttf" = yes; then
1155   AC_MSG_RESULT([    (jpeg, gif and png terminals can use TTF fonts)])
1156 else
1157   AC_MSG_RESULT([    (jpeg, gif and png terminals cannot use TTF fonts, requires libgd support)])
1158 fi
1159
1160 if test "$ac_cv_header_pdflib_h" = yes; then
1161   AC_MSG_RESULT([  pdf terminal: yes])
1162   if test "$ac_cv_lib_pdf_PDF_begin_pattern" != yes; then
1163     AC_MSG_RESULT([      (pattern fills not supported, libpdf too old)])
1164   fi
1165   if test "$ac_cv_lib_pdf_PDF_setdashpattern" != yes; then
1166     AC_MSG_RESULT([      (dash patterns not supported, libpdf too old)])
1167   fi
1168 else
1169   AC_MSG_RESULT([  pdf terminal: no (requires libpdf)])
1170 fi
1171
1172 if test x"$with_plot" != x; then
1173   if test "$with_plot" = yes; then
1174     AC_MSG_RESULT([  plot library terminal: yes (unixplot - UNIX version)])
1175   elif test "$with_plot" != no; then
1176     AC_MSG_RESULT([  plot library terminal: yes (gnugraph - GNU version)])
1177   else
1178     AC_MSG_RESULT([  plot library terminal: no (requires GNU plotutils or UNIX plot)])
1179   fi
1180 else
1181     AC_MSG_RESULT([  plot library terminal: no (use --with-plot to enable, requires GNU plotutils])
1182     AC_MSG_RESULT([                             or UNIX plot)])
1183 fi
1184
1185 if test "$with_linux_vga" = yes; then
1186     AC_MSG_RESULT([  linux terminal (vga console): yes])
1187   if test "$with_vgagl" = yes; then
1188     AC_MSG_RESULT([  vgagl terminal ((s)vga console): yes])
1189   else
1190     AC_MSG_RESULT([  vgagl terminal ((s)vga console): no (requires vgagl)])
1191   fi
1192   AC_MSG_RESULT([    SECURITY NOTICE: SVGAlib requires that gnuplot is installed suid root!])
1193 else
1194   AC_MSG_RESULT([  linux terminal (vga console): no (use --with-linux-vga to enable,])
1195   AC_MSG_RESULT([                                       requires SVGAlib)])
1196   AC_MSG_RESULT([  vgagl terminal ((s)vga console): no (use --with-linux-vga to enable,])
1197   AC_MSG_RESULT([                                       requires SVGAlib with vgagl)])
1198 fi
1199
1200 if test "$GGI_SUPPORT" = yes; then
1201   if test "$ac_cv_header_ggi_xmi_h" = yes; then
1202     AC_MSG_RESULT([  ggi terminal: yes (EXPERIMENTAL) (with pm3d support)])
1203   else
1204     AC_MSG_RESULT([  ggi terminal: yes (EXPERIMENTAL) (without pm3d support, requires libxmi)])
1205   fi
1206 else
1207   AC_MSG_RESULT([  ggi terminal: no (use --with-ggi to enable, requires libggi)])
1208 fi
1209
1210 if test "$enable_iris" = yes; then
1211   AC_MSG_RESULT([  iris4d terminal: yes])
1212 else
1213   AC_MSG_RESULT([  iris4d terminal: no (use --enable-iris to enable, requires libgl_s)])
1214 fi
1215
1216 if test "$enable_mgr" = yes; then
1217   AC_MSG_RESULT([  mgr terminal: yes])
1218 else
1219   AC_MSG_RESULT([  mgr terminal: no (use --enable-mgr to enable, requires libpixrect)])
1220 fi
1221
1222 if test "$enable_rgip" = yes ; then
1223   AC_MSG_RESULT([  rgip/uniplex terminal: yes])
1224 else
1225   AC_MSG_RESULT([  rgip/uniplex terminal: no (use --enable-rgip to enable)])
1226 fi
1227
1228 if test "$is_msdos" = yes; then
1229   AC_MSG_RESULT([  svga terminal (MSDOS/djgpp): yes])
1230 else
1231   AC_MSG_RESULT([  svga terminal (MSDOS/djgpp): no])
1232 fi
1233
1234 if test "$build_src_beos_subdir" = yes; then
1235   AC_MSG_RESULT([  be terminal (BeOS): yes])
1236 else
1237   AC_MSG_RESULT([  be terminal (BeOS): no])
1238 fi
1239
1240 if test "$is_next" = yes; then
1241   AC_MSG_RESULT([  next terminal: yes])
1242 else
1243   AC_MSG_RESULT([  next terminal: no])
1244 fi
1245
1246 if test "$is_apple" = yes; then
1247   AC_MSG_RESULT([  aqua terminal (MacOS X): yes])
1248 else
1249   AC_MSG_RESULT([  aqua terminal (MacOS X): no])
1250 fi
1251
1252 if test "$enable_wxwidgets_ok" = yes; then
1253   AC_MSG_RESULT([  wxt terminal: yes ])
1254 else
1255   AC_MSG_RESULT([  wxt terminal: no (requires C++, wxWidgets>2.6, cairo>0.9, pango>1.10)])
1256 fi
1257
1258 AC_MSG_RESULT([])
1259 AC_MSG_RESULT([  Additional terminals are availaible in platform-specific makefiles:])
1260 AC_MSG_RESULT([   amiga (makefile.amg and makefile.ami), apollo/gpr (makefile.unx), atari/vdi])
1261 AC_MSG_RESULT([   (makefile.st), cgi (makefile.unx), mtos (makefile.mto), pm (makefile.os2),])
1262 AC_MSG_RESULT([   sun (makefile.unx), unixpc (makefile.unx), windows (various Windows])
1263 AC_MSG_RESULT([   makefiles)])
1264
1265 AC_MSG_RESULT([  Additional terminals are built automatically if possible at compile-time:])
1266 AC_MSG_RESULT([   vesa (MSDOS), emxvga (MSDOS, OS/2), ega/vga/svga/ssvga/hercules (Windows with])
1267 AC_MSG_RESULT([   Zortec compiler), macintosh])
1268
1269
1270 AC_MSG_RESULT([])
1271 AC_MSG_RESULT([gnuplot will be compiled with the following features:])
1272 AC_MSG_RESULT([])
1273
1274 if test "$enable_fiterrvars" = yes; then
1275   AC_MSG_RESULT([  Fitting error variables: yes])
1276 else
1277   AC_MSG_RESULT([  Fitting error variables: no])
1278 fi
1279
1280 if test "$enable_datastrings" = yes; then
1281   AC_MSG_RESULT([  String-handling in datafiles: yes])
1282 else
1283   AC_MSG_RESULT([  String-handling in datafiles: no])
1284 fi
1285
1286 if test "$enable_histograms" = yes; then
1287   AC_MSG_RESULT([  Plot style histograms: yes])
1288 else
1289   AC_MSG_RESULT([  Plot style histograms: no (requires string-handling in datafiles)])
1290 fi
1291
1292 if test "$enable_stringvariables" = yes; then
1293   AC_MSG_RESULT([  String variables: yes])
1294 else
1295   AC_MSG_RESULT([  String variables: no])
1296 fi
1297
1298 if test "$enable_macros" = yes; then
1299   AC_MSG_RESULT([  Command line macros: yes (EXPERIMENTAL)])
1300 else
1301   AC_MSG_RESULT([  Command line macros: no (requires string variables)])
1302 fi
1303
1304 if test "$enable_objects" = yes; then
1305   AC_MSG_RESULT([  Placement of rectangles and other objects: yes (EXPERIMENTAL)])
1306 else
1307   AC_MSG_RESULT([  Placement of rectangles and other objects: no])
1308 fi
1309
1310 if test "$enable_with_image" = yes; then
1311   AC_MSG_RESULT([  Plot style image: yes (EXPERIMENTAL)])
1312 else
1313   AC_MSG_RESULT([  Plot style image: no])
1314 fi
1315
1316 if test "$enable_binary_data_file" = yes; then
1317   AC_MSG_RESULT([  General binary data file reading: yes (EXPERIMENTAL)])
1318 else
1319   AC_MSG_RESULT([  General binary data file reading: no])
1320 fi
1321
1322 AC_MSG_RESULT([])
1323 AC_MSG_RESULT([gnuplot will be compiled with the following options:])
1324 AC_MSG_RESULT([])
1325
1326 if test "$with_readline" = no; then
1327   AC_MSG_RESULT([  No readline support (use --with-readline=gnu or --with-readline=builtin)])
1328 fi
1329
1330   if test "$with_readline" = bsd; then
1331     if test -n "$gp_tcap"; then
1332       AC_MSG_RESULT([  Readline library: BSD editline with $gp_tcap])
1333     else
1334       AC_MSG_RESULT([  Readline library: BSD editline library])
1335     fi
1336   else if test "$with_readline" != builtin; then
1337     if test -n "$gp_tcap"; then
1338       AC_MSG_RESULT([  Readline library: GNU readline library with $gp_tcap])
1339     else
1340       AC_MSG_RESULT([  Readline library: GNU readline library])
1341     fi
1342   else
1343     AC_MSG_RESULT([  Readline library: builtin minimal (use --with-readline=gnu for GNU readline)])
1344   fi
1345 fi
1346
1347 if test "$enable_history_file" = yes; then
1348   AC_MSG_RESULT([  Command-line history file: yes])
1349 else
1350   AC_MSG_RESULT([  Command-line history file: no])
1351 fi
1352
1353 if test "$with_cwdrc" = yes; then
1354   AC_MSG_RESULT([  Check current directory for .gnuplot file: yes])
1355 else
1356   AC_MSG_RESULT([  Check current directory for .gnuplot file: no (use --with-cwdrc to enable)])
1357 fi
1358
1359 if test "$with_row_help" = no; then
1360   AC_MSG_RESULT([  Sort help/subtopic tables by column: yes])
1361 else
1362   AC_MSG_RESULT([  Sort help/subtopic tables by column: no (use --without-row-help to enable)])
1363 fi
1364
1365 if test "$with_kpsexpand" = yes; then
1366   AC_MSG_RESULT([  Use TeX kpsexpand to search for fonts: yes])
1367 else
1368   AC_MSG_RESULT([  Use TeX kpsexpand to search for fonts: no (use --with-kpsexpand to enable)])
1369 fi
1370
1371 if test "$enable_thin_splines" = yes; then
1372   AC_MSG_RESULT([  Thin plate splines: yes])
1373 else
1374   AC_MSG_RESULT([  Thin plate splines: no (use --enable-thin-spline to enable)])
1375 fi
1376
1377 if test "$enable_h3d_gridbox" = yes; then
1378   AC_MSG_RESULT([  Hidden3d optimization: gridbox])
1379 else
1380   if test "$enable_h3d_quadtree" = no; then
1381     AC_MSG_RESULT([  Hidden3d optimization: none])
1382   else
1383     AC_MSG_RESULT([  Hidden3d optimization: quadtree])
1384   fi
1385 fi
1386
1387 if test "$enable_backwards_compatibility" = yes; then
1388   AC_MSG_RESULT([  Deprecated syntax and terminal options : yes])
1389 else
1390   AC_MSG_RESULT([  Deprecated syntax and terminal options : no (use --enable-backwards-compatibility to enable)])
1391 fi
1392
1393
1394 AC_MSG_RESULT([])
1395 AC_MSG_RESULT([gnuplot will install the following additional materials:])
1396 AC_MSG_RESULT([])
1397
1398 if test "$with_lasergnu" = yes; then
1399   AC_MSG_RESULT([  lasergnu printer script: yes])
1400 else
1401   AC_MSG_RESULT([  lasergnu printer script: no (use --with-lasergnu to enable)])
1402 fi
1403
1404 if test "$with_lisp_files" != no; then
1405   AC_MSG_RESULT([  gnuplot-mode for X/Emacs: yes])
1406 else
1407   AC_MSG_RESULT([  gnuplot-mode for X/Emacs: no])
1408 fi
1409
1410 if test "$TUTORIAL" = tutorial; then
1411   AC_MSG_RESULT([  LaTeX tutorial: yes])
1412 else
1413   AC_MSG_RESULT([  LaTeX tutorial: no])
1414 fi
1415
1416 AC_MSG_RESULT([  Help file: yes (always), in $GIHDIR/gnuplot.gih])
1417
1418 AC_MSG_RESULT([  PostScript prologue files: yes (always)])
1419
1420 dnl end config report
1421
1422 dnl end configure.in