/[pcre]/code/trunk/configure.in
ViewVC logotype

Contents of /code/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 81 - (show annotations) (download)
Sat Feb 24 21:40:59 2007 UTC (7 years, 7 months ago) by nigel
File size: 7486 byte(s)
Load pcre-6.2 into code/trunk.

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=6
24 PCRE_MINOR=2
25 PCRE_DATE=01-Aug-2005
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 PCRE_CPPLIB_VERSION=0:0:0
38
39 dnl Checks for programs.
40
41 AC_PROG_CC
42
43 dnl For the C++ wrapper libpcrecpp.
44
45 AC_PROG_CXX
46
47 dnl The icc compiler has the same options as gcc, so let the rest of the
48 dnl configure script think it has gcc when setting up dnl options etc.
49 dnl This is a nasty hack which no longer seems necessary with the update
50 dnl to the latest libtool files, so I have commented it out.
51 dnl
52 dnl if test "$CC" = "icc" ; then GCC=yes ; fi
53
54 AC_PROG_INSTALL
55 AC_LIBTOOL_WIN32_DLL
56 AC_PROG_LIBTOOL
57
58 dnl We need to find a compiler for compiling a program to run on the local host
59 dnl while building. It needs to be different from CC when cross-compiling.
60 dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for
61 dnl figuring this out automatically. Unfortunately, it does not work with the
62 dnl latest versions of autoconf. So for the moment, we just default to the
63 dnl same values as the "main" compiler. People who are corss-compiling will
64 dnl just have to adjust the Makefile by hand or set these values when they
65 dnl run "configure".
66
67 CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'}
68 CXX_FOR_BUILD=${CXX_FOR_BUILD:-'$(CXX)'}
69 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'}
70 CPPFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CPPFLAGS)'}
71 CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD:-'$(CXXFLAGS)'}
72 BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'}
73 BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'}
74
75 dnl Checks for header files.
76
77 AC_HEADER_STDC
78 AC_CHECK_HEADERS(limits.h)
79
80 dnl These are C++ header files
81
82 AC_LANG_SAVE
83 AC_LANG_CPLUSPLUS
84 dnl I could be more clever here, given I'm doing AC_SUBST with this
85 dnl (eg set a var to be the name of the include file I want). But I'm not
86 dnl so it's easy to change back to 'regular' autoconf vars if we needed to.
87 AC_CHECK_HEADERS(string, [pcre_has_cpp_headers="1"],
88 [pcre_has_cpp_headers="0"])
89 AC_CHECK_HEADERS(bits/type_traits.h, [pcre_has_bits_type_traits="1"],
90 [pcre_has_bits_type_traits="0"])
91 AC_CHECK_HEADERS(type_traits.h, [pcre_has_type_traits="1"],
92 [pcre_has_type_traits="0"])
93 dnl Using AC_SUBST eliminates the need to include config.h in a public .h file
94 AC_SUBST(pcre_has_bits_type_traits)
95 AC_SUBST(pcre_has_type_traits)
96 AC_LANG_RESTORE
97
98 dnl From the above, we now have enough info to know if C++ is fully installed
99 if test -n "$ac_cv_prog_ac_ct_CXX" -a "$pcre_has_cpp_headers" = 1; then
100 MAYBE_CPP_TARGETS='$(CPP_TARGETS)'
101 fi
102 AC_SUBST(MAYBE_CPP_TARGETS)
103
104
105 dnl Checks for typedefs, structures, and compiler characteristics.
106
107 AC_C_CONST
108 AC_TYPE_SIZE_T
109
110 AC_CHECK_TYPES([long long], [pcre_has_long_long="1"], [pcre_has_long_long="0"])
111 AC_CHECK_TYPES([unsigned long long], [pcre_has_ulong_long="1"], [pcre_has_ulong_long="0"])
112 AC_SUBST(pcre_has_long_long)
113 AC_SUBST(pcre_has_ulong_long)
114
115 dnl Checks for library functions.
116
117 AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll)
118
119 dnl Handle --enable-utf8
120
121 AC_ARG_ENABLE(utf8,
122 [ --enable-utf8 enable UTF8 support],
123 if test "$enableval" = "yes"; then
124 UTF8=-DSUPPORT_UTF8
125 fi
126 )
127
128 dnl Handle --enable-unicode-properties
129
130 AC_ARG_ENABLE(unicode-properties,
131 [ --enable-unicode-properties enable Unicode properties support],
132 if test "$enableval" = "yes"; then
133 UCP=-DSUPPORT_UCP
134 fi
135 )
136
137 dnl Handle --enable-newline-is-cr
138
139 AC_ARG_ENABLE(newline-is-cr,
140 [ --enable-newline-is-cr use CR as the newline character],
141 if test "$enableval" = "yes"; then
142 NEWLINE=-DNEWLINE=13
143 fi
144 )
145
146 dnl Handle --enable-newline-is-lf
147
148 AC_ARG_ENABLE(newline-is-lf,
149 [ --enable-newline-is-lf use LF as the newline character],
150 if test "$enableval" = "yes"; then
151 NEWLINE=-DNEWLINE=10
152 fi
153 )
154
155 dnl Handle --enable-ebcdic
156
157 AC_ARG_ENABLE(ebcdic,
158 [ --enable-ebcdic assume EBCDIC coding rather than ASCII],
159 if test "$enableval" == "yes"; then
160 EBCDIC=-DEBCDIC=1
161 fi
162 )
163
164 dnl Handle --disable-stack-for-recursion
165
166 AC_ARG_ENABLE(stack-for-recursion,
167 [ --disable-stack-for-recursion disable use of stack recursion when matching],
168 if test "$enableval" = "no"; then
169 NO_RECURSE=-DNO_RECURSE
170 fi
171 )
172
173 dnl There doesn't seem to be a straightforward way of having parameters
174 dnl that set values, other than fudging the --with thing. So that's what
175 dnl I've done.
176
177 dnl Handle --with-posix-malloc-threshold=n
178
179 AC_ARG_WITH(posix-malloc-threshold,
180 [ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage],
181 POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval
182 )
183
184 dnl Handle --with-link-size=n
185
186 AC_ARG_WITH(link-size,
187 [ --with-link-size=2 internal link size (2, 3, or 4 allowed)],
188 LINK_SIZE=-DLINK_SIZE=$withval
189 )
190
191 dnl Handle --with-match_limit=n
192
193 AC_ARG_WITH(match-limit,
194 [ --with-match-limit=10000000 default limit on internal looping)],
195 MATCH_LIMIT=-DMATCH_LIMIT=$withval
196 )
197
198 dnl Unicode character property support implies UTF-8 support
199
200 if test "$UCP" != "" ; then
201 UTF8=-DSUPPORT_UTF8
202 fi
203
204 dnl "Export" these variables
205
206 AC_SUBST(BUILD_EXEEXT)
207 AC_SUBST(BUILD_OBJEXT)
208 AC_SUBST(CC_FOR_BUILD)
209 AC_SUBST(CXX_FOR_BUILD)
210 AC_SUBST(CFLAGS_FOR_BUILD)
211 AC_SUBST(CXXFLAGS_FOR_BUILD)
212 AC_SUBST(EBCDIC)
213 AC_SUBST(HAVE_MEMMOVE)
214 AC_SUBST(HAVE_STRERROR)
215 AC_SUBST(LINK_SIZE)
216 AC_SUBST(MATCH_LIMIT)
217 AC_SUBST(NEWLINE)
218 AC_SUBST(NO_RECURSE)
219 AC_SUBST(PCRE_MAJOR)
220 AC_SUBST(PCRE_MINOR)
221 AC_SUBST(PCRE_DATE)
222 AC_SUBST(PCRE_VERSION)
223 AC_SUBST(PCRE_LIB_VERSION)
224 AC_SUBST(PCRE_POSIXLIB_VERSION)
225 AC_SUBST(PCRE_CPPLIB_VERSION)
226 AC_SUBST(POSIX_MALLOC_THRESHOLD)
227 AC_SUBST(UCP)
228 AC_SUBST(UTF8)
229
230 dnl Stuff to make MinGW work better. Special treatment is no longer
231 dnl needed for Cygwin.
232
233 case $host_os in
234 mingw* )
235 POSIX_OBJ=pcreposix.o
236 POSIX_LOBJ=pcreposix.lo
237 POSIX_LIB=
238 ON_WINDOWS=
239 NOT_ON_WINDOWS="#"
240 WIN_PREFIX=
241 ;;
242 * )
243 ON_WINDOWS="#"
244 NOT_ON_WINDOWS=
245 POSIX_OBJ=
246 POSIX_LOBJ=
247 POSIX_LIB=libpcreposix.la
248 WIN_PREFIX=
249 ;;
250 esac
251 AC_SUBST(WIN_PREFIX)
252 AC_SUBST(ON_WINDOWS)
253 AC_SUBST(NOT_ON_WINDOWS)
254 AC_SUBST(POSIX_OBJ)
255 AC_SUBST(POSIX_LOBJ)
256 AC_SUBST(POSIX_LIB)
257
258 if test "x$enable_shared" = "xno" ; then
259 AC_DEFINE([PCRE_STATIC],[1],[to link statically])
260 fi
261
262 dnl This must be last; it determines what files are written as well as config.h
263 AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config:pcre-config.in libpcre.pc:libpcre.pc.in pcrecpp.h:pcrecpp.h.in pcre_stringpiece.h:pcre_stringpiece.h.in RunGrepTest:RunGrepTest.in RunTest:RunTest.in,[chmod a+x RunTest RunGrepTest pcre-config])

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12