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

Contents of /code/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 77 - (hide annotations) (download)
Sat Feb 24 21:40:45 2007 UTC (7 years, 9 months ago) by nigel
File size: 7339 byte(s)
Load pcre-6.0 into code/trunk.

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