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

Contents of /code/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 75 - (hide annotations) (download)
Sat Feb 24 21:40:37 2007 UTC (7 years, 1 month ago) by nigel
File size: 5847 byte(s)
Load pcre-5.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 75 PCRE_MAJOR=5
24     PCRE_MINOR=0
25     PCRE_DATE=13-Sep-2004
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    
38 nigel 41 dnl Checks for programs.
39 nigel 43
40 nigel 41 AC_PROG_CC
41 nigel 75
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 nigel 53 AC_PROG_INSTALL
50 nigel 63 AC_LIBTOOL_WIN32_DLL
51     AC_PROG_LIBTOOL
52 nigel 41
53 nigel 67 dnl We need to find a compiler for compiling a program to run on the local host
54 nigel 65 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 nigel 67 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 nigel 65
62     CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'}
63     CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'}
64 nigel 67 BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'}
65     BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'}
66 nigel 65
67 nigel 41 dnl Checks for header files.
68 nigel 43
69 nigel 41 AC_HEADER_STDC
70     AC_CHECK_HEADERS(limits.h)
71    
72     dnl Checks for typedefs, structures, and compiler characteristics.
73 nigel 43
74 nigel 41 AC_C_CONST
75     AC_TYPE_SIZE_T
76    
77     dnl Checks for library functions.
78 nigel 43
79 nigel 47 AC_CHECK_FUNCS(bcopy memmove strerror)
80 nigel 41
81 nigel 49 dnl Handle --enable-utf8
82    
83     AC_ARG_ENABLE(utf8,
84 nigel 63 [ --enable-utf8 enable UTF8 support],
85 nigel 49 if test "$enableval" = "yes"; then
86     UTF8=-DSUPPORT_UTF8
87     fi
88     )
89    
90 nigel 75 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 nigel 53 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 nigel 73 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 nigel 75
128     AC_ARG_ENABLE(stack-for-recursion,
129 nigel 73 [ --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 nigel 63 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 nigel 53 dnl Now arrange to build libtool
161    
162     AC_PROG_LIBTOOL
163    
164 nigel 75 dnl Unicode character property support implies UTF-8 support
165    
166     if test "$UCP" != "" ; then
167     UTF8=-DSUPPORT_UTF8
168     fi
169    
170 nigel 43 dnl "Export" these variables
171    
172 nigel 67 AC_SUBST(BUILD_EXEEXT)
173     AC_SUBST(BUILD_OBJEXT)
174 nigel 65 AC_SUBST(CC_FOR_BUILD)
175     AC_SUBST(CFLAGS_FOR_BUILD)
176 nigel 73 AC_SUBST(EBCDIC)
177 nigel 43 AC_SUBST(HAVE_MEMMOVE)
178     AC_SUBST(HAVE_STRERROR)
179 nigel 63 AC_SUBST(LINK_SIZE)
180     AC_SUBST(MATCH_LIMIT)
181 nigel 65 AC_SUBST(NEWLINE)
182 nigel 73 AC_SUBST(NO_RECURSE)
183 nigel 43 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 nigel 63 AC_SUBST(POSIX_MALLOC_THRESHOLD)
190 nigel 75 AC_SUBST(UCP)
191 nigel 65 AC_SUBST(UTF8)
192 nigel 41
193 nigel 71 dnl Stuff to make MinGW work better. Special treatment is no longer
194     dnl needed for Cygwin.
195 nigel 63
196     case $host_os in
197     mingw* )
198     POSIX_OBJ=pcreposix.o
199     POSIX_LOBJ=pcreposix.lo
200     POSIX_LIB=
201 nigel 67 ON_WINDOWS=
202     NOT_ON_WINDOWS="#"
203     WIN_PREFIX=
204 nigel 63 ;;
205     * )
206 nigel 67 ON_WINDOWS="#"
207     NOT_ON_WINDOWS=
208 nigel 63 POSIX_OBJ=
209     POSIX_LOBJ=
210     POSIX_LIB=libpcreposix.la
211 nigel 67 WIN_PREFIX=
212 nigel 63 ;;
213     esac
214 nigel 67 AC_SUBST(WIN_PREFIX)
215     AC_SUBST(ON_WINDOWS)
216     AC_SUBST(NOT_ON_WINDOWS)
217 nigel 63 AC_SUBST(POSIX_OBJ)
218     AC_SUBST(POSIX_LOBJ)
219     AC_SUBST(POSIX_LIB)
220    
221     if test "x$enable_shared" = "xno" ; then
222 nigel 71 AC_DEFINE([PCRE_STATIC],[1],[to link statically])
223 nigel 63 fi
224    
225 nigel 53 dnl This must be last; it determines what files are written as well as config.h
226 nigel 75 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])

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12