File: configure.in

package info (click to toggle)
gnuplot 3.5beta6.347-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 5,032 kB
  • ctags: 4,235
  • sloc: ansic: 42,086; makefile: 561; asm: 539; sh: 386; objc: 379; csh: 297; pascal: 194; perl: 138; lisp: 88
file content (322 lines) | stat: -rw-r--r-- 10,303 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
dnl -*-Mode: M4 -*-
dnl Process this file with autoconf to produce a configure script.
dnl configure.in for gnuplot 3.5 (pre-3.6) 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
dnl $Id: configure.in,v 1.90 1998/06/18 14:52:55 ddenholm Exp $
dnl
AC_PREREQ(2.1)
AC_REVISION($Revision: 1.90 $)
AC_INIT(graphics.c)
AC_CONFIG_HEADER(config.h:config.hin)


dnl Programs.
missing_dir=.
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL


dnl Optional features.

dnl Do not use the included readline function
AC_ARG_WITH(readline,dnl
[  --without-readline      do not use the included readline function],,
  AC_DEFINE(READLINE)
)dnl

dnl The GNU readline library
AC_ARG_WITH(gnu-readline,dnl
[  --with-gnu-readline     use the GNU readline version
  --with-gnu-readline=PATH        Specify the location of libreadline],,
with_gnu_readline=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],,
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],,
with_png=yes
)dnl

dnl Use the .gnuplotrc file
AC_ARG_WITH(cwdrc,dnl
[  --with-cwdrc            check current directory for .gnuplotrc file,
                          normally disabled for security reasons],
if test "$withval" = no; then AC_DEFINE(NOCWDRC) fi, 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)],,
with_linux_vga=yes
)dnl

dnl configure.in body

dnl figure out if can handle ANSI style prototypes
dnl with gcc we're well off, but other compilers might require additional
dnl options
dnl Compiler characteristics
AM_C_PROTOTYPES
AC_C_CONST
AC_C_INLINE

dnl this shell variable is set to no if above failed to set
dnl compiler to ansi mode (see aclocal.m4)
if test "$am_cv_prog_cc_stdc" != no; then
  AC_DEFINE(ANSI_C)
fi

dnl check for ANSI style stringification
gp_PROG_CPP_STRINGIFY

