File: configure.in

package info (click to toggle)
gnuplot 3.7.2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,212 kB
  • ctags: 4,635
  • sloc: ansic: 43,538; cpp: 970; makefile: 883; lisp: 661; sh: 578; asm: 539; objc: 379; csh: 297; pascal: 192; perl: 138
file content (536 lines) | stat: -rwxr-xr-x 16,136 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
dnl Process this file with autoconf to produce a configure script.
dnl configure.in for gnuplot 3.7 on Unix.
dnl
dnl $Id: configure.in,v 1.41.2.17 2002/01/31 19:22:26 lhecking Exp $
dnl
AC_INIT(graphics.c)
AC_PREREQ(2.13)
AC_REVISION($Revision: 1.41.2.17 $)
VERSION=`sed -n 's/.*version.*"\(.*\)".*/\1/p' $srcdir/version.c|tr -d ' '`
PL=`sed -n 's/.*patchlevel.*"\(.*\)".*/\1/p' $srcdir/version.c|tr -d ' '`
AM_INIT_AUTOMAKE(gnuplot, $VERSION.$PL)
AC_CONFIG_HEADER(config.h:config.hin)

dnl Compiler characteristics
dnl Check for ANSI C prototypes, the const and inline keywords,
dnl and ANSI style stringification
AC_PROG_CC
AM_C_PROTOTYPES
AC_PROG_CPP
AC_C_CONST
AC_C_INLINE
AC_C_STRINGIZE

