Annotation of OpenXM_contrib/gnuplot/configure.in, Revision 1.1.1.1
1.1 maekawa 1: dnl Process this file with autoconf to produce a configure script.
2: dnl configure.in for gnuplot 3.7 on Unix.
3: dnl
4: dnl Where possible, please adopt a convention that the absense of
5: dnl a macro is the usual case : this saves having to update
6: dnl countless makefiles when new tests are added. By usual case
7: dnl I guess ansi compiler on posix system or something like that
8: dnl
9: dnl [Lars: this is no longer necessary. I have cut this stuff out
10: dnl of configure.in and added the necessery definitions to syscfg.h.
11: dnl This reduced the size of configure by 30k!
12: dnl
13: dnl $Id: configure.in,v 1.90 1998/06/18 14:52:55 ddenholm Exp $
14: dnl
15: AC_PREREQ(2.13)
16: AC_REVISION($Revision: 1.90 $)
17: AC_INIT(graphics.c)
18: VERSION=`sed -n 's/.*version.*"\(.*\)".*/\1/p' $srcdir/version.c|tr -d ' '`
19: AM_INIT_AUTOMAKE(gnuplot, $VERSION)
20: AC_CONFIG_HEADER(config.h:config.hin)
21:
22: dnl Optional features.
23:
24: dnl Do not use the included readline function
25: AC_ARG_WITH(readline,dnl
26: [ --with-readline use the included minimal readline function (default)
27: --without-readline do not use the included readline function],,
28: test -z "$with_readline" && with_readline=yes
29: )dnl
30:
31: dnl The GNU readline library
32: AC_ARG_WITH(gnu-readline,dnl
33: [ --with-gnu-readline use the GNU readline library
34: --with-gnu-readline=PATH Specify the location of GNU readline],,
35: test -z "$with_gnu_readline" && with_gnu_readline=no
36: )dnl
37:
38: dnl If no PATH argument given, use the Unix plot library
39: dnl Else use either GNU libplot from plotutils,
40: dnl or ancient GNU graphics libplot
41: AC_ARG_WITH(plot,dnl
42: [ --with-plot use the Unix plot library
43: --with-plot=PATH Specify the location of GNU libplot],,
44: test -z "$with_plot" && with_plot=no
45: )dnl
46:
47: dnl The gif terminal with Tom Boutell's gd library
48: AC_ARG_WITH(gd,dnl
49: [ --with-gd enable gif terminal with Tom Boutell's gd library
50: (requires GD library)
51: --with-gd=PATH Specify the location of libgd],,
52: test -z "$with_gd" && with_gd=yes
53: )dnl
54:
55: dnl The Portable Network Graphics (png) terminal
56: AC_ARG_WITH(png,dnl
57: [ --with-png enable png terminal
58: (requires libpng and libz)
59: --with-png=PATH Specify the location of libpng],,
60: test -z "$with_png" && with_png=yes
61: )dnl
62:
63: dnl Use .gnuplot file in current directory
64: AC_ARG_WITH(cwdrc,dnl
65: [ --with-cwdrc check current directory for .gnuplot file,
66: normally disabled for security reasons],
67: test "$withval" = no && AC_DEFINE(NOCWDRC), AC_DEFINE(NOCWDRC)
68: )dnl
69:
70: dnl Install the lasergnu printer script
71: AC_ARG_WITH(lasergnu,dnl
72: [ --with-lasergnu install lasergnu printer script],
73: if test "$withval" = yes; then LASERGNU=lasergnu_install; \
74: else LASERGNU=lasergnu_noinstall; fi, LASERGNU=lasergnu_noinstall
75: )dnl
76:
77: dnl The Linux console driver
78: AC_ARG_WITH(linux-vga,dnl
79: [ --without-linux-vga do not use the Linux console driver
80: (requires Linux SVGAlib /usr/lib/libvga)],,
81: test -z "$with_linux_vga" && with_linux_vga=yes
82: )dnl
83:
84: dnl Apollo Graphics Primitive Resource
85: AC_ARG_ENABLE(apollo,dnl
86: [ --enable-apollo Apollo Graphics Primitive Resource],,
87: test -z "$enable_apollo" && enable_apollo=no
88: )dnl
89:
90: dnl Apollo Graphics Primitive Resource (fixed-size window)
91: AC_ARG_ENABLE(gpr,dnl
92: [ --enable-gpr Apollo Graphics Primitive Resource (fixed-size window)],,
93: test -z "$enable_gpr" && enable_gpr=no
94: )dnl
95:
96: dnl On SCO only: cgi terminal
97: AC_ARG_ENABLE(cgi,dnl
98: [ --enable-cgi enable CGI terminal (SCO only)],,
99: test -z "$enable_cgi" && enable_cgi=no
100: )dnl
101:
102: dnl IRIS terminal on IRIS4D series computer
103: AC_ARG_ENABLE(iris,dnl
104: [ --enable-iris enable IRIS terminal (IRIS4D only)],,
105: test -z "$enable_iris" && enable_iris=no
106: )dnl
107:
108: dnl MGR Window system
109: AC_ARG_ENABLE(mgr,dnl
110: [ --enable-mgr enable MGR terminal],,
111: test -z "$enable_mgr" && enable_mgr=no
112: )dnl
113:
114: dnl Redwood Graphics Interface Protocol
115: AC_ARG_ENABLE(rgip,dnl
116: [ --enable-rgip enable Redwood Graphics Interface Protocol],,
117: test -z "$enable_rgip" && enable_rgip=no
118: )dnl
119:
120: dnl SUNview driver
121: AC_ARG_ENABLE(sun,dnl
122: [ --enable-sun enable sunview terminal (Sun only)],,
123: test -z "$enable_sun" && enable_sun=no
124: )dnl
125:
126: dnl ATT 3b1 or ATT 7300 unixpc
127: AC_ARG_ENABLE(unixpc,dnl
128: [ --enable-unixpc enable unixpc terminal (ATT 3b1 or ATT 7300)],,
129: test -z "$enable_unixpc" && enable_unixpc=no
130: )dnl
131:
132: dnl enable system time routines
133: AC_ARG_ENABLE(system-time,dnl
134: [ --enable-system-time use the system time routines in time.c],,
135: test -z "$enable_system_time" && enable_system_time=no
136: )dnl
137:
138: dnl configure.in body
139:
140: dnl Compiler characteristics
141: dnl Check for ANSI C prototypes, the const and inline keywords,
142: dnl and ANSI style stringification
143: AC_PROG_CC
144: AM_C_PROTOTYPES
145: AC_PROG_CPP
146: AC_C_CONST
147: AC_C_INLINE
148: AC_C_STRINGIZE
149:
150: AC_MSG_CHECKING(if compiler handles warn and error directives correctly)
151: AC_TRY_CPP([#if 0
152: #error "error"
153: #warning "warning"
154: #endif],
155: ERRORFIX=
156: AC_MSG_RESULT(yes),dnl
157: ERRORFIX=errorfix
158: AC_MSG_RESULT(no))
159: AC_SUBST(ERRORFIX)
160:
161: dnl X Window System files.
162: AC_SUBST(X_LIBRARIES)
163: AC_SUBST(GNUPLOT_X11)
164: AC_PATH_XTRA
165: if test "$no_x" != yes; then
166: CPPFLAGS="$CPPFLAGS $X_CFLAGS"
167: X_LIBRARIES="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
168: GNUPLOT_X11=gnuplot_x11
169: AC_DEFINE(X11)
170: fi
171:
172:
173: dnl Operating systems.
174: dnl FIXME AC_DEFINE(ISC22)
175: dnl FIXME AC_DEFINE(KSR)
176: dnl Check for MSDOS and djgpp, NeXT
177: gp_MSDOS
178: gp_NEXT
179:
180: dnl this has to be after -lsys_s on NeXT
181: LIBS="$LIBS -lm"
182:
183:
184: dnl Header files. ANSI first
185: dnl We prefer that the absense of a macro is the norm, so in syscfg.h
186: dnl configure's HAVE_XXXX defines are translated into NO_XXXX for ANSI
187: dnl headers and functions
188: AC_HEADER_STDC
189:
190: dnl Standard headers
191: AC_CHECK_HEADERS(errno.h float.h limits.h locale.h math.h stdlib.h string.h \
192: time.h sys/time.h sys/timeb.h sys/types.h)
193: dnl other
194: AC_CHECK_HEADERS(sys/bsdtypes.h sys/select.h sys/socket.h sys/stat.h \
195: sys/systeminfo.h sys/utsname.h libc.h malloc.h sgtty.h termios.h values.h)
196: test "$ac_cv_header_sys_stat_h" = yes && AC_HEADER_STAT
197:
198: dnl check if unistd actually declares anything. On NeXT 3.2 unistd is
199: dnl conditionalized for _POSIX_SOURCE
200: AC_MSG_CHECKING(for unistd.h)
201: AC_EGREP_HEADER(execv, unistd.h, AC_DEFINE(HAVE_UNISTD_H) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
202:
203: dnl check if errno.h header declares errno
204: AC_MSG_CHECKING(if errno variable is declared)
205: AC_TRY_COMPILE(
206: [#include <stdio.h>
207: #ifdef HAVE_ERRNO_H
208: #include <errno.h>
209: #endif],
210: errno=0,AC_MSG_RESULT(yes),AC_DEFINE(EXTERN_ERRNO) AC_MSG_RESULT(no))
211:
212:
213: dnl Types.
214: AC_TYPE_SIZE_T
215: AC_MSG_CHECKING(for time_t in time.h)
216: AC_EGREP_HEADER(time_t,time.h,dnl
217: [ ac_cv_type_time_t=yes; AC_MSG_RESULT(yes) ],dnl
218: [ AC_MSG_RESULT(no) AC_CHECK_TYPE(time_t, long)])
219: AC_TYPE_SIGNAL
220:
221:
222: dnl Functions. Standard first, then others
223:
224: dnl sunos 4 has on_exit() in place of atexit()
225: AC_CHECK_FUNCS(atexit on_exit memcpy memmove memset bcopy bzero setvbuf \
226: strerror strchr index strrchr rindex strstr)
227:
228: dnl gamma is called lgamma on apollos and linux
229: dnl we prefer lgamma over gamma, see specfun.c
230: dnl math lib is already available, see operating systems part
231: AC_CHECK_FUNCS(erf erfc gamma lgamma getcwd pclose popen sleep snprintf \
232: strncasecmp strnicmp sysinfo tcgetattr)
233: if test "$ac_cv_func_pclose" = yes && test "$ac_cv_func_popen" = yes ; then
234: AC_DEFINE(PIPES)
235: fi
236:
237: dnl arg types for select
238: AC_FUNC_SELECT_ARGTYPES
239:
240: dnl On SVR3.
241: dnl FIXME AC_DEFINE(CRIPPLED_SELECT)
242:
243: dnl check for installed linux vgalib
244: if test "$with_linux_vga" = yes; then
245: AC_MSG_CHECKING(for linux vga library)
246: AC_CHECK_LIB(vga, vga_init,
247: [AC_DEFINE(LINUXVGA)
248: LINUXSUID='chown root $(bindir)/gnuplot; chmod u+s $(bindir)/gnuplot'
249: TERMLIBS="$TERMLIBS -lvga"],dnl
250: with_linux_vga=no)
251: fi
252:
253: dnl GNU readline and the required terminal library
254: if test "$with_gnu_readline" != no; then
255: dnl check for terminal library
256: dnl this is a very cool solution from octave's configure.in
257: gp_tcap=""
258: for termlib in ncurses curses termcap terminfo termlib; do
259: AC_CHECK_LIB(${termlib}, tputs, [gp_tcap="${gp_tcap} -l${termlib}"])
260: case "${gp_tcap}" in
261: *-l${termlib}*)
262: AC_MSG_RESULT([using ${gp_tcap} with readline])
263: break
264: ;;
265: esac
266: done
267:
268: if test "$with_gnu_readline" = yes; then
269: AC_CHECK_LIB(readline, readline,dnl
270: LIBS="$LIBS -lreadline $gp_tcap"
271: AC_DEFINE(GNU_READLINE)
272: with_readline=no,dnl
273: AC_MSG_ERROR([Can't find -lreadline in a standard path -- specify its location using --with-gnu-readline=/path/to/libreadline.a]),dnl
274: ${gp_tcap})dnl readline
275: else
276: if test ! -f $with_gnu_readline ; then
277: if test ! -f ${with_gnu_readline}/lib/libreadline.a ; then
278: if test ! -f ${with_gnu_readline}/libreadline.a ; then
279: AC_MSG_ERROR([GNU readline library not found])
280: else
281: AC_MSG_RESULT([using ${with_gnu_readline}/libreadline.a])
282: LIBS="$LIBS ${with_gnu_readline}/libreadline.a $gp_tcap"
283: fi
284: else
285: AC_MSG_RESULT([using ${with_gnu_readline}/lib/libreadline.a])
286: LIBS="$LIBS ${with_gnu_readline}/lib/libreadline.a $gp_tcap"
287: fi
288: else
289: AC_MSG_RESULT([using ${with_gnu_readline}])
290: LIBS="$LIBS $with_gnu_readline $gp_tcap"
291: fi
292:
293: AC_DEFINE(GNU_READLINE)
294: with_readline=no
295: fi
296: fi
297:
298: test "$with_readline" = yes && AC_DEFINE(READLINE)
299: dnl end readline
300:
301: dnl libplot
302: if test "$with_plot" != no; then
303: if test "$with_plot" = yes; then
304: dnl Unix plot library
305: AC_CHECK_LIB(plot,openpl,dnl
306: AC_DEFINE(UNIXPLOT)
307: TERMLIBS="$TERMLIBS -lplot",dnl
308: with_plot=no)
309: else
310: dnl GNU plot library - test for new version first
311: TERMXLIBS="$X_LIBS -lXaw -lXmu -lXt -lXext -lX11"
312: gp_SEARCH_LIBDIRS(plot,textangle,[$TERMXLIBS])
313: if test "$ac_cv_lib_plot_textangle" = no; then
314: TERMXLIBS=
315: gp_SEARCH_LIBDIRS(plot,rotate)
316: if test "$ac_cv_lib_plot_rotate" = no; then
317: AC_MSG_WARN([can't find GNU libplot -- disabling gnugraph terminal])
318: with_plot=no
319: else
320: AC_MSG_RESULT([ - using obsolete GNU graphics library])
321: AC_DEFINE(GNUGRAPH)
322: fi # old GNU plotlib
323: else
324: AC_MSG_RESULT([ - using GNU plotutils library])
325: AC_DEFINE(GNUGRAPH)
326: AC_DEFINE(GNU_PLOTUTILS)
327: fi # new GNU plotlib
328: fi # Unix plotlib
329: fi
330: dnl end plot
331:
332: dnl check for Tom Boutell's gd library
333: if test "$with_gd" != no; then
334: gp_SEARCH_LIBDIRS(gd,gdImageCreate)
335: if test "$ac_cv_lib_gd_gdImageCreate" = yes; then
336: gp_SEARCH_HEADERDIRS(gd.h,,
337: AC_MSG_WARN([found gd library but not gd.h])
338: AC_MSG_WARN([please add path to gd.h to CPPFLAGS in Makefile])
339: )dnl gp_SEARCH_HEADERDIRS
340: AC_DEFINE(HAVE_LIBGD)
341: else
342: AC_MSG_RESULT([- see term/gif.trm for download details])
343: fi
344: fi
345: dnl end gd
346:
347: dnl check for png and z library
348: if test "$with_png" != no; then
349: gp_SEARCH_LIBDIRS(png,png_info_init,[-lz])
350: if test "$ac_cv_lib_png_png_info_init" = yes; then
351: TERMLIBS="$TERMLIBS -lz"
352: gp_SEARCH_HEADERDIRS(png.h,,
353: AC_MSG_WARN([found png library but not png.h])
354: AC_MSG_WARN([please add path to png.h to CPPFLAGS in Makefile])
355: )dnl gp_SEARCH_HEADERIRS
356: gp_SEARCH_HEADERDIRS(zlib.h,,
357: AC_MSG_WARN([found z library but not zlib.h])
358: AC_MSG_WARN([please add path to zlib.h to CPPFLAGS in Makefile])
359: )dnl gp_SEARCH_HEADERDIRS
360: if test "$ac_cv_header_png_h" = yes; then
361: AC_EGREP_CPP([You lose], [#include "png.h"
362: #if PNG_LIBPNG_VER < 89
363: You lose.
364: #endif
365: ],dnl
366: AC_MSG_WARN([- libpng too old - not including png driver]),dnl
367: AC_DEFINE(HAVE_LIBPNG))
368: else
369: AC_MSG_WARN([- cannot check png version - compilation may fail])
370: AC_DEFINE(HAVE_LIBPNG)
371: fi
372: else
373: AC_MSG_RESULT([- see term/png.trm for download details])
374: fi
375: fi
376: dnl end png and z
377:
378: dnl create list of terminals
379: AC_MSG_CHECKING([terminal driver sources])
380: ( cd $srcdir/term && for i in *.trm ; do echo '${srcdir}'/../term/$i ; done )\
381: |(tr '\012' @; echo) |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012' >termlist
382: TERM_LIST=termlist
383: AC_SUBST_FILE(TERM_LIST)
384: AC_MSG_RESULT([list created])
385:
386: dnl How do we detect the Ultrix X libraries?
387: dnl Or is it really a server (run-time) problem?
388: dnl FIXME AC_DEFINE(ULTRIX_KLUDGE)
389:
390: dnl Process enable options
391:
392: if test "$enable_apollo" = yes; then
393: AC_EGREP_CPP(yes,
394: [#ifdef apollo
395: yes
396: #endif
397: ],AC_DEFINE(APOLLO),dnl
398: enable_apollo=no)
399: fi
400:
401: if test "$enable_gpr" = yes; then
402: AC_EGREP_CPP(yes,
403: [#ifdef apollo
404: yes
405: #endif
406: ],AC_DEFINE(APOLLO) AC_DEFINE(GPR),dnl
407: enable_gpr=no)
408: fi
409:
410: if test "$enable_cgi" = yes; then
411: AC_EGREP_CPP(yes,
412: [#ifdef SCO
413: yes
414: #endif
415: ],AC_CHECK_LIB(ccgi,v_opnwk,dnl
416: AC_DEFINE(CGI)
417: TERMLIBS="$TERMLIBS -lccgi"),dnl
418: enable_cgi=no)
419: fi
420:
421: if test "$enable_iris" = yes; then
422: AC_CHECK_LIB(gl_s,winopen,dnl
423: AC_DEFINE(IRIS)
424: TERMLIBS="$TERMLIBS -lgl_s",dnl
425: enable_iris=no)
426: fi
427:
428: if test "$enable_mgr" = yes; then
429: AC_CHECK_LIB(mgr,m_getinfo,dnl
430: AC_DEFINE(MGR)dnl
431: TERMLIBS="$TERMLIBS -lmgr -lpixrect",dnl
432: enable_mgr=no,[-lpixrect])
433: fi
434:
435: if test "$enable_rgip" = yes; then
436: AC_DEFINE(RGIP)
437: fi
438:
439: if test "$enable_sun" = yes; then
440: AC_CHECK_LIB(suntool,window_create,dnl
441: AC_DEFINE(SUN)dnl
442: TERMLIBS="$TERMLIBS -lsuntool -lsunwindow -lpixrect",dnl
443: enable_sun=no,[-lsunwindow -lpixrect])
444: fi
445:
446: if test "$enable_unixpc" = yes; then
447: AC_EGREP_CPP(yes,
448: [/* Not sure about this; definitely
449: * true for gcc */
450: #ifdef unixpc
451: yes
452: #endif
453: ],AC_DEFINE(UNIXPC),dnl
454: enable_unixpc=no)
455: fi
456:
457: if test "$enable_system_time" = yes; then
458: AC_DEFINE(USE_SYSTEM_TIME)
459: fi
460:
461: dnl Substitute variables
462: AC_SUBST(PACKAGE)
463: AC_SUBST(VERSION)
464: AC_SUBST(LASERGNU)
465: AC_SUBST(LINUXSUID)
466: AC_SUBST(NEXTOBJS)
467: AC_SUBST(TERMLIBS)
468: AC_SUBST(TERMXLIBS)
469:
470:
471: dnl Report configuration
472: eval gp_datadir=$datadir
473: test $gp_datadir = NONE/share && gp_datadir=/usr/local/share
474: AC_MSG_RESULT([
475: ** Configuration summary for $PACKAGE $VERSION:
476:
477: Where is the help file? $gp_datadir/gnuplot.gih
478: ])
479: test "$ac_cv_header_gd_h" = yes && \
480: AC_MSG_RESULT([ Enable generation of GIF files.])
481:
482: test "$ac_cv_header_zlib_h" = yes && \
483: AC_MSG_RESULT([ Enable generation of PNG files.])
484:
485: test "$with_cwdrc" = yes && \
486: AC_MSG_RESULT([ Check current directory for .gnuplot file.])
487:
488: if test "$with_gnu_readline" != no; then
489: AC_MSG_RESULT([ Use GNU readline library.])
490: else
491: test "$with_readline" != no && \
492: AC_MSG_RESULT([ Use included readline.])
493: fi
494:
495: if test "$with_plot" = yes; then
496: AC_MSG_RESULT([ Use the Unix plot library.])
497: elif test "$with_plot" != no; then
498: AC_MSG_RESULT([ Use the GNU plot library.])
499: fi
500:
501: test "$with_lasergnu" = yes && \
502: AC_MSG_RESULT([ Install lasergnu printer script.])
503:
504: test "$with_linux_vga" = yes && \
505: AC_MSG_RESULT([ Use the Linux console driver.])
506:
507: test "$enable_apollo" = yes && \
508: AC_MSG_RESULT([ Enable Apollo terminal (resizeable window).])
509:
510: test "$enable_cgi" = yes && \
511: AC_MSG_RESULT([ Enable cgi terminal (SCO).])
512:
513: test "$enable_gpr" = yes && \
514: AC_MSG_RESULT([ Enable Apollo terminal (fixed-size window).])
515:
516: test "$enable_iris" = yes && \
517: AC_MSG_RESULT([ Enable IRIS terminal.])
518:
519: test "$enable_mgr" = yes && \
520: AC_MSG_RESULT([ Enable MGR terminal.])
521:
522: test "$enable_rgip" = yes && \
523: AC_MSG_RESULT([ Enable RGIP terminal.])
524:
525: test "$enable_sun" = yes && \
526: AC_MSG_RESULT([ Enable sunview terminal.])
527:
528: test "$enable_unixpc" = yes && \
529: AC_MSG_RESULT([ Enable unixpc terminal (ATT 3b1 or ATT 7300).])
530:
531: test "$enable_system_time" = yes && \
532: AC_MSG_RESULT([ Use system time routines in time.c.])
533:
534: test "$no_x" != yes && \
535: AC_MSG_RESULT([ Use the X Window System.
536: ])
537: dnl end config report
538:
539: dnl Write Makefiles and configuration header
540: AC_OUTPUT([Makefile docs/Makefile docs/latextut/Makefile], \
541: [test -z "$CONFIG_HEADERS" || echo timestamp >stamp-h ; rm -f termlist])
542:
543: dnl end configure.in
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>