AC_MSG_CHECKING(if compiler handles warn and error directives correctly)
dnl this used to test #warning, but that is not currently used
AC_TRY_CPP([#if 0
#error "error"
#endif],ERRORFIX= AC_MSG_RESULT(yes),ERRORFIX=errorfix AC_MSG_RESULT(no))
AC_SUBST(ERRORFIX)


dnl X Window System files.
AC_SUBST(X_INCLUDES)
AC_SUBST(X_LIBRARIES)
AC_SUBST(GNUPLOT_X11)
AC_PATH_X
if test "$no_x" = yes; then
  X_INCLUDES= X_LIBRARIES= GNUPLOT_X11=
else
  if test -n "$x_includes"; then
    X_INCLUDES="-I$x_includes"
  fi
  if test -n "$x_libraries"; then
    X_LIBRARIES="-L$x_libraries -lX11"
  else
    X_LIBRARIES="-lX11"
  fi
  GNUPLOT_X11=gnuplot_x11
  AC_DEFINE(X11)
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 this has to be after -lsys_s on NeXT
LIBS="$LIBS -lm"


dnl Header files. ANSI first
AC_HEADER_STDC
dnl check for errno.h header and if it declares errno
AC_CHECK_HEADER(errno.h, , AC_DEFINE(NO_ERRNO_H))
AC_MSG_CHECKING(if errno variable is declared)
AC_TRY_COMPILE(
[#include <stdio.h>
#ifndef NO_ERRNO_H
#include <errno.h>
#endif],
 errno=0,AC_MSG_RESULT(yes),AC_DEFINE(EXTERN_ERRNO) AC_MSG_RESULT(no))
dnl
AC_CHECK_HEADER(float.h, ,AC_DEFINE(NO_FLOAT_H))
AC_CHECK_HEADER(limits.h, ,AC_DEFINE(NO_LIMITS_H) AC_CHECK_HEADERS(values.h))
AC_CHECK_HEADER(locale.h, ,AC_DEFINE(NO_LOCALE_H))
AC_CHECK_HEADER(math.h, ,AC_DEFINE(NO_MATH_H))
AC_CHECK_HEADER(stdlib.h, ,AC_DEFINE(NO_STDLIB_H))
AC_CHECK_HEADER(string.h, ,AC_DEFINE(NO_STRING_H))
AC_CHECK_HEADER(time.h, ,AC_DEFINE(NO_TIME_H) AC_CHECK_TYPE(time_t, long))
dnl
AC_CHECK_HEADERS(sys/bsdtypes.h sys/select.h)
AC_CHECK_HEADERS(sys/systeminfo.h, AC_CHECK_FUNCS(sysinfo))
AC_CHECK_HEADER(sys/types.h, , AC_DEFINE(NO_SYS_TYPES_H))
AC_CHECK_HEADERS(libc.h malloc.h)
AC_CHECK_HEADERS(termios.h, ,AC_CHECK_HEADERS(sgtty.h))
dnl
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 Types.
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
 

dnl Functions. ANSI first, then others
dnl We prefer that the absense of a macro is the norm, so we
dnl define NO_WHATEVER if an ansi fn is missing, but HAVE_SOMETHING
dnl if it is a non-ansi fn we would like to use if available

dnl sunos 4 has on_exit() in place of atexit()
AC_CHECK_FUNC(atexit, ,AC_DEFINE(NO_ATEXIT) AC_CHECK_FUNCS(on_exit))
AC_CHECK_FUNC(memcpy, ,AC_DEFINE(NO_MEMCPY) AC_CHECK_FUNCS(bcopy))
AC_CHECK_FUNC(memset, ,AC_DEFINE(NO_MEMSET) AC_CHECK_FUNCS(bzero))
AC_CHECK_FUNC(setvbuf, ,AC_DEFINE(NO_SETVBUF))
AC_CHECK_FUNC(strerror, ,AC_DEFINE(NO_STRERROR))
AC_CHECK_FUNC(strchr, ,AC_DEFINE(NO_STRCHR) AC_CHECK_FUNCS(index))
AC_CHECK_FUNC(strrchr, ,AC_DEFINE(NO_STRRCHR) AC_CHECK_FUNCS(rindex))
AC_CHECK_FUNC(strstr, ,AC_DEFINE(NO_STRSTR))

dnl gamma is called lgamma on apollos and linux
dnl we prefer lgamma over gamma
dnl math lib is already available, see operating systems part
AC_CHECK_FUNCS(erf)
AC_CHECK_FUNC(lgamma,AC_DEFINE(HAVE_LGAMMA),AC_CHECK_FUNCS(gamma))

AC_CHECK_FUNCS(getcwd sleep tcgetattr)
AC_CHECK_FUNC(popen,AC_CHECK_FUNC(pclose,AC_DEFINE(PIPES)))
AC_CHECK_FUNC(strncasecmp,AC_DEFINE(HAVE_STRNCASECMP),AC_CHECK_FUNCS(strnicmp))

dnl On SVR3.
dnl FIXME AC_DEFINE(CRIPPLED_SELECT)


dnl Libraries.
dnl -lsocket is needed on SVR4.
dnl
dnl Is this true ?  Can anyone remember why ?
AC_CHECK_LIB(socket, main, LIBS="$LIBS -lnsl -lsocket")

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)
    LINUXSUID='chown root $(bindir)/gnuplot; chmod u+s $(bindir)/gnuplot'
    TERMLIBS="$TERMLIBS -lvga")
fi

dnl This will work only with gnu readline installed in a standard library path
dnl However, if libreadline.a is not installed in a standard path, then
dnl all subsequent library tests will fail because we will try to link with
dnl -lreadline.  This isn't acceptable, so we do check for the existence of
dnl readline in a standard path.
dnl
dnl most unices need termcap with readline, but not Debian linux, which
dnl does not even supply it, or so I am told

if test "$with_gnu_readline" = yes; then
    AC_CHECK_LIB(termcap, tputs, gp_tcap="-ltermcap", gp_tcap="")
    AC_CHECK_LIB(readline, readline, 
      LIBS="$LIBS -lreadline $gp_tcap",
   AC_MSG_ERROR(Can't find -lreadline in a standard path -- specify its location using --with-gnu-readline=/path/to/libreadline.a),
	  $gp_tcap 
    )dnl readline
    AC_DEFINE(GNU_READLINE)

  elif test "$with_gnu_readline" != no; then
    if test ! -f $with_gnu_readline ; then
      AC_MSG_ERROR(No such file $withval)
    fi

    AC_CHECK_LIB(termcap, tputs, gp_tcap=" -ltermcap", gp_tcap="")
    LIBS="$LIBS $with_gnu_readline $gp_tcap"
    AC_DEFINE(GNU_READLINE)
fi
dnl end readline

dnl check for Tom Boutell's gd library
if test "$with_gd" != no; then
gp_CHECK_LIB_PATH(gd, gdImageCreate)
if test "$ac_cv_lib_gd_gdImageCreate" = yes; then
    gp_CHECK_HEADER(gd.h,,
     AC_MSG_WARN(please add path to `echo $ac_safe|sed 's/\_/\./'` to INCLUDES in Makefile)
    )dnl gp_CHECK_HEADER
  AC_DEFINE(HAVE_LIBGD)
else
  AC_MSG_RESULT(- see term/gif.trm for download details)
fi
fi
dnl end gd

dnl check for png and z library
if test "$with_png" != no; then
gp_CHECK_LIB_PATH(png, png_info_init, -lz)
if test "$ac_cv_lib_png_png_info_init" = yes; then
    gp_CHECK_HEADER(png.h,,
     AC_MSG_WARN(please add path to `echo $ac_safe|sed 's/\_/\./'` to INCLUDES in Makefile)
    )dnl gp_CHECK_HEADER
    gp_CHECK_HEADER(zlib.h,,
     AC_MSG_WARN(please add path to `echo $ac_safe|sed 's/\_/\./'` to INCLUDES in Makefile)
    )dnl gp_CHECK_HEADER
    AC_EGREP_CPP(yes,
    [#include "png.h"
    # if PNG_LIBPNG_VER < 89
      yes
    # endif
    ], AC_MSG_WARN(- not using old libpng version), AC_DEFINE(HAVE_LIBPNG))
else
  AC_MSG_RESULT(- see term/png.trm for download details)
fi
fi
dnl end png and z

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 Substitute variables
AC_SUBST(LASERGNU)
AC_SUBST(LINUXSUID)
AC_SUBST(TERMFLAGS)
AC_SUBST(TERMLIBS)


dnl rename makefiles in subdirectories, so that they don't take precedence
dnl over our created Makefiles
dnl HBB: BUG on MSDOS/DJGPP: if you run configure a second time, it
dnl  won't notice the difference between 'makefile' and 'Makefile',
dnl  and happily overwrite the backup copies with the autoconf-ed
dnl  Makefile. Remedy: don't backup if backups are already there.
dnl  (and make the backup file name 8.3 compatible to be safe)

if test ! -f docs/makefile.dst && test -f docs/makefile && \
   test -z "$no_create"; then
  echo moving docs/makefile out of the way
  mv docs/makefile docs/makefile.dst
fi

if test ! -f docs/latextut/makefile.dst && \
   test -f docs/latextut/makefile && test -z "$no_create"; then
  echo moving docs/latextut/makefile out of the way
  mv docs/latextut/makefile docs/latextut/makefile.dst
fi

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