=================================================================== RCS file: /home/cvs/OpenXM_contrib/gnuplot/Attic/configure.in,v retrieving revision 1.1 retrieving revision 1.1.1.3 diff -u -p -r1.1 -r1.1.1.3 --- OpenXM_contrib/gnuplot/Attic/configure.in 2000/01/09 17:00:49 1.1 +++ OpenXM_contrib/gnuplot/Attic/configure.in 2003/09/15 07:09:22 1.1.1.3 @@ -1,142 +1,16 @@ dnl Process this file with autoconf to produce a configure script. dnl configure.in for gnuplot 3.7 on Unix. dnl -dnl Where possible, please adopt a convention that the absense of -dnl a macro is the usual case : this saves having to update -dnl countless makefiles when new tests are added. By usual case -dnl I guess ansi compiler on posix system or something like that +dnl $Id: configure.in,v 1.1.1.3 2003/09/15 07:09:22 ohara Exp $ dnl -dnl [Lars: this is no longer necessary. I have cut this stuff out -dnl of configure.in and added the necessery definitions to syscfg.h. -dnl This reduced the size of configure by 30k! -dnl -dnl $Id: configure.in,v 1.1 2000/01/09 17:00:49 maekawa Exp $ -dnl -AC_PREREQ(2.13) -AC_REVISION($Revision: 1.1 $) AC_INIT(graphics.c) +AM_CONFIG_HEADER(config.h:config.hin) +AC_PREREQ(2.13) + VERSION=`sed -n 's/.*version.*"\(.*\)".*/\1/p' $srcdir/version.c|tr -d ' '` -AM_INIT_AUTOMAKE(gnuplot, $VERSION) -AC_CONFIG_HEADER(config.h:config.hin) +PL=`sed -n 's/.*patchlevel.*"\(.*\)".*/\1/p' $srcdir/version.c|tr -d ' '` +AM_INIT_AUTOMAKE(gnuplot, $VERSION.$PL) -dnl Optional features. - -dnl Do not use the included readline function -AC_ARG_WITH(readline,dnl -[ --with-readline use the included minimal readline function (default) - --without-readline do not use the included readline function],, -test -z "$with_readline" && with_readline=yes -)dnl - -dnl The GNU readline library -AC_ARG_WITH(gnu-readline,dnl -[ --with-gnu-readline use the GNU readline library - --with-gnu-readline=PATH Specify the location of GNU readline],, -test -z "$with_gnu_readline" && with_gnu_readline=no -)dnl - -dnl If no PATH 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 use the Unix plot library - --with-plot=PATH Specify the location of GNU libplot],, -test -z "$with_plot" && with_plot=no -)dnl - -dnl The gif terminal with Tom Boutell's gd library -AC_ARG_WITH(gd,dnl -[ --with-gd enable gif terminal with Tom Boutell's gd library - (requires GD library) - --with-gd=PATH Specify the location of libgd],, -test -z "$with_gd" && with_gd=yes -)dnl - -dnl The Portable Network Graphics (png) terminal -AC_ARG_WITH(png,dnl -[ --with-png enable png terminal - (requires libpng and libz) - --with-png=PATH Specify the location of libpng],, -test -z "$with_png" && with_png=yes -)dnl - -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], -test "$withval" = no && AC_DEFINE(NOCWDRC), AC_DEFINE(NOCWDRC) -)dnl - -dnl Install the lasergnu printer script -AC_ARG_WITH(lasergnu,dnl -[ --with-lasergnu install lasergnu printer script], -if test "$withval" = yes; then LASERGNU=lasergnu_install; \ -else LASERGNU=lasergnu_noinstall; fi, LASERGNU=lasergnu_noinstall -)dnl - -dnl The Linux console driver -AC_ARG_WITH(linux-vga,dnl -[ --without-linux-vga do not use the Linux console driver - (requires Linux SVGAlib /usr/lib/libvga)],, -test -z "$with_linux_vga" && with_linux_vga=yes -)dnl - -dnl Apollo Graphics Primitive Resource -AC_ARG_ENABLE(apollo,dnl -[ --enable-apollo Apollo Graphics Primitive Resource],, -test -z "$enable_apollo" && enable_apollo=no -)dnl - -dnl Apollo Graphics Primitive Resource (fixed-size window) -AC_ARG_ENABLE(gpr,dnl -[ --enable-gpr Apollo Graphics Primitive Resource (fixed-size window)],, -test -z "$enable_gpr" && enable_gpr=no -)dnl - -dnl On SCO only: cgi terminal -AC_ARG_ENABLE(cgi,dnl -[ --enable-cgi enable CGI terminal (SCO only)],, -test -z "$enable_cgi" && enable_cgi=no -)dnl - -dnl IRIS terminal on IRIS4D series computer -AC_ARG_ENABLE(iris,dnl -[ --enable-iris enable IRIS terminal (IRIS4D only)],, -test -z "$enable_iris" && enable_iris=no -)dnl - -dnl MGR Window system -AC_ARG_ENABLE(mgr,dnl -[ --enable-mgr enable MGR terminal],, -test -z "$enable_mgr" && enable_mgr=no -)dnl - -dnl Redwood Graphics Interface Protocol -AC_ARG_ENABLE(rgip,dnl -[ --enable-rgip enable Redwood Graphics Interface Protocol],, -test -z "$enable_rgip" && enable_rgip=no -)dnl - -dnl SUNview driver -AC_ARG_ENABLE(sun,dnl -[ --enable-sun enable sunview terminal (Sun only)],, -test -z "$enable_sun" && enable_sun=no -)dnl - -dnl ATT 3b1 or ATT 7300 unixpc -AC_ARG_ENABLE(unixpc,dnl -[ --enable-unixpc enable unixpc terminal (ATT 3b1 or ATT 7300)],, -test -z "$enable_unixpc" && enable_unixpc=no -)dnl - -dnl enable system time routines -AC_ARG_ENABLE(system-time,dnl -[ --enable-system-time use the system time routines in time.c],, -test -z "$enable_system_time" && enable_system_time=no -)dnl - -dnl configure.in body - dnl Compiler characteristics dnl Check for ANSI C prototypes, the const and inline keywords, dnl and ANSI style stringification @@ -159,26 +33,43 @@ AC_TRY_CPP([#if 0 AC_SUBST(ERRORFIX) dnl X Window System files. -AC_SUBST(X_LIBRARIES) +AC_SUBST(LIBRARIES_FOR_X) AC_SUBST(GNUPLOT_X11) 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" - X_LIBRARIES="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" + LIBRARIES_FOR_X="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" GNUPLOT_X11=gnuplot_x11 - AC_DEFINE(X11) + AC_DEFINE(X11, 1, + [ Define if you are using the X11 window system. ]) fi dnl Operating systems. dnl FIXME AC_DEFINE(ISC22) dnl FIXME AC_DEFINE(KSR) -dnl Check for MSDOS and djgpp, NeXT -gp_MSDOS -gp_NEXT +dnl Check for MSDOS and djgpp, NeXT, Apple MacOsX (NeXT like), BeOS +GP_MSDOS +GP_NEXT +GP_APPLE +GP_BEOS +dnl Apparently, -lNeXT_s is needed on NeXT +dnl _instead_ of -lm ... +AC_CHECK_FUNC(sin) +if test "$ac_cv_func_sin" = no ; then + AC_CHECK_LIB(m,sin) +fi dnl this has to be after -lsys_s on NeXT -LIBS="$LIBS -lm" +dnlLIBS="$LIBS -lm" dnl Header files. ANSI first @@ -187,12 +78,14 @@ dnl configure's HAVE_XXXX defines are translated into dnl headers and functions AC_HEADER_STDC -dnl Standard headers +dnl Header files +dnl ANSI/ISO C, POSIX, others AC_CHECK_HEADERS(errno.h float.h limits.h locale.h math.h stdlib.h string.h \ - time.h sys/time.h sys/timeb.h sys/types.h) -dnl other -AC_CHECK_HEADERS(sys/bsdtypes.h sys/select.h sys/socket.h sys/stat.h \ - sys/systeminfo.h sys/utsname.h libc.h malloc.h sgtty.h termios.h values.h) + time.h sys/time.h sys/timeb.h sys/types.h \ + sys/bsdtypes.h sys/select.h sys/socket.h sys/stat.h \ + sys/systeminfo.h sys/utsname.h libc.h malloc.h sgtty.h termios.h values.h +) + test "$ac_cv_header_sys_stat_h" = yes && AC_HEADER_STAT dnl check if unistd actually declares anything. On NeXT 3.2 unistd is @@ -207,263 +100,358 @@ AC_TRY_COMPILE( #ifdef HAVE_ERRNO_H #include #endif], - errno=0,AC_MSG_RESULT(yes),AC_DEFINE(EXTERN_ERRNO) AC_MSG_RESULT(no)) + errno=0,AC_MSG_RESULT(yes), + AC_DEFINE(EXTERN_ERRNO, 1, + [ Define if declares errno. ]) + AC_MSG_RESULT(no) +)dnl dnl Types. AC_TYPE_SIZE_T AC_MSG_CHECKING(for time_t in time.h) -AC_EGREP_HEADER(time_t,time.h,dnl - [ ac_cv_type_time_t=yes; AC_MSG_RESULT(yes) ],dnl - [ AC_MSG_RESULT(no) AC_CHECK_TYPE(time_t, long)]) +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() -AC_CHECK_FUNCS(atexit on_exit memcpy memmove memset bcopy bzero setvbuf \ - strerror strchr index strrchr rindex strstr) - 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(erf erfc gamma lgamma getcwd pclose popen sleep snprintf \ - strncasecmp strnicmp sysinfo tcgetattr) +AC_CHECK_FUNCS(atexit memcpy memmove memset \ + on_exit bcopy bzero \ + setvbuf strerror strchr strrchr strstr \ + index rindex \ + erf erfc gamma lgamma \ + getcwd poll pclose popen select sleep snprintf stpcpy \ + strcspn strdup strcasecmp stricmp strncasecmp strnicmp \ + sysinfo tcgetattr vfprintf doprnt +) + +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 . (joze) +AC_MSG_CHECKING(for sigsetjmp) +AC_TRY_LINK([#include ], [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 && test "$ac_cv_func_popen" = yes ; then - AC_DEFINE(PIPES) + AC_DEFINE(PIPES, 1, + [ Define if you do have the popen and pclose functions. ]) fi -dnl arg types for select -AC_FUNC_SELECT_ARGTYPES +dnl Argument types of select() +AC_FUNC_SELECT dnl On SVR3. dnl FIXME AC_DEFINE(CRIPPLED_SELECT) +dnl Install the lasergnu printer script (default no) +LASERGNU=lasergnu_noinstall +AC_ARG_WITH(lasergnu,dnl +[ --with-lasergnu install lasergnu printer script], + test "$withval" = yes && LASERGNU=lasergnu_install) + +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) + [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="$TERMLIBS -lvga"],dnl + TERMLIBS="-lvga $TERMLIBS"], with_linux_vga=no) fi +dnl Use builtin readline or GNU readline +AC_ARG_WITH(readline,dnl +[ --with-readline use the builtin minimal readline function (default) + --without-readline do not use the builtin readline function + --with-readline=gnu use the GNU readline library + --with-readline=PATH Specify the location of GNU readline],, + test -z "$with_readline" && with_readline=yes) + dnl GNU readline and the required terminal library -if test "$with_gnu_readline" != no; then - 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}*) - AC_MSG_RESULT([using ${gp_tcap} with readline]) - break - ;; - esac - done +if test "$with_readline" != no; then + if test "$with_readline" != yes; then + 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_gnu_readline" = yes; then - AC_CHECK_LIB(readline, readline,dnl - LIBS="$LIBS -lreadline $gp_tcap" - AC_DEFINE(GNU_READLINE) - with_readline=no,dnl - AC_MSG_ERROR([Can't find -lreadline in a standard path -- specify its location using --with-gnu-readline=/path/to/libreadline.a]),dnl - ${gp_tcap})dnl readline - else - if test ! -f $with_gnu_readline ; then - if test ! -f ${with_gnu_readline}/lib/libreadline.a ; then - if test ! -f ${with_gnu_readline}/libreadline.a ; then - AC_MSG_ERROR([GNU readline library not found]) - else - AC_MSG_RESULT([using ${with_gnu_readline}/libreadline.a]) - LIBS="$LIBS ${with_gnu_readline}/libreadline.a $gp_tcap" - fi - else - AC_MSG_RESULT([using ${with_gnu_readline}/lib/libreadline.a]) - LIBS="$LIBS ${with_gnu_readline}/lib/libreadline.a $gp_tcap" - fi + if test "$with_readline" = gnu; then + AC_CHECK_LIB(readline, readline, + TERMLIBS="-lreadline $gp_tcap $TERMLIBS",, ${gp_tcap}) else - AC_MSG_RESULT([using ${with_gnu_readline}]) - LIBS="$LIBS $with_gnu_readline $gp_tcap" - fi + 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_DEFINE(GNU_READLINE) - with_readline=no - fi -fi + AC_CHECK_LIB(readline,readline, + TERMLIBS="-lreadline $gp_tcap $TERMLIBS",,[${gp_tcap}]) -test "$with_readline" = yes && AC_DEFINE(READLINE) -dnl end readline + fi -dnl libplot -if test "$with_plot" != no; then - if test "$with_plot" = yes; then - dnl Unix plot library - AC_CHECK_LIB(plot,openpl,dnl - AC_DEFINE(UNIXPLOT) - TERMLIBS="$TERMLIBS -lplot",dnl - with_plot=no) - else - dnl GNU plot library - test for new version first - TERMXLIBS="$X_LIBS -lXaw -lXmu -lXt -lXext -lX11" - gp_SEARCH_LIBDIRS(plot,textangle,[$TERMXLIBS]) - if test "$ac_cv_lib_plot_textangle" = no; then - TERMXLIBS= - gp_SEARCH_LIBDIRS(plot,rotate) - if test "$ac_cv_lib_plot_rotate" = no; then - AC_MSG_WARN([can't find GNU libplot -- disabling gnugraph terminal]) - with_plot=no - else - AC_MSG_RESULT([ - using obsolete GNU graphics library]) - AC_DEFINE(GNUGRAPH) - fi # old GNU plotlib + if test "$ac_cv_lib_readline_readline" = no; then + AC_MSG_WARN([GNU readline not found - falling back to builtin readline]) + with_readline=yes else - AC_MSG_RESULT([ - using GNU plotutils library]) - AC_DEFINE(GNUGRAPH) - AC_DEFINE(GNU_PLOTUTILS) - fi # new GNU plotlib - fi # Unix plotlib -fi -dnl end plot + AC_DEFINE(HAVE_LIBREADLINE, 1, + [ Define if you are using the GNU readline library. ]) + fi # ! ac_cv_lib_readline_readline = no -dnl check for Tom Boutell's gd library -if test "$with_gd" != no; then - gp_SEARCH_LIBDIRS(gd,gdImageCreate) - if test "$ac_cv_lib_gd_gdImageCreate" = yes; then - gp_SEARCH_HEADERDIRS(gd.h,, - AC_MSG_WARN([found gd library but not gd.h]) - AC_MSG_WARN([please add path to gd.h to CPPFLAGS in Makefile]) - )dnl gp_SEARCH_HEADERDIRS - AC_DEFINE(HAVE_LIBGD) - else - AC_MSG_RESULT([- see term/gif.trm for download details]) + fi # with_readline" != yes + + if test "$with_readline" = yes; then + AC_DEFINE(READLINE, 1, + [ Define if you want to use the included readline function. ]) fi + fi -dnl end gd +dnl end readline -dnl check for png and z library -if test "$with_png" != no; then - gp_SEARCH_LIBDIRS(png,png_info_init,[-lz]) - if test "$ac_cv_lib_png_png_info_init" = yes; then - TERMLIBS="$TERMLIBS -lz" - gp_SEARCH_HEADERDIRS(png.h,, - AC_MSG_WARN([found png library but not png.h]) - AC_MSG_WARN([please add path to png.h to CPPFLAGS in Makefile]) - )dnl gp_SEARCH_HEADERIRS - gp_SEARCH_HEADERDIRS(zlib.h,, - AC_MSG_WARN([found z library but not zlib.h]) - AC_MSG_WARN([please add path to zlib.h to CPPFLAGS in Makefile]) - )dnl gp_SEARCH_HEADERDIRS - if test "$ac_cv_header_png_h" = yes; then +dnl The gif terminal with Tom Boutell's gd library +AC_ARG_WITH(gd,dnl +[ --with-gd[=PATH] enable gif terminal with Tom Boutell's gd library + (requires GD library)], + [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(gd,gdImageGif, + [TERMLIBS="-lgd $TERMLIBS" + AC_CHECK_HEADERS(gd.h, + AC_DEFINE(HAVE_LIBGD, 1, [ Define if you have Thomas Boutell's gd library. ]), + AC_MSG_WARN([found gd library but not gd.h +please add path to gd.h to CPPFLAGS in Makefile]) + )], + AC_MSG_RESULT([ GD library not found or cannot create gif images. + See term/gif.trm for download details])) + fi]) +dnl end gd library + +dnl If no PATH 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[=PATH] 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 The Portable Network Graphics (png) terminal +AC_ARG_WITH(png,dnl +[ --with-png[=PATH] enable png terminal + (requires libpng and libz)], + [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 + with_png=yes + fi],with_png=yes) + +if test "$with_png" = yes; then + AC_CHECK_LIB(png,png_init_io, + [TERMLIBS="-lpng -lz $TERMLIBS" + AC_CHECK_HEADERS(png.h, + [AC_CHECK_HEADERS(zlib.h,, + AC_MSG_WARN([found z library but not zlib.h +please add path to zlib.h to CPPFLAGS in Makefile])) AC_EGREP_CPP([You lose], [#include "png.h" #if PNG_LIBPNG_VER < 89 You lose. #endif -],dnl - AC_MSG_WARN([- libpng too old - not including png driver]),dnl - AC_DEFINE(HAVE_LIBPNG)) - else - AC_MSG_WARN([- cannot check png version - compilation may fail]) - AC_DEFINE(HAVE_LIBPNG) - fi - else - AC_MSG_RESULT([- see term/png.trm for download details]) +], + AC_MSG_WARN([- libpng too old - not including png driver]) + ac_cv_header_png_h=no)], + AC_MSG_WARN([found png library but not png.h +please add path to png.h to CPPFLAGS in Makefile]))], + AC_MSG_RESULT([ PNG library not found. + See term/png.trm for download details]), + [-lz]) + + if test "$ac_cv_header_png_h" = yes; then + AC_DEFINE(HAVE_LIBPNG, 1, + [ Define if you have the png library. ]) fi fi dnl end png and z -dnl create list of terminals -AC_MSG_CHECKING([terminal driver sources]) -( cd $srcdir/term && for i in *.trm ; do echo '${srcdir}'/../term/$i ; done )\ - |(tr '\012' @; echo) |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012' >termlist -TERM_LIST=termlist -AC_SUBST_FILE(TERM_LIST) -AC_MSG_RESULT([list created]) +dnl The Portable Document Format (PDF) terminal +AC_ARG_WITH(pdf,dnl +[ --with-pdf[=PATH] enable pdf terminal + (requires PDFLib)], + [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 + with_pdf=yes + fi],with_pdf=no) +if test "$with_pdf" = yes; then + AC_CHECK_LIB(pdf,PDF_get_majorversion, + [TERMLIBS="-lpdf $TERMLIBS" + AC_DEFINE(HAVE_LIBPDF,1, + [ Define if you have the pdf library. ]) + AC_CHECK_HEADERS(pdflib.h,, + AC_MSG_WARN([found pdf library but not pdflib.h +please add path to pdflib.h to CPPFLAGS in Makefile])) + AC_CHECK_HEADERS(zlib.h,, + AC_MSG_WARN([found z library but not zlib.h +please add path to zlib.h to CPPFLAGS in Makefile]))], + AC_MSG_RESULT([ PDF library not found. + See term/pdf.trm for download details])) + + if test "$ac_cv_header_pdflib_h" = yes; then + AC_DEFINE(HAVE_LIBPDF, 1, + [ Define if you have the pdf library. ]) + 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 Process enable options +dnl Removed enable options for these +dnl Just autodetect -if test "$enable_apollo" = yes; then - AC_EGREP_CPP(yes, - [#ifdef apollo - yes - #endif - ],AC_DEFINE(APOLLO),dnl - enable_apollo=no) -fi +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")) -if test "$enable_gpr" = yes; then - AC_EGREP_CPP(yes, - [#ifdef apollo - yes - #endif - ],AC_DEFINE(APOLLO) AC_DEFINE(GPR),dnl - enable_gpr=no) -fi +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])) -if test "$enable_cgi" = yes; then - AC_EGREP_CPP(yes, - [#ifdef SCO - yes - #endif - ],AC_CHECK_LIB(ccgi,v_opnwk,dnl - AC_DEFINE(CGI) - TERMLIBS="$TERMLIBS -lccgi"),dnl - enable_cgi=no) -fi +dnl Process enable options -if test "$enable_iris" = yes; then - AC_CHECK_LIB(gl_s,winopen,dnl - AC_DEFINE(IRIS) - TERMLIBS="$TERMLIBS -lgl_s",dnl - enable_iris=no) -fi +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]) -if test "$enable_mgr" = yes; then - AC_CHECK_LIB(mgr,m_getinfo,dnl - AC_DEFINE(MGR)dnl - TERMLIBS="$TERMLIBS -lmgr -lpixrect",dnl - enable_mgr=no,[-lpixrect]) -fi +dnl ggi driver +AC_ARG_ENABLE(ggi,dnl +[ --enable-ggi enable ggi driver (EXPERIMENTAL)], + [AC_CHECK_LIB(ggi,ggiInit, + AC_CHECK_LIB(ggiwmh,ggiWmhInit, + AC_DEFINE(HAVE_GGI, 1, + [ Define if you have the required ggi libraries. ]), + enable_ggi=no), + enable_ggi=no) + ] +)dnl -if test "$enable_rgip" = yes; then - AC_DEFINE(RGIP) -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]) -if test "$enable_sun" = yes; then - AC_CHECK_LIB(suntool,window_create,dnl - AC_DEFINE(SUN)dnl - TERMLIBS="$TERMLIBS -lsuntool -lsunwindow -lpixrect",dnl - enable_sun=no,[-lsunwindow -lpixrect]) -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]) -if test "$enable_unixpc" = yes; then - AC_EGREP_CPP(yes, - [/* Not sure about this; definitely - * true for gcc */ - #ifdef unixpc - yes - #endif - ],AC_DEFINE(UNIXPC),dnl - enable_unixpc=no) -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]) -if test "$enable_system_time" = yes; then - AC_DEFINE(USE_SYSTEM_TIME) -fi - dnl Substitute variables AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_SUBST(LASERGNU) AC_SUBST(LINUXSUID) -AC_SUBST(NEXTOBJS) AC_SUBST(TERMLIBS) AC_SUBST(TERMXLIBS) @@ -476,68 +464,73 @@ AC_MSG_RESULT([ Where is the help file? $gp_datadir/gnuplot.gih ]) -test "$ac_cv_header_gd_h" = yes && \ - AC_MSG_RESULT([ Enable generation of GIF files.]) +if test "$ac_cv_header_gd_h" = yes; then + AC_MSG_RESULT([ Enable generation of GIF files]) +fi -test "$ac_cv_header_zlib_h" = yes && \ - AC_MSG_RESULT([ Enable generation of PNG files.]) +if test "$ac_cv_header_pdflib_h" = yes; then + AC_MSG_RESULT([ Enable generation of PDF files]) +fi -test "$with_cwdrc" = yes && \ - AC_MSG_RESULT([ Check current directory for .gnuplot file.]) +if test "$ac_cv_header_png_h" = yes; then + AC_MSG_RESULT([ Enable generation of PNG files]) +fi -if test "$with_gnu_readline" != no; then - AC_MSG_RESULT([ Use GNU readline library.]) -else - test "$with_readline" != no && \ - AC_MSG_RESULT([ Use included readline.]) +if test "$with_cwdrc" = yes; then + AC_MSG_RESULT([ Check current directory for .gnuplot file]) fi -if test "$with_plot" = yes; then - AC_MSG_RESULT([ Use the Unix plot library.]) -elif test "$with_plot" != no; then - AC_MSG_RESULT([ Use the GNU plot library.]) +if test "$with_readline" != no; then + if test "$with_readline" != yes; then + AC_MSG_RESULT([ Use GNU readline library]) + test -n "$gp_tcap" && AC_MSG_RESULT([ with ${gp_tcap}]) + else + AC_MSG_RESULT([ Use builtin minimal readline]) + fi fi -test "$with_lasergnu" = yes && \ - AC_MSG_RESULT([ Install lasergnu printer script.]) +if test x"$with_plot" != x; then + if test "$with_plot" = yes; then + AC_MSG_RESULT([ Use the Unix plot library]) + else + AC_MSG_RESULT([ Use the GNU plot library v2.2 or better]) + fi +fi -test "$with_linux_vga" = yes && \ - AC_MSG_RESULT([ Use the Linux console driver.]) +if test "$with_lasergnu" = yes; then + AC_MSG_RESULT([ Install lasergnu printer script]) +fi -test "$enable_apollo" = yes && \ - AC_MSG_RESULT([ Enable Apollo terminal (resizeable window).]) +if test "$with_linux_vga" = yes; then + AC_MSG_RESULT([ Use the Linux SVGA console driver]) + AC_MSG_RESULT([ SECURITY NOTICE: SVGAlib requires that]) + AC_MSG_RESULT([ gnuplot is installed suid root!]) +fi -test "$enable_cgi" = yes && \ - AC_MSG_RESULT([ Enable cgi terminal (SCO).]) +if test "$enable_ggi" = yes; then + AC_MSG_RESULT([ Enable ggi terminal (EXPERIMENTAL)]) +fi -test "$enable_gpr" = yes && \ - AC_MSG_RESULT([ Enable Apollo terminal (fixed-size window).]) +if test "$enable_iris" = yes; then + AC_MSG_RESULT([ Enable IRIS terminal]) +fi -test "$enable_iris" = yes && \ - AC_MSG_RESULT([ Enable IRIS terminal.]) +if test "$enable_mgr" = yes; then + AC_MSG_RESULT([ Enable MGR terminal]) +fi -test "$enable_mgr" = yes && \ - AC_MSG_RESULT([ Enable MGR terminal.]) +if test "$enable_rgip" = yes; then + AC_MSG_RESULT([ Enable RGIP terminal]) +fi -test "$enable_rgip" = yes && \ - AC_MSG_RESULT([ Enable RGIP terminal.]) - -test "$enable_sun" = yes && \ - AC_MSG_RESULT([ Enable sunview terminal.]) - -test "$enable_unixpc" = yes && \ - AC_MSG_RESULT([ Enable unixpc terminal (ATT 3b1 or ATT 7300).]) - -test "$enable_system_time" = yes && \ - AC_MSG_RESULT([ Use system time routines in time.c.]) - -test "$no_x" != yes && \ - AC_MSG_RESULT([ Use the X Window System. +if test "$no_x" != yes; then + AC_MSG_RESULT([ Use the X Window System ]) +fi dnl end config report dnl Write Makefiles and configuration header AC_OUTPUT([Makefile docs/Makefile docs/latextut/Makefile], \ -[test -z "$CONFIG_HEADERS" || echo timestamp >stamp-h ; rm -f termlist]) +[test -z "$CONFIG_HEADERS" || echo timestamp >stamp-h]) dnl end configure.in