1 | dnl Process this file with autoconf to produce a configure script.
|
---|
2 | AC_INIT(src/text/mgquery.c)
|
---|
3 | AC_CONFIG_HEADER(config.h)
|
---|
4 | AC_ARG_PROGRAM
|
---|
5 |
|
---|
6 | dnl
|
---|
7 | PACKAGE=mg
|
---|
8 | VERSION=1.2
|
---|
9 |
|
---|
10 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
---|
11 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
|
---|
12 | AC_SUBST(PACKAGE)
|
---|
13 | AC_SUBST(VERSION)
|
---|
14 |
|
---|
15 | dnl Checks for programs.
|
---|
16 | AC_PROG_CXX
|
---|
17 | AC_PROG_AWK
|
---|
18 | AC_PROG_YACC
|
---|
19 | AC_PROG_CC
|
---|
20 | AC_PROG_INSTALL
|
---|
21 | AC_PROG_LN_S
|
---|
22 | AC_PROG_MAKE_SET
|
---|
23 | AC_PROG_RANLIB
|
---|
24 |
|
---|
25 | dnl Checks for typedefs, structures, and compiler characteristics.
|
---|
26 | AC_AIX
|
---|
27 | AC_ISC_POSIX
|
---|
28 | AC_MINIX
|
---|
29 | fp_C_PROTOTYPES
|
---|
30 | AC_C_CONST
|
---|
31 | AC_TYPE_OFF_T
|
---|
32 | AC_TYPE_SIZE_T
|
---|
33 | AC_HEADER_TIME
|
---|
34 | AC_STRUCT_TM
|
---|
35 |
|
---|
36 | dnl --- This should be in the stdc checking -----------------
|
---|
37 | if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
|
---|
38 | dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
|
---|
39 | dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
|
---|
40 | dnl XOPEN extensions (like popen).
|
---|
41 | dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
|
---|
42 | dnl needs. So drop back to -Xa
|
---|
43 | AC_TRY_COMPILE(
|
---|
44 | [#include <stdio.h>
|
---|
45 | ], [ FILE *rubbish = popen("yes", "r"); ],,
|
---|
46 | [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
|
---|
47 | fi
|
---|
48 | dnl ----------------------
|
---|
49 |
|
---|
50 |
|
---|
51 | dnl Checks for libraries.
|
---|
52 | dnl Replace `main' with a function in -lm:
|
---|
53 | AC_CHECK_LIB(m, main)
|
---|
54 |
|
---|
55 | dnl Checks for header files.
|
---|
56 | AC_HEADER_DIRENT
|
---|
57 | AC_HEADER_STDC
|
---|
58 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h string.h memory.h sys/procfs.h)
|
---|
59 | AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
|
---|
60 | AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
|
---|
61 | AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
|
---|
62 |
|
---|
63 | dnl Checks for library functions.
|
---|
64 | AC_FUNC_ALLOCA
|
---|
65 | AC_PROG_GCC_TRADITIONAL
|
---|
66 | AC_TYPE_SIGNAL
|
---|
67 | AC_FUNC_VPRINTF
|
---|
68 | AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize)
|
---|
69 | AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
|
---|
70 |
|
---|
71 |
|
---|
72 | # *** Custom checking (based on GNU tar configure.in) ***
|
---|
73 | # ---------------------------------------------------------------------------
|
---|
74 | AC_MSG_CHECKING(for HP-UX needing gmalloc)
|
---|
75 | if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
|
---|
76 | AC_MSG_RESULT(yes)
|
---|
77 | LIBOBJS="$LIBOBJS gmalloc.o"
|
---|
78 | AC_DEFINE(HAVE_VALLOC)
|
---|
79 | else
|
---|
80 | AC_MSG_RESULT(no)
|
---|
81 | AC_CHECK_FUNCS(valloc)
|
---|
82 | fi
|
---|
83 |
|
---|
84 | fp_WITH_DMALLOC
|
---|
85 | fp_WITH_REGEX
|
---|
86 |
|
---|
87 | # ---------------------------------------------------------------------------
|
---|
88 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
89 | dnl support functions for alloca.c
|
---|
90 | LIBOBJS="$LIBOBJS xmalloc.o error.o"
|
---|
91 | fi
|
---|
92 |
|
---|
93 |
|
---|
94 | # ---------------------------------------------------------------------------
|
---|
95 |
|
---|
96 | AC_OUTPUT([Makefile src/text/Makefile src/images/Makefile
|
---|
97 | src/scripts/Makefile lib/Makefile ],
|
---|
98 | [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
|
---|