1 |
dnl Process this file with autoconf to produce a configure script.
|
2 |
|
3 |
dnl This is required at the start; the name is the name of a file
|
4 |
dnl it should be seeing, to verify it is in the same directory.
|
5 |
|
6 |
AC_INIT(dftables.c)
|
7 |
|
8 |
dnl A safety precaution
|
9 |
|
10 |
AC_PREREQ(2.57)
|
11 |
|
12 |
dnl Arrange to build config.h from config.in. Note that pcre.h is
|
13 |
dnl built differently, as it is just a "substitution" file.
|
14 |
dnl Manual says this macro should come right after AC_INIT.
|
15 |
AC_CONFIG_HEADER(config.h:config.in)
|
16 |
|
17 |
dnl Provide the current PCRE version information. Do not use numbers
|
18 |
dnl with leading zeros for the minor version, as they end up in a C
|
19 |
dnl macro, and may be treated as octal constants. Stick to single
|
20 |
dnl digits for minor numbers less than 10. There are unlikely to be
|
21 |
dnl that many releases anyway.
|
22 |
|
23 |
PCRE_MAJOR=5
|
24 |
PCRE_MINOR=0
|
25 |
PCRE_DATE=13-Sep-2004
|
26 |
PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR}
|
27 |
|
28 |
dnl Default values for miscellaneous macros
|
29 |
|
30 |
POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10
|
31 |
|
32 |
dnl Provide versioning information for libtool shared libraries that
|
33 |
dnl are built by default on Unix systems.
|
34 |
|
35 |
PCRE_LIB_VERSION=0:1:0
|
36 |
PCRE_POSIXLIB_VERSION=0:0:0
|
37 |
|
38 |
dnl Checks for programs.
|
39 |
|
40 |
AC_PROG_CC
|
41 |
|
42 |
dnl The icc compiler has the same options as gcc, so let the rest of the
|
43 |
dnl configure script think it has gcc when setting up dnl options etc.
|
44 |
dnl This is a nasty hack which no longer seems necessary with the update
|
45 |
dnl to the latest libtool files, so I have commented it out.
|
46 |
dnl
|
47 |
dnl if test "$CC" = "icc" ; then GCC=yes ; fi
|
48 |
|
49 |
AC_PROG_INSTALL
|
50 |
AC_LIBTOOL_WIN32_DLL
|
51 |
AC_PROG_LIBTOOL
|
52 |
|
53 |
dnl We need to find a compiler for compiling a program to run on the local host
|
54 |
dnl while building. It needs to be different from CC when cross-compiling.
|
55 |
dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for
|
56 |
dnl figuring this out automatically. Unfortunately, it does not work with the
|
57 |
dnl latest versions of autoconf. So for the moment, we just default to the
|
58 |
dnl same values as the "main" compiler. People who are corss-compiling will
|
59 |
dnl just have to adjust the Makefile by hand or set these values when they
|
60 |
dnl run "configure".
|
61 |
|
62 |
CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'}
|
63 |
CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'}
|
64 |
BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'}
|
65 |
BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'}
|
66 |
|
67 |
dnl Checks for header files.
|
68 |
|
69 |
AC_HEADER_STDC
|
70 |
AC_CHECK_HEADERS(limits.h)
|
71 |
|
72 |
dnl Checks for typedefs, structures, and compiler characteristics.
|
73 |
|
74 |
AC_C_CONST
|
75 |
AC_TYPE_SIZE_T
|
76 |
|
77 |
dnl Checks for library functions.
|
78 |
|
79 |
AC_CHECK_FUNCS(bcopy memmove strerror)
|
80 |
|
81 |
dnl Handle --enable-utf8
|
82 |
|
83 |
AC_ARG_ENABLE(utf8,
|
84 |
[ --enable-utf8 enable UTF8 support],
|
85 |
if test "$enableval" = "yes"; then
|
86 |
UTF8=-DSUPPORT_UTF8
|
87 |
fi
|
88 |
)
|
89 |
|
90 |
dnl Handle --enable-unicode-properties
|
91 |
|
92 |
AC_ARG_ENABLE(unicode-properties,
|
93 |
[ --enable-unicode-properties enable Unicode properties support],
|
94 |
if test "$enableval" = "yes"; then
|
95 |
UCP=-DSUPPORT_UCP
|
96 |
fi
|
97 |
)
|
98 |
|
99 |
dnl Handle --enable-newline-is-cr
|
100 |
|
101 |
AC_ARG_ENABLE(newline-is-cr,
|
102 |
[ --enable-newline-is-cr use CR as the newline character],
|
103 |
if test "$enableval" = "yes"; then
|
104 |
NEWLINE=-DNEWLINE=13
|
105 |
fi
|
106 |
)
|
107 |
|
108 |
dnl Handle --enable-newline-is-lf
|
109 |
|
110 |
AC_ARG_ENABLE(newline-is-lf,
|
111 |
[ --enable-newline-is-lf use LF as the newline character],
|
112 |
if test "$enableval" = "yes"; then
|
113 |
NEWLINE=-DNEWLINE=10
|
114 |
fi
|
115 |
)
|
116 |
|
117 |
dnl Handle --enable-ebcdic
|
118 |
|
119 |
AC_ARG_ENABLE(ebcdic,
|
120 |
[ --enable-ebcdic assume EBCDIC coding rather than ASCII],
|
121 |
if test "$enableval" == "yes"; then
|
122 |
EBCDIC=-DEBCDIC=1
|
123 |
fi
|
124 |
)
|
125 |
|
126 |
dnl Handle --disable-stack-for-recursion
|
127 |
|
128 |
AC_ARG_ENABLE(stack-for-recursion,
|
129 |
[ --disable-stack-for-recursion disable use of stack recursion when matching],
|
130 |
if test "$enableval" = "no"; then
|
131 |
NO_RECURSE=-DNO_RECURSE
|
132 |
fi
|
133 |
)
|
134 |
|
135 |
dnl There doesn't seem to be a straightforward way of having parameters
|
136 |
dnl that set values, other than fudging the --with thing. So that's what
|
137 |
dnl I've done.
|
138 |
|
139 |
dnl Handle --with-posix-malloc-threshold=n
|
140 |
|
141 |
AC_ARG_WITH(posix-malloc-threshold,
|
142 |
[ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage],
|
143 |
POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval
|
144 |
)
|
145 |
|
146 |
dnl Handle --with-link-size=n
|
147 |
|
148 |
AC_ARG_WITH(link-size,
|
149 |
[ --with-link-size=2 internal link size (2, 3, or 4 allowed)],
|
150 |
LINK_SIZE=-DLINK_SIZE=$withval
|
151 |
)
|
152 |
|
153 |
dnl Handle --with-match_limit=n
|
154 |
|
155 |
AC_ARG_WITH(match-limit,
|
156 |
[ --with-match-limit=10000000 default limit on internal looping)],
|
157 |
MATCH_LIMIT=-DMATCH_LIMIT=$withval
|
158 |
)
|
159 |
|
160 |
dnl Now arrange to build libtool
|
161 |
|
162 |
AC_PROG_LIBTOOL
|
163 |
|
164 |
dnl Unicode character property support implies UTF-8 support
|
165 |
|
166 |
if test "$UCP" != "" ; then
|
167 |
UTF8=-DSUPPORT_UTF8
|
168 |
fi
|
169 |
|
170 |
dnl "Export" these variables
|
171 |
|
172 |
AC_SUBST(BUILD_EXEEXT)
|
173 |
AC_SUBST(BUILD_OBJEXT)
|
174 |
AC_SUBST(CC_FOR_BUILD)
|
175 |
AC_SUBST(CFLAGS_FOR_BUILD)
|
176 |
AC_SUBST(EBCDIC)
|
177 |
AC_SUBST(HAVE_MEMMOVE)
|
178 |
AC_SUBST(HAVE_STRERROR)
|
179 |
AC_SUBST(LINK_SIZE)
|
180 |
AC_SUBST(MATCH_LIMIT)
|
181 |
AC_SUBST(NEWLINE)
|
182 |
AC_SUBST(NO_RECURSE)
|
183 |
AC_SUBST(PCRE_MAJOR)
|
184 |
AC_SUBST(PCRE_MINOR)
|
185 |
AC_SUBST(PCRE_DATE)
|
186 |
AC_SUBST(PCRE_VERSION)
|
187 |
AC_SUBST(PCRE_LIB_VERSION)
|
188 |
AC_SUBST(PCRE_POSIXLIB_VERSION)
|
189 |
AC_SUBST(POSIX_MALLOC_THRESHOLD)
|
190 |
AC_SUBST(UCP)
|
191 |
AC_SUBST(UTF8)
|
192 |
|
193 |
dnl Stuff to make MinGW work better. Special treatment is no longer
|
194 |
dnl needed for Cygwin.
|
195 |
|
196 |
case $host_os in
|
197 |
mingw* )
|
198 |
POSIX_OBJ=pcreposix.o
|
199 |
POSIX_LOBJ=pcreposix.lo
|
200 |
POSIX_LIB=
|
201 |
ON_WINDOWS=
|
202 |
NOT_ON_WINDOWS="#"
|
203 |
WIN_PREFIX=
|
204 |
;;
|
205 |
* )
|
206 |
ON_WINDOWS="#"
|
207 |
NOT_ON_WINDOWS=
|
208 |
POSIX_OBJ=
|
209 |
POSIX_LOBJ=
|
210 |
POSIX_LIB=libpcreposix.la
|
211 |
WIN_PREFIX=
|
212 |
;;
|
213 |
esac
|
214 |
AC_SUBST(WIN_PREFIX)
|
215 |
AC_SUBST(ON_WINDOWS)
|
216 |
AC_SUBST(NOT_ON_WINDOWS)
|
217 |
AC_SUBST(POSIX_OBJ)
|
218 |
AC_SUBST(POSIX_LOBJ)
|
219 |
AC_SUBST(POSIX_LIB)
|
220 |
|
221 |
if test "x$enable_shared" = "xno" ; then
|
222 |
AC_DEFINE([PCRE_STATIC],[1],[to link statically])
|
223 |
fi
|
224 |
|
225 |
dnl This must be last; it determines what files are written as well as config.h
|
226 |
AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config:pcre-config.in libpcre.pc:libpcre.pc.in RunTest:RunTest.in,[chmod a+x RunTest pcre-config])
|