AC_MSG_CHECKING(if compiler handles warn and error directives correctly)
AC_TRY_CPP([#if 0
#error "error"
#warning "warning"
#endif],
  ERRORFIX=
  AC_MSG_RESULT(yes),dnl
  ERRORFIX=errorfix
  AC_MSG_RESULT(no))
AC_SUBST(ERRORFIX)

dnl X Window System files.
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"
  LIBRARIES_FOR_X="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
  GNUPLOT_X11=gnuplot_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, 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
dnlLIBS="$LIBS -lm"


dnl Header files. ANSI first
dnl We prefer that the absense of a macro is the norm, so in syscfg.h
dnl configure's HAVE_XXXX defines are translated into NO_XXXX for ANSI
dnl headers and functions
AC_HEADER_STDC

dnl Header files
dnl ANSI/ISO C, POSIX, others
AC_CHECK_HEADERS(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 \
  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
dnl conditionalized for _POSIX_SOURCE
AC_MSG_CHECKING(for unistd.h)
AC_EGREP_HEADER(execv, unistd.h, AC_DEFINE(HAVE_UNISTD_H) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

dnl check if errno.h header declares errno
AC_MSG_CHECKING(if errno variable is declared)
AC_TRY_COMPILE(
[#include <stdio.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif],
  errno=0,AC_MSG_RESULT(yes),
  AC_DEFINE(EXTERN_ERRNO, 1,
            [ Define if <errno.h> declares errno. ])
  AC_MSG_RESULT(no)
)dnl


dnl Types.
AC_TYPE_SIZE_T
AC_MSG_CHECKING(for time_t in time.h)
AC_EGREP_HEADER(time_t,time.h,
  [ ac_cv_type_time_t=yes; AC_MSG_RESULT(yes) ],
  AC_MSG_RESULT(no)
  AC_CHECK_TYPE(time_t, long))
AC_TYPE_SIGNAL
 

dnl Functions. Standard first, then others

dnl ANSI/ISO and their predecessors
dnl sunos 4 has on_exit() in place of atexit()
dnl gamma is called lgamma on apollos and linux
dnl we prefer lgamma over gamma, see specfun.c
dnl math lib is already available, see operating systems part
AC_CHECK_FUNCS(atexit memcpy memmove memset \
  on_exit bcopy bzero \
  setvbuf strerror strchr strrchr strstr \
  index rindex \
  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 <setjmp.h>. (joze)
AC_MSG_CHECKING(for sigsetjmp)
AC_TRY_LINK([#include <setjmp.h>], [jmp_buf env; sigsetjmp(env, 1);],
  [AC_MSG_RESULT(yes)
   AC_DEFINE(HAVE_SIGSETJMP, 1,
             [ Define if we have sigsetjmp(). ])],
  AC_MSG_RESULT(no)
)

if test "$ac_cv_func_pclose" = yes && test "$ac_cv_func_popen" = yes ; then
  AC_DEFINE(PIPES, 1,
            [ Define if you do have the popen and pclose functions. ])
fi

dnl Argument types of select()
AC_FUNC_SELECT

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, 1,
               [ Define if this is a Linux system with SuperVGA library. ])
     LINUXSUID='chown root $(DESTDIR)/$(bindir)/gnuplot; chmod u+s $(DESTDIR)/$(bindir)/gnuplot'
     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_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_readline" = gnu; then
      AC_CHECK_LIB(readline, readline,
       TERMLIBS="-lreadline $gp_tcap $TERMLIBS",, ${gp_tcap})
    else
      if test -d $with_readline/include; then
        CPPFLAGS="$CPPFLAGS -I$with_readline/include"
      fi
      if test -d $with_readline/lib; then
        LDFLAGS="$LDFLAGS -L$with_readline/lib"
      fi

      AC_CHECK_LIB(readline,readline,
        TERMLIBS="-lreadline $gp_tcap $TERMLIBS",,[${gp_tcap}])

    fi

    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_DEFINE(HAVE_LIBREADLINE, 1,
                [ Define if you are using the GNU readline library. ])
    fi # ! ac_cv_lib_readline_readline = no

  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 readline

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
],
        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 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 Removed enable options for these
dnl Just autodetect

dnl SCO cgi
AC_EGREP_CPP(yes,
[#ifdef SCO
yes
#endif
],AC_CHECK_LIB(ccgi, v_opnwk,
    AC_DEFINE(CGI, 1,
              [ Define if you want to use the CGI terminal under SCO. ])
              TERMLIBS="-lccgi $TERMLIBS"))

dnl Sun sunview
AC_EGREP_CPP(yes,
[#ifdef sun
yes
#endif
], AC_CHECK_LIB(suntool, window_create,
    AC_CHECK_HEADER(suntool/sunview.h,
    AC_DEFINE(SUN, 1,
              [ Define if you want to use the sunview terminal (sun). ])
    TERMLIBS="-lsuntool -lsunwindow -lpixrect $TERMLIBS"),,
    [-lsunwindow -lpixrect]))

dnl Process enable options

dnl Use .gnuplot file in current directory
AC_ARG_WITH(cwdrc,dnl
[  --with-cwdrc            check current directory for .gnuplot file,
                          normally disabled for security reasons],,
  [if test "$withval" = yes; then
     AC_DEFINE(NOCWDRC, 1,
            [ Define if you do not want to read .gnuplot in the current directory. ])
   fi])

dnl 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

dnl IRIS terminal on IRIS4D series computer
AC_ARG_ENABLE(iris,dnl
[  --enable-iris           enable IRIS terminal (IRIS4D only)],
  [if test "$enableval" = yes; then
     AC_CHECK_LIB(gl_s,winopen,
       AC_DEFINE(IRIS, 1,
             [ Define if you want to use the IRIS terminal on IRIS4D series computers. ])
       TERMLIBS="-lgl_s $TERMLIBS",enable_iris=no)
   fi])

dnl MGR Window system
AC_ARG_ENABLE(mgr,dnl
[  --enable-mgr            enable MGR terminal],
  [if test "$enableval" = yes; then
     AC_CHECK_LIB(mgr,m_getinfo,
       AC_DEFINE(MGR, 1, [ Define if you want to use the MGR Window system. ])
       TERMLIBS="-lmgr -lpixrect $TERMLIBS",enable_mgr=no,[-lpixrect])
   fi])

dnl Redwood Graphics Interface Protocol
AC_ARG_ENABLE(rgip,dnl
[  --enable-rgip           enable Redwood Graphics Interface Protocol],
  [if test "$enableval" = yes; then
     AC_DEFINE(RGIP, 1,
               [ Define if you want to use the Redwood Graphics Interface Protocol. ])
   fi])

dnl Substitute variables
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(LASERGNU)
AC_SUBST(LINUXSUID)
AC_SUBST(TERMLIBS)
AC_SUBST(TERMXLIBS)


dnl Report configuration
eval gp_datadir=$datadir
test $gp_datadir = NONE/share && gp_datadir=/usr/local/share
AC_MSG_RESULT([
** Configuration summary for $PACKAGE $VERSION:

  Where is the help file?           $gp_datadir/gnuplot.gih
])
if test "$ac_cv_header_gd_h" = yes; then
  AC_MSG_RESULT([  Enable generation of GIF files])
fi

if test "$ac_cv_header_pdflib_h" = yes; then
  AC_MSG_RESULT([  Enable generation of PDF files])
fi

if test "$ac_cv_header_png_h" = yes; then
  AC_MSG_RESULT([  Enable generation of PNG files])
fi

if test "$with_cwdrc" = yes; then
  AC_MSG_RESULT([  Check current directory for .gnuplot file])
fi

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

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

if test "$with_lasergnu" = yes; then
  AC_MSG_RESULT([  Install lasergnu printer script])
fi

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

if test "$enable_ggi" = yes; then
  AC_MSG_RESULT([  Enable ggi terminal (EXPERIMENTAL)])
fi

if test "$enable_iris" = yes; then
  AC_MSG_RESULT([  Enable IRIS terminal])
fi

if test "$enable_mgr" = yes; then
  AC_MSG_RESULT([  Enable MGR terminal])
fi

if test "$enable_rgip" = yes; then
  AC_MSG_RESULT([  Enable RGIP terminal])
fi

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])

dnl end configure.in