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

Contents of /code/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 83 - (hide annotations) (download)
Sat Feb 24 21:41:06 2007 UTC (7 years, 4 months ago) by nigel
File size: 8709 byte(s)
Load pcre-6.3 into code/trunk.

1 nigel 41 dnl Process this file with autoconf to produce a configure script.
2    
3 nigel 83 dnl This configure.in file has been hacked around quite a lot as a result of
4     dnl patches that various people have sent to me (PH). Sometimes the information
5     dnl I get is contradictory. I've tried to put in comments that explain things,
6     dnl but in some cases the information is second-hand and I have no way of
7     dnl verifying it. I am not an autoconf or libtool expert!
8    
9 nigel 41 dnl This is required at the start; the name is the name of a file
10     dnl it should be seeing, to verify it is in the same directory.
11    
12     AC_INIT(dftables.c)
13    
14 nigel 67 dnl A safety precaution
15    
16     AC_PREREQ(2.57)
17    
18 nigel 43 dnl Arrange to build config.h from config.in. Note that pcre.h is
19     dnl built differently, as it is just a "substitution" file.
20     dnl Manual says this macro should come right after AC_INIT.
21     AC_CONFIG_HEADER(config.h:config.in)
22    
23     dnl Provide the current PCRE version information. Do not use numbers
24     dnl with leading zeros for the minor version, as they end up in a C
25     dnl macro, and may be treated as octal constants. Stick to single
26     dnl digits for minor numbers less than 10. There are unlikely to be
27     dnl that many releases anyway.
28    
29 nigel 77 PCRE_MAJOR=6
30 nigel 83 PCRE_MINOR=3
31     PCRE_DATE=15-Aug-2005
32 nigel 43 PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR}
33    
34 nigel 63 dnl Default values for miscellaneous macros
35    
36     POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10
37    
38 nigel 43 dnl Provide versioning information for libtool shared libraries that
39     dnl are built by default on Unix systems.
40    
41 nigel 47 PCRE_LIB_VERSION=0:1:0
42 nigel 43 PCRE_POSIXLIB_VERSION=0:0:0
43 nigel 77 PCRE_CPPLIB_VERSION=0:0:0
44 nigel 43
45 nigel 83 dnl Handle --disable-cpp
46    
47     AC_ARG_ENABLE(cpp,
48     [ --disable-cpp disable C++ support],
49     want_cpp="$enableval", want_cpp=yes)
50    
51 nigel 41 dnl Checks for programs.
52 nigel 43
53 nigel 41 AC_PROG_CC
54 nigel 75
55 nigel 83 dnl Test for C++ for the C++ wrapper libpcrecpp. It seems, however, that
56     dnl AC_PROC_CXX will set $CXX to "g++" when no C++ compiler is installed, even
57     dnl though that is completely bogus. (This may happen only on certain systems
58     dnl with certain versions of autoconf, of course.) An attempt to include this
59     dnl test inside a check for want_cpp was criticized by a libtool expert, who
60     dnl tells me that it isn't allowed.
61 nigel 77
62     AC_PROG_CXX
63    
64 nigel 75 dnl The icc compiler has the same options as gcc, so let the rest of the
65     dnl configure script think it has gcc when setting up dnl options etc.
66     dnl This is a nasty hack which no longer seems necessary with the update
67     dnl to the latest libtool files, so I have commented it out.
68     dnl
69     dnl if test "$CC" = "icc" ; then GCC=yes ; fi
70    
71 nigel 53 AC_PROG_INSTALL
72 nigel 63 AC_LIBTOOL_WIN32_DLL
73     AC_PROG_LIBTOOL
74 nigel 41
75 nigel 67 dnl We need to find a compiler for compiling a program to run on the local host
76 nigel 65 dnl while building. It needs to be different from CC when cross-compiling.
77     dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for
78 nigel 67 dnl figuring this out automatically. Unfortunately, it does not work with the
79     dnl latest versions of autoconf. So for the moment, we just default to the
80 nigel 83 dnl same values as the "main" compiler. People who are cross-compiling will
81 nigel 67 dnl just have to adjust the Makefile by hand or set these values when they
82     dnl run "configure".
83 nigel 65
84     CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'}
85 nigel 77 CXX_FOR_BUILD=${CXX_FOR_BUILD:-'$(CXX)'}
86 nigel 65 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'}
87 nigel 77 CPPFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CPPFLAGS)'}
88     CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD:-'$(CXXFLAGS)'}
89 nigel 67 BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'}
90     BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'}
91 nigel 65
92 nigel 41 dnl Checks for header files.
93 nigel 43
94 nigel 41 AC_HEADER_STDC
95     AC_CHECK_HEADERS(limits.h)
96    
97 nigel 83 dnl The files below are C++ header files. One person told me (PH) that
98     dnl AC_LANG_CPLUSPLUS unsets CXX if it was explicitly set to something which
99     dnl doesn't work. However, this doesn't always seem to be the case.
100 nigel 77
101 nigel 83 if test "x$want_cpp" = "xyes" -a -n "$CXX"
102     then
103 nigel 77 AC_LANG_SAVE
104     AC_LANG_CPLUSPLUS
105 nigel 83
106     dnl We could be more clever here, given we're doing AC_SUBST with this
107     dnl (eg set a var to be the name of the include file we want). But we're not
108 nigel 77 dnl so it's easy to change back to 'regular' autoconf vars if we needed to.
109 nigel 83 AC_CHECK_HEADERS(string, [pcre_have_cpp_headers="1"],
110     [pcre_have_cpp_headers="0"])
111     AC_CHECK_HEADERS(bits/type_traits.h, [pcre_have_bits_type_traits="1"],
112     [pcre_have_bits_type_traits="0"])
113     AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],
114     [pcre_have_type_traits="0"])
115 nigel 77 dnl Using AC_SUBST eliminates the need to include config.h in a public .h file
116 nigel 83 AC_SUBST(pcre_have_bits_type_traits)
117     AC_SUBST(pcre_have_type_traits)
118 nigel 77 AC_LANG_RESTORE
119 nigel 83 fi
120 nigel 77
121 nigel 79 dnl From the above, we now have enough info to know if C++ is fully installed
122 nigel 83 if test "x$want_cpp" = "xyes" -a -n "$CXX" -a "$pcre_have_cpp_headers" = 1; then
123 nigel 79 MAYBE_CPP_TARGETS='$(CPP_TARGETS)'
124 nigel 83 HAVE_CPP=
125     else
126     MAYBE_CPP_TARGETS=
127     HAVE_CPP="#"
128 nigel 79 fi
129     AC_SUBST(MAYBE_CPP_TARGETS)
130 nigel 83 AC_SUBST(HAVE_CPP)
131 nigel 79
132 nigel 41 dnl Checks for typedefs, structures, and compiler characteristics.
133 nigel 43
134 nigel 41 AC_C_CONST
135     AC_TYPE_SIZE_T
136    
137 nigel 83 AC_CHECK_TYPES([long long], [pcre_have_long_long="1"], [pcre_have_long_long="0"])
138     AC_CHECK_TYPES([unsigned long long], [pcre_have_ulong_long="1"], [pcre_have_ulong_long="0"])
139     AC_SUBST(pcre_have_long_long)
140     AC_SUBST(pcre_have_ulong_long)
141 nigel 77
142 nigel 41 dnl Checks for library functions.
143 nigel 43
144 nigel 77 AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll)
145 nigel 41
146 nigel 49 dnl Handle --enable-utf8
147    
148     AC_ARG_ENABLE(utf8,
149 nigel 63 [ --enable-utf8 enable UTF8 support],
150 nigel 49 if test "$enableval" = "yes"; then
151     UTF8=-DSUPPORT_UTF8
152     fi
153     )
154    
155 nigel 75 dnl Handle --enable-unicode-properties
156    
157     AC_ARG_ENABLE(unicode-properties,
158     [ --enable-unicode-properties enable Unicode properties support],
159     if test "$enableval" = "yes"; then
160     UCP=-DSUPPORT_UCP
161     fi
162     )
163    
164 nigel 53 dnl Handle --enable-newline-is-cr
165    
166     AC_ARG_ENABLE(newline-is-cr,
167     [ --enable-newline-is-cr use CR as the newline character],
168     if test "$enableval" = "yes"; then
169     NEWLINE=-DNEWLINE=13
170     fi
171     )
172    
173     dnl Handle --enable-newline-is-lf
174    
175     AC_ARG_ENABLE(newline-is-lf,
176     [ --enable-newline-is-lf use LF as the newline character],
177     if test "$enableval" = "yes"; then
178     NEWLINE=-DNEWLINE=10
179     fi
180     )
181    
182 nigel 73 dnl Handle --enable-ebcdic
183    
184     AC_ARG_ENABLE(ebcdic,
185     [ --enable-ebcdic assume EBCDIC coding rather than ASCII],
186     if test "$enableval" == "yes"; then
187     EBCDIC=-DEBCDIC=1
188     fi
189     )
190    
191     dnl Handle --disable-stack-for-recursion
192 nigel 75
193     AC_ARG_ENABLE(stack-for-recursion,
194 nigel 73 [ --disable-stack-for-recursion disable use of stack recursion when matching],
195     if test "$enableval" = "no"; then
196     NO_RECURSE=-DNO_RECURSE
197     fi
198     )
199    
200 nigel 63 dnl There doesn't seem to be a straightforward way of having parameters
201     dnl that set values, other than fudging the --with thing. So that's what
202     dnl I've done.
203    
204     dnl Handle --with-posix-malloc-threshold=n
205    
206     AC_ARG_WITH(posix-malloc-threshold,
207     [ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage],
208     POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval
209     )
210    
211     dnl Handle --with-link-size=n
212    
213     AC_ARG_WITH(link-size,
214     [ --with-link-size=2 internal link size (2, 3, or 4 allowed)],
215     LINK_SIZE=-DLINK_SIZE=$withval
216     )
217    
218     dnl Handle --with-match_limit=n
219    
220     AC_ARG_WITH(match-limit,
221     [ --with-match-limit=10000000 default limit on internal looping)],
222     MATCH_LIMIT=-DMATCH_LIMIT=$withval
223     )
224    
225 nigel 75 dnl Unicode character property support implies UTF-8 support
226    
227     if test "$UCP" != "" ; then
228     UTF8=-DSUPPORT_UTF8
229     fi
230    
231 nigel 43 dnl "Export" these variables
232    
233 nigel 67 AC_SUBST(BUILD_EXEEXT)
234     AC_SUBST(BUILD_OBJEXT)
235 nigel 65 AC_SUBST(CC_FOR_BUILD)
236 nigel 77 AC_SUBST(CXX_FOR_BUILD)
237 nigel 65 AC_SUBST(CFLAGS_FOR_BUILD)
238 nigel 77 AC_SUBST(CXXFLAGS_FOR_BUILD)
239 nigel 73 AC_SUBST(EBCDIC)
240 nigel 43 AC_SUBST(HAVE_MEMMOVE)
241     AC_SUBST(HAVE_STRERROR)
242 nigel 63 AC_SUBST(LINK_SIZE)
243     AC_SUBST(MATCH_LIMIT)
244 nigel 65 AC_SUBST(NEWLINE)
245 nigel 73 AC_SUBST(NO_RECURSE)
246 nigel 43 AC_SUBST(PCRE_MAJOR)
247     AC_SUBST(PCRE_MINOR)
248     AC_SUBST(PCRE_DATE)
249     AC_SUBST(PCRE_VERSION)
250     AC_SUBST(PCRE_LIB_VERSION)
251     AC_SUBST(PCRE_POSIXLIB_VERSION)
252 nigel 77 AC_SUBST(PCRE_CPPLIB_VERSION)
253 nigel 63 AC_SUBST(POSIX_MALLOC_THRESHOLD)
254 nigel 75 AC_SUBST(UCP)
255 nigel 65 AC_SUBST(UTF8)
256 nigel 41
257 nigel 71 dnl Stuff to make MinGW work better. Special treatment is no longer
258     dnl needed for Cygwin.
259 nigel 63
260     case $host_os in
261     mingw* )
262     POSIX_OBJ=pcreposix.o
263     POSIX_LOBJ=pcreposix.lo
264     POSIX_LIB=
265 nigel 67 ON_WINDOWS=
266     NOT_ON_WINDOWS="#"
267     WIN_PREFIX=
268 nigel 63 ;;
269     * )
270 nigel 67 ON_WINDOWS="#"
271     NOT_ON_WINDOWS=
272 nigel 63 POSIX_OBJ=
273     POSIX_LOBJ=
274     POSIX_LIB=libpcreposix.la
275 nigel 67 WIN_PREFIX=
276 nigel 63 ;;
277     esac
278 nigel 67 AC_SUBST(WIN_PREFIX)
279     AC_SUBST(ON_WINDOWS)
280     AC_SUBST(NOT_ON_WINDOWS)
281 nigel 63 AC_SUBST(POSIX_OBJ)
282     AC_SUBST(POSIX_LOBJ)
283     AC_SUBST(POSIX_LIB)
284    
285     if test "x$enable_shared" = "xno" ; then
286 nigel 71 AC_DEFINE([PCRE_STATIC],[1],[to link statically])
287 nigel 63 fi
288    
289 nigel 53 dnl This must be last; it determines what files are written as well as config.h
290 nigel 77 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