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

Contents of /code/trunk/configure.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 73 - (show annotations)
Sat Feb 24 21:40:30 2007 UTC (12 years, 5 months ago) by nigel
File size: 5153 byte(s)
Load pcre-4.5 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=4
24 PCRE_MINOR=5
25 PCRE_DATE=01-December-2003
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 AC_PROG_INSTALL
42 AC_LIBTOOL_WIN32_DLL
43 AC_PROG_LIBTOOL
44
45 dnl We need to find a compiler for compiling a program to run on the local host
46 dnl while building. It needs to be different from CC when cross-compiling.
47 dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for
48 dnl figuring this out automatically. Unfortunately, it does not work with the
49 dnl latest versions of autoconf. So for the moment, we just default to the
50 dnl same values as the "main" compiler. People who are corss-compiling will
51 dnl just have to adjust the Makefile by hand or set these values when they
52 dnl run "configure".
53
54 CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'}
55 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'}
56 BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'}
57 BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'}
58
59 dnl Checks for header files.
60
61 AC_HEADER_STDC
62 AC_CHECK_HEADERS(limits.h)
63
64 dnl Checks for typedefs, structures, and compiler characteristics.
65
66 AC_C_CONST
67 AC_TYPE_SIZE_T
68
69 dnl Checks for library functions.
70
71 AC_CHECK_FUNCS(bcopy memmove strerror)
72
73 dnl Handle --enable-utf8
74
75 AC_ARG_ENABLE(utf8,
76 [ --enable-utf8 enable UTF8 support],
77 if test "$enableval" = "yes"; then
78 UTF8=-DSUPPORT_UTF8
79 fi
80 )
81
82 dnl Handle --enable-newline-is-cr
83
84 AC_ARG_ENABLE(newline-is-cr,
85 [ --enable-newline-is-cr use CR as the newline character],
86 if test "$enableval" = "yes"; then
87 NEWLINE=-DNEWLINE=13
88 fi
89 )
90
91 dnl Handle --enable-newline-is-lf
92
93 AC_ARG_ENABLE(newline-is-lf,
94 [ --enable-newline-is-lf use LF as the newline character],
95 if test "$enableval" = "yes"; then
96 NEWLINE=-DNEWLINE=10
97 fi
98 )
99
100 dnl Handle --enable-ebcdic
101
102 AC_ARG_ENABLE(ebcdic,
103 [ --enable-ebcdic assume EBCDIC coding rather than ASCII],
104 if test "$enableval" == "yes"; then
105 EBCDIC=-DEBCDIC=1
106 fi
107 )
108
109 dnl Handle --disable-stack-for-recursion
110 AC_ARG_ENABLE(recursion,
111 [ --disable-stack-for-recursion disable use of stack recursion when matching],
112 if test "$enableval" = "no"; then
113 NO_RECURSE=-DNO_RECURSE
114 fi
115 )
116
117 dnl There doesn't seem to be a straightforward way of having parameters
118 dnl that set values, other than fudging the --with thing. So that's what
119 dnl I've done.
120
121 dnl Handle --with-posix-malloc-threshold=n
122
123 AC_ARG_WITH(posix-malloc-threshold,
124 [ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage],
125 POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval
126 )
127
128 dnl Handle --with-link-size=n
129
130 AC_ARG_WITH(link-size,
131 [ --with-link-size=2 internal link size (2, 3, or 4 allowed)],
132 LINK_SIZE=-DLINK_SIZE=$withval
133 )
134
135 dnl Handle --with-match_limit=n
136
137 AC_ARG_WITH(match-limit,
138 [ --with-match-limit=10000000 default limit on internal looping)],
139 MATCH_LIMIT=-DMATCH_LIMIT=$withval
140 )
141
142 dnl Now arrange to build libtool
143
144 AC_PROG_LIBTOOL
145
146 dnl "Export" these variables
147
148 AC_SUBST(BUILD_EXEEXT)
149 AC_SUBST(BUILD_OBJEXT)
150 AC_SUBST(CC_FOR_BUILD)
151 AC_SUBST(CFLAGS_FOR_BUILD)
152 AC_SUBST(EBCDIC)
153 AC_SUBST(HAVE_MEMMOVE)
154 AC_SUBST(HAVE_STRERROR)
155 AC_SUBST(LINK_SIZE)
156 AC_SUBST(MATCH_LIMIT)
157 AC_SUBST(NEWLINE)
158 AC_SUBST(NO_RECURSE)
159 AC_SUBST(PCRE_MAJOR)
160 AC_SUBST(PCRE_MINOR)
161 AC_SUBST(PCRE_DATE)
162 AC_SUBST(PCRE_VERSION)
163 AC_SUBST(PCRE_LIB_VERSION)
164 AC_SUBST(PCRE_POSIXLIB_VERSION)
165 AC_SUBST(POSIX_MALLOC_THRESHOLD)
166 AC_SUBST(UTF8)
167
168 dnl Stuff to make MinGW work better. Special treatment is no longer
169 dnl needed for Cygwin.
170
171 case $host_os in
172 mingw* )
173 POSIX_OBJ=pcreposix.o
174 POSIX_LOBJ=pcreposix.lo
175 POSIX_LIB=
176 ON_WINDOWS=
177 NOT_ON_WINDOWS="#"
178 WIN_PREFIX=
179 ;;
180 * )
181 ON_WINDOWS="#"
182 NOT_ON_WINDOWS=
183 POSIX_OBJ=
184 POSIX_LOBJ=
185 POSIX_LIB=libpcreposix.la
186 WIN_PREFIX=
187 ;;
188 esac
189 AC_SUBST(WIN_PREFIX)
190 AC_SUBST(ON_WINDOWS)
191 AC_SUBST(NOT_ON_WINDOWS)
192 AC_SUBST(POSIX_OBJ)
193 AC_SUBST(POSIX_LOBJ)
194 AC_SUBST(POSIX_LIB)
195
196 if test "x$enable_shared" = "xno" ; then
197 AC_DEFINE([PCRE_STATIC],[1],[to link statically])
198 fi
199
200 dnl This must be last; it determines what files are written as well as config.h
201 AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config:pcre-config.in RunTest:RunTest.in,[chmod a+x RunTest pcre-config])

  ViewVC Help
Powered by ViewVC 1.1.5