| 1 |
dnl Process this file with autoconf to produce a configure script. |
dnl Process this file with autoconf to produce a configure script. |
| 2 |
|
|
| 3 |
|
dnl NOTE FOR MAINTAINERS: Do not use major or minor version numbers with |
| 4 |
|
dnl leading zeros, because they may be treated as octal constants. The |
| 5 |
|
dnl PCRE_PRERELEASE feature is for identifying release candidates. It might |
| 6 |
|
dnl be defined as -RC2, for example. For real releases, it should be defined |
| 7 |
|
dnl empty. |
| 8 |
|
|
| 9 |
m4_define(pcre_major, [7]) |
m4_define(pcre_major, [7]) |
| 10 |
m4_define(pcre_minor, [1]) |
m4_define(pcre_minor, [1]) |
| 11 |
m4_define(pcre_prerelease, [-RC1]) |
m4_define(pcre_prerelease, [-RC2]) |
| 12 |
m4_define(pcre_date, [2007-03-05]) |
m4_define(pcre_date, [2007-03-20]) |
| 13 |
|
|
| 14 |
# Libtool shared library interface versions (current:revision:age) |
# Libtool shared library interface versions (current:revision:age) |
| 15 |
m4_define(libpcre_version, [0:1:0]) |
m4_define(libpcre_version, [0:1:0]) |
| 49 |
[disable C++ support]), |
[disable C++ support]), |
| 50 |
, enable_cpp=yes) |
, enable_cpp=yes) |
| 51 |
|
|
| 52 |
|
# Handle --enable-rebuild-chartables |
| 53 |
|
AC_ARG_ENABLE(rebuild-chartables, |
| 54 |
|
AS_HELP_STRING([--enable-rebuild-chartables], |
| 55 |
|
[rebuild character tables in current locale]), |
| 56 |
|
, enable_rebuild_chartables=no) |
| 57 |
|
|
| 58 |
# Handle --enable-utf8 (disabled by default) |
# Handle --enable-utf8 (disabled by default) |
| 59 |
AC_ARG_ENABLE(utf8, |
AC_ARG_ENABLE(utf8, |
| 60 |
AS_HELP_STRING([--enable-utf8], |
AS_HELP_STRING([--enable-utf8], |
| 96 |
# Handle --enable-ebcdic |
# Handle --enable-ebcdic |
| 97 |
AC_ARG_ENABLE(ebcdic, |
AC_ARG_ENABLE(ebcdic, |
| 98 |
AS_HELP_STRING([--enable-ebcdic], |
AS_HELP_STRING([--enable-ebcdic], |
| 99 |
[assume EBCDIC coding rather than ASCII]), |
[assume EBCDIC coding rather than ASCII (implies --enable-rebuild-chartables)]), |
| 100 |
, enable_ebcdic=no) |
, enable_ebcdic=no) |
| 101 |
|
|
| 102 |
# Handle --disable-stack-for-recursion |
# Handle --disable-stack-for-recursion |
| 153 |
enable_utf8=no |
enable_utf8=no |
| 154 |
fi |
fi |
| 155 |
|
|
| 156 |
|
# Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled. |
| 157 |
|
# |
| 158 |
|
if test "x$enable_ebcdie" = "xyes" |
| 159 |
|
then |
| 160 |
|
enable_rebuild_chartables=yes |
| 161 |
|
fi |
| 162 |
|
|
| 163 |
# Convert the newline identifier into the appropriate integer value. |
# Convert the newline identifier into the appropriate integer value. |
| 164 |
case "$enable_newline" in |
case "$enable_newline" in |
| 165 |
lf) ac_pcre_newline_value=10 ;; |
lf) ac_pcre_newline_value=10 ;; |
| 180 |
esac |
esac |
| 181 |
|
|
| 182 |
AH_TOP([ |
AH_TOP([ |
| 183 |
/* On Unix-like systems config.in is converted by "configure" into |
/* On Unix-like systems config.h.in is converted by "configure" into config.h. |
| 184 |
config.h. Some other environments also support the use of "configure". |
Some other environments also support the use of "configure". PCRE is written in |
| 185 |
PCRE is written in Standard C, but there are a few non-standard things |
Standard C, but there are a few non-standard things it can cope with, allowing |
| 186 |
it can cope with, allowing it to run on SunOS4 and other "close to |
it to run on SunOS4 and other "close to standard" systems. |
| 187 |
standard" systems. |
|
| 188 |
|
If you are going to build PCRE "by hand" on a system without "configure" you |
| 189 |
On a non-Unix-like system you should just copy this file into config.h, |
should copy the distributed config.h.generic to config.h, and then set up the |
| 190 |
and set up the macros the way you need them. You should normally change |
macros the way you need them. Alternatively, you can avoid editing by using -D |
| 191 |
the definitions of HAVE_STRERROR and HAVE_MEMMOVE to 1. Unfortunately, |
on the compiler command line to set the macro values. |
| 192 |
because of the way autoconf works, these cannot be made the defaults. |
|
| 193 |
If your system has bcopy() and not memmove(), change the definition of |
PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if |
| 194 |
HAVE_BCOPY instead of HAVE_MEMMOVE. If your system has neither bcopy() |
HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set |
| 195 |
nor memmove(), leave them both as 0; an emulation function will be |
them both to 0; an emulation function will be used. */]) |
|
used. */]) |
|
| 196 |
|
|
| 197 |
# Checks for header files. |
# Checks for header files. |
| 198 |
AC_HEADER_STDC |
AC_HEADER_STDC |
| 206 |
AC_LANG_PUSH(C++) |
AC_LANG_PUSH(C++) |
| 207 |
|
|
| 208 |
# We could be more clever here, given we're doing AC_SUBST with this |
# We could be more clever here, given we're doing AC_SUBST with this |
| 209 |
# (eg set a var to be the name of the include file we want). But we're not |
# (eg set a var to be the name of the include file we want). But we're not |
| 210 |
# so it's easy to change back to 'regular' autoconf vars if we needed to. |
# so it's easy to change back to 'regular' autoconf vars if we needed to. |
| 211 |
AC_CHECK_HEADERS(string, [pcre_have_cpp_headers="1"], |
AC_CHECK_HEADERS(string, [pcre_have_cpp_headers="1"], |
| 212 |
[pcre_have_cpp_headers="0"]) |
[pcre_have_cpp_headers="0"]) |
| 222 |
|
|
| 223 |
# Conditional compilation |
# Conditional compilation |
| 224 |
AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes") |
AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes") |
| 225 |
|
AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes") |
| 226 |
|
|
| 227 |
# Checks for typedefs, structures, and compiler characteristics. |
# Checks for typedefs, structures, and compiler characteristics. |
| 228 |
|
|
| 265 |
if test "$enable_stack_for_recursion" = "no"; then |
if test "$enable_stack_for_recursion" = "no"; then |
| 266 |
AC_DEFINE([NO_RECURSE], [], [ |
AC_DEFINE([NO_RECURSE], [], [ |
| 267 |
PCRE uses recursive function calls to handle backtracking while |
PCRE uses recursive function calls to handle backtracking while |
| 268 |
matching. This can sometimes be a problem on systems that have |
matching. This can sometimes be a problem on systems that have |
| 269 |
stacks of limited size. Define NO_RECURSE to get a version that |
stacks of limited size. Define NO_RECURSE to get a version that |
| 270 |
doesn't use recursion in the match() function; instead it creates |
doesn't use recursion in the match() function; instead it creates |
| 271 |
its own stack by steam using pcre_recurse_malloc() to obtain memory |
its own stack by steam using pcre_recurse_malloc() to obtain memory |
| 272 |
from the heap. For more detail, see the comments and other stuff |
from the heap. For more detail, see the comments and other stuff |
| 276 |
fi |
fi |
| 277 |
|
|
| 278 |
AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [ |
AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [ |
| 279 |
The value of NEWLINE determines the newline character. The default is |
The value of NEWLINE determines the newline character sequence. On |
| 280 |
to leave it up to the compiler, but some sites want to force a |
Unix-like systems, "configure" can be used to override the default, |
| 281 |
particular value. On Unix-like systems, "configure" can be used to |
which is 10. The possible values are 10 (LF), 13 (CR), 3338 (CRLF), |
| 282 |
override this default.]) |
or -1 (ANY).]) |
| 283 |
|
|
| 284 |
AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [ |
AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [ |
| 285 |
The value of LINK_SIZE determines the number of bytes used to store |
The value of LINK_SIZE determines the number of bytes used to store |
| 303 |
AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [ |
AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [ |
| 304 |
The value of MATCH_LIMIT determines the default number of times the |
The value of MATCH_LIMIT determines the default number of times the |
| 305 |
internal match() function can be called during a single execution of |
internal match() function can be called during a single execution of |
| 306 |
pcre_exec(). There is a runtime interface for setting a different |
pcre_exec(). There is a runtime interface for setting a different |
| 307 |
limit. The limit exists in order to catch runaway regular |
limit. The limit exists in order to catch runaway regular |
| 308 |
expressions that take for ever to determine that they do not match. |
expressions that take for ever to determine that they do not match. |
| 309 |
The default is set very large so that it does not accidentally catch |
The default is set very large so that it does not accidentally catch |
| 318 |
NO_RECURSE is defined) that is used. The value of |
NO_RECURSE is defined) that is used. The value of |
| 319 |
MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To |
MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To |
| 320 |
have any useful effect, it must be less than the value of |
have any useful effect, it must be less than the value of |
| 321 |
MATCH_LIMIT. There is a runtime method for setting a different |
MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT. |
| 322 |
limit. On systems that support it, "configure" can be used to |
There is a runtime method for setting a different limit. On systems |
| 323 |
override this default default.]) |
that support it, "configure" can be used to override the default.]) |
| 324 |
|
|
| 325 |
AC_DEFINE([MAX_NAME_SIZE], [32], [ |
AC_DEFINE([MAX_NAME_SIZE], [32], [ |
| 326 |
This limit is parameterized just in case anybody ever wants to |
This limit is parameterized just in case anybody ever wants to |
| 356 |
"configure", this can be done via --enable-ebcdic.]) |
"configure", this can be done via --enable-ebcdic.]) |
| 357 |
fi |
fi |
| 358 |
|
|
|
# Here is where pcre specific substs are handled |
|
|
# These 3 are only used by RunTest.in. |
|
|
# TODO: remove once RunTest uses pcretest -C instead. |
|
|
AC_SUBST(LINK_SIZE, $with_link_size) |
|
|
AC_SUBST(UTF8, $enable_utf8) |
|
|
AC_SUBST(UCP, $enable_unicode_properties) |
|
|
|
|
| 359 |
# Platform specific issues |
# Platform specific issues |
| 360 |
NO_UNDEFINED= |
NO_UNDEFINED= |
| 361 |
EXPORT_ALL_SYMBOLS= |
EXPORT_ALL_SYMBOLS= |
| 403 |
|
|
| 404 |
AC_OUTPUT |
AC_OUTPUT |
| 405 |
|
|
| 406 |
|
# Make sure that pcre_chartables.c is removed in case the method for |
| 407 |
|
# creating it was changed by reconfiguration. |
| 408 |
|
|
| 409 |
|
rm -f pcre_chartables.c |
| 410 |
|
|
| 411 |
# Print out a nice little message after configure is run displaying your |
# Print out a nice little message after configure is run displaying your |
| 412 |
# chosen options. |
# chosen options. |
| 413 |
# |
# |
| 432 |
Unicode properties ..... : ${enable_unicode_properties} |
Unicode properties ..... : ${enable_unicode_properties} |
| 433 |
Newline char/sequence .. : ${enable_newline} |
Newline char/sequence .. : ${enable_newline} |
| 434 |
EBCDIC coding .......... : ${enable_ebcdic} |
EBCDIC coding .......... : ${enable_ebcdic} |
| 435 |
|
Rebuild char tables .... : ${enable_rebuild_chartables} |
| 436 |
Use stack recursion .... : ${enable_stack_for_recursion} |
Use stack recursion .... : ${enable_stack_for_recursion} |
| 437 |
POSIX mem threshold .... : ${with_posix_malloc_threshold} |
POSIX mem threshold .... : ${with_posix_malloc_threshold} |
| 438 |
Internal link size ..... : ${with_link_size} |
Internal link size ..... : ${with_link_size} |