File: configure.in

package info (click to toggle)
plotutils 2.0-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 5,964 kB
  • ctags: 2,522
  • sloc: ansic: 38,416; sh: 1,853; yacc: 856; makefile: 181; lex: 144
file content (95 lines) | stat: -rw-r--r-- 3,698 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
dnl Configure template for the GNU plotutils package.
dnl Copyright (C) 1989-98 Free Software Foundation, Inc.
dnl Process this file with autoconf to produce a configure script.

AC_INIT(graph/graph.c)
AM_INIT_AUTOMAKE(plotutils, 2.0)
AM_CONFIG_HEADER(config.h)

dnl We now use libtool to make and installed a shared library.
AM_PROG_LIBTOOL

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LEX
AC_PROG_MAKE_SET
AC_PROG_YACC
dnl rendered obsolete by AM_PROG_LIBTOOL (see above)
dnl AC_PROG_RANLIB

dnl Checks for header files.
AC_CHECK_HEADERS(malloc.h string.h strings.h sys/time.h unistd.h values.h)
AC_HEADER_STDC

dnl X-specific headers and libraries (by default, we support X but not Motif)
AC_PATH_XTRA
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
AC_SUBST(X_PRE_LIBS)
AC_SUBST(XLIBS)
AC_SUBST(X_EXTRA_LIBS)
AC_ARG_WITH(x, [  --with-x                use the X Window System], if test "$withval" != "no"; then BASIC_XLIBS="-lXt -lXext -lX11"; else BASIC_XLIBS=""; fi, BASIC_XLIBS="-lXt -lXext -lX11";)
AC_ARG_WITH(motif, [  --with-motif            use Motif widgets], if test "$BASIC_XLIBS" = ""; then XLIBS=""; else XLIBS="-lXm $BASIC_XLIBS"; fi; AC_DEFINE(USE_MOTIF), if test "$BASIC_XLIBS" = ""; then XLIBS=""; else XLIBS="-lXaw -lXmu $BASIC_XLIBS"; fi;)
AM_CONDITIONAL(NO_X, test "$no_x" = yes)

dnl Typedefs, structures, and compiler characteristics.
AC_MSG_CHECKING(for void)
AC_TRY_COMPILE(, [void *foo = 0;], 
  [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VOID)], [AC_MSG_RESULT(no)])
AC_C_CONST
AC_HEADER_TIME
AC_TYPE_SIGNAL
AC_TYPE_PID_T

dnl Override default "-g -O2", for libplot especially.
CFLAGS="-O"

dnl Library functions and auxiliary libraries.
AC_DECL_YYTEXT
dnl 
dnl SGI's have matherr in libmx.a, not libm.a
AC_CHECK_LIB(mx, matherr, LIBS="$LIBS -lmx", LIBS="$LIBS -lm")
AC_CHECK_FUNCS(memcpy strchr strcasecmp matherr j0 erf)
dnl
dnl lgamma() and gamma() both compute the log of the gamma function.  There
dnl are old systems out there which do not have lgamma (the name was
dnl introduced after BSD 4.2), but which do have gamma.  Also some systems,
dnl new and old, have lgamma but not gamma.
AC_CHECK_FUNCS(lgamma gamma)
dnl Motif on Sys-V derived systems requires -lPW.  Harmless to include it
dnl (but we only need it if --with-motif is specified).  Precede it
dnl by -lc because some of its definitions may conflict with the standard
dnl library.  Similarly check for -lgen, which Motif on Solaris needs.
AC_CHECK_LIB(gen, regex, LIBS="$LIBS -lc -lgen", LIBS="$LIBS")
AC_CHECK_LIB(PW, regex, LIBS="$LIBS -lc -lPW", LIBS="$LIBS")

dnl HP/UX needs a cpp definition for math.h to define matherr-related things
AC_EGREP_HEADER(_HPUX_SOURCE, math.h, AC_EGREP_HEADER(matherr, math.h, AC_DEFINE(_HPUX_SOURCE)))

dnl Sui generis.
AC_FUNC_ALLOCA

dnl Check whether fflush(NULL) works
AC_TRY_RUN([
#include <stdio.h>
main()
{
  FILE *fpw, *fpr;
  char test_array[7];

  if ((fpw = fopen ("conftest0", "w")) == (FILE *)0
      || fwrite ("FOOBAR", 1, 7, fpw) != 7
      || fflush ((FILE *)0) < 0
      || (fpr = fopen ("conftest0", "r")) == (FILE *)0
      || fread (test_array, 1, 7, fpr) != 7)
    exit (1);
  else
    exit(0); }], 
AC_DEFINE(HAVE_NULL_FLUSH), AC_DEFINE(DONT_HAVE_NULL_FLUSH), AC_DEFINE(DONT_HAVE_NULL_FLUSH))

dnl Necessitated by lack of support in autoconf for libtool.
LTALLOCA=`echo "$ALLOCA" | sed 's/\.o/.lo/g'`
AC_SUBST(LTALLOCA)

AC_OUTPUT(Makefile double/Makefile graph/Makefile info/Makefile lib/Makefile libplot/Makefile plot/Makefile tek2plot/Makefile tek2plot/teksamples/Makefile spline/Makefile ode/Makefile ode-examples/Makefile include/Makefile doc/Makefile fonts/Makefile fonts/bdf/Makefile fonts/pcf/Makefile fonts/pfb/Makefile test/Makefile)