if test "$PCRE_MINOR" = "08" -o "$PCRE_MINOR" = "09"
then
echo "***"
echo "*** Minor version number $PCRE_MINOR must not be used. ***"
echo "*** Use only 01 to 07 or 10 onwards, to avoid octal issues. ***"
echo "***"
exit 1
fi
AC_SUBST(PCRE_MAJOR)
AC_SUBST(PCRE_MINOR)
AC_SUBST(PCRE_PRERELEASE)
AC_SUBST(PCRE_DATE)
# Set a more sensible default value for $(htmldir).
if test "x$htmldir" = 'x${docdir}'
then
htmldir='${docdir}/html'
fi
# Handle --disable-pcre8 (enabled by default)
AC_ARG_ENABLE(pcre8,
AS_HELP_STRING([--disable-pcre8],
[disable 8 bit character support]),
, enable_pcre8=unset)
AC_SUBST(enable_pcre8)
# Handle --enable-pcre16 (disabled by default)
AC_ARG_ENABLE(pcre16,
AS_HELP_STRING([--enable-pcre16],
[enable 16 bit character support]),
, enable_pcre16=unset)
AC_SUBST(enable_pcre16)
# Handle --enable-pcre32 (disabled by default)
AC_ARG_ENABLE(pcre32,
AS_HELP_STRING([--enable-pcre32],
[enable 32 bit character support]),
, enable_pcre32=unset)
AC_SUBST(enable_pcre32)
# Handle --disable-cpp. The substitution of enable_cpp is needed for use in
# pcre-config.
AC_ARG_ENABLE(cpp,
AS_HELP_STRING([--disable-cpp],
[disable C++ support]),
, enable_cpp=unset)
AC_SUBST(enable_cpp)
# Handle --enable-jit (disabled by default)
AC_ARG_ENABLE(jit,
AS_HELP_STRING([--enable-jit],
[enable Just-In-Time compiling support]),
, enable_jit=no)
# Handle --disable-pcregrep-jit (enabled by default)
AC_ARG_ENABLE(pcregrep-jit,
AS_HELP_STRING([--disable-pcregrep-jit],
[disable JIT support in pcregrep]),
, enable_pcregrep_jit=yes)
# Handle --enable-rebuild-chartables
AC_ARG_ENABLE(rebuild-chartables,
AS_HELP_STRING([--enable-rebuild-chartables],
[rebuild character tables in current locale]),
, enable_rebuild_chartables=no)
# Handle --enable-utf8 (disabled by default)
AC_ARG_ENABLE(utf8,
AS_HELP_STRING([--enable-utf8],
[another name for --enable-utf. Kept only for compatibility reasons]),
, enable_utf8=unset)
# Handle --enable-utf (disabled by default)
AC_ARG_ENABLE(utf,
AS_HELP_STRING([--enable-utf],
[enable UTF-8/16/32 support (incompatible with --enable-ebcdic)]),
, enable_utf=unset)
# Handle --enable-unicode-properties
AC_ARG_ENABLE(unicode-properties,
AS_HELP_STRING([--enable-unicode-properties],
[enable Unicode properties support (implies --enable-utf)]),
, enable_unicode_properties=no)
# Handle newline options
ac_pcre_newline=lf
AC_ARG_ENABLE(newline-is-cr,
AS_HELP_STRING([--enable-newline-is-cr],
[use CR as newline character]),
ac_pcre_newline=cr)
AC_ARG_ENABLE(newline-is-lf,
AS_HELP_STRING([--enable-newline-is-lf],
[use LF as newline character (default)]),
ac_pcre_newline=lf)
AC_ARG_ENABLE(newline-is-crlf,
AS_HELP_STRING([--enable-newline-is-crlf],
[use CRLF as newline sequence]),
ac_pcre_newline=crlf)
AC_ARG_ENABLE(newline-is-anycrlf,
AS_HELP_STRING([--enable-newline-is-anycrlf],
[use CR, LF, or CRLF as newline sequence]),
ac_pcre_newline=anycrlf)
AC_ARG_ENABLE(newline-is-any,
AS_HELP_STRING([--enable-newline-is-any],
[use any valid Unicode newline sequence]),
ac_pcre_newline=any)
enable_newline="$ac_pcre_newline"
# Handle --enable-bsr-anycrlf
AC_ARG_ENABLE(bsr-anycrlf,
AS_HELP_STRING([--enable-bsr-anycrlf],
[\R matches only CR, LF, CRLF by default]),
, enable_bsr_anycrlf=no)
# Handle --enable-ebcdic
AC_ARG_ENABLE(ebcdic,
AS_HELP_STRING([--enable-ebcdic],
[assume EBCDIC coding rather than ASCII; incompatible with --enable-utf; use only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]),
, enable_ebcdic=no)
# Handle --enable-ebcdic-nl25
AC_ARG_ENABLE(ebcdic-nl25,
AS_HELP_STRING([--enable-ebcdic-nl25],
[set EBCDIC code for NL to 0x25 instead of 0x15; it implies --enable-ebcdic]),
, enable_ebcdic_nl25=no)
# Handle --disable-stack-for-recursion
AC_ARG_ENABLE(stack-for-recursion,
AS_HELP_STRING([--disable-stack-for-recursion],
[don't use stack recursion when matching]),
, enable_stack_for_recursion=yes)
# Handle --enable-pcregrep-libz
AC_ARG_ENABLE(pcregrep-libz,
AS_HELP_STRING([--enable-pcregrep-libz],
[link pcregrep with libz to handle .gz files]),
, enable_pcregrep_libz=no)
# Handle --enable-pcregrep-libbz2
AC_ARG_ENABLE(pcregrep-libbz2,
AS_HELP_STRING([--enable-pcregrep-libbz2],
[link pcregrep with libbz2 to handle .bz2 files]),
[internal link size (2, 3, or 4 allowed; default=2)]),
, with_link_size=2)
# Handle --with-parens-nest-limit=N
AC_ARG_WITH(parens-nest-limit,
AS_HELP_STRING([--with-parens-nest-limit=N],
[nested parentheses limit (default=250)]),
, with_parens_nest_limit=250)
# Handle --with-match-limit=N
AC_ARG_WITH(match-limit,
AS_HELP_STRING([--with-match-limit=N],
[default limit on internal looping (default=10000000)]),
, with_match_limit=10000000)
# Handle --with-match-limit_recursion=N
#
# Note: In config.h, the default is to define MATCH_LIMIT_RECURSION
# symbolically as MATCH_LIMIT, which in turn is defined to be some numeric
# value (e.g. 10000000). MATCH_LIMIT_RECURSION can otherwise be set to some
# different numeric value (or even the same numeric value as MATCH_LIMIT,
# though no longer defined in terms of the latter).
#
AC_ARG_WITH(match-limit-recursion,
AS_HELP_STRING([--with-match-limit-recursion=N],
[default limit on internal recursion (default=MATCH_LIMIT)]),
, with_match_limit_recursion=MATCH_LIMIT)
# Handle --enable-valgrind
AC_ARG_ENABLE(valgrind,
AS_HELP_STRING([--enable-valgrind],
[valgrind support]),
, enable_valgrind=no)
# Enable code coverage reports using gcov
AC_ARG_ENABLE(coverage,
AS_HELP_STRING([--enable-coverage],
[enable code coverage reports using gcov]),
, enable_coverage=no)
# Copy enable_utf8 value to enable_utf for compatibility reasons
if test "x$enable_utf8" != "xunset"
then
if test "x$enable_utf" != "xunset"
then
AC_MSG_ERROR([--enable/disable-utf8 is kept only for compatibility reasons and its value is copied to --enable/disable-utf. Newer code must use --enable/disable-utf alone.])
fi
enable_utf=$enable_utf8
fi
# Set the default value for pcre8
if test "x$enable_pcre8" = "xunset"
then
enable_pcre8=yes
fi
# Set the default value for pcre16
if test "x$enable_pcre16" = "xunset"
then
enable_pcre16=no
fi
# Set the default value for pcre32
if test "x$enable_pcre32" = "xunset"
then
enable_pcre32=no
fi
# Make sure enable_pcre8 or enable_pcre16 was set
if test "x$enable_pcre8$enable_pcre16$enable_pcre32" = "xnonono"
then
AC_MSG_ERROR([At least one of 8, 16 or 32 bit pcre library must be enabled])
fi
# Make sure that if enable_unicode_properties was set, that UTF support is enabled.
if test "x$enable_unicode_properties" = "xyes"
then
if test "x$enable_utf" = "xno"
then
AC_MSG_ERROR([support for Unicode properties requires UTF-8/16/32 support])
fi
enable_utf=yes
fi
# enable_utf is disabled by default.
if test "x$enable_utf" = "xunset"
then
enable_utf=no
fi
# enable_cpp copies the value of enable_pcre8 by default
if test "x$enable_cpp" = "xunset"
then
enable_cpp=$enable_pcre8
fi
# Make sure that if enable_cpp was set, that enable_pcre8 support is enabled
if test "x$enable_cpp" = "xyes"
then
if test "x$enable_pcre8" = "xno"
then
AC_MSG_ERROR([C++ library requires pcre library with 8 bit characters])
fi
fi
# Convert the newline identifier into the appropriate integer value. The first
# three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they
# are changed below.
case "$enable_newline" in
lf) ac_pcre_newline_value=10 ;;
cr) ac_pcre_newline_value=13 ;;
crlf) ac_pcre_newline_value=3338 ;;
anycrlf) ac_pcre_newline_value=-2 ;;
any) ac_pcre_newline_value=-1 ;;
*)
AC_MSG_ERROR([invalid argument \"$enable_newline\" to --enable-newline option])
;;
esac
# --enable-ebcdic-nl25 implies --enable-ebcdic
if test "x$enable_ebcdic_nl25" = "xyes"; then
enable_ebcdic=yes
fi
# Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled,
# and the newline value is adjusted appropriately (CR is still 13, but LF is
# 21 or 37). Also check that UTF support is not requested, because PCRE cannot
# handle EBCDIC and UTF in the same build. To do so it would need to use
# different character constants depending on the mode.
#
if test "x$enable_ebcdic" = "xyes"; then
enable_rebuild_chartables=yes
if test "x$enable_utf" = "xyes"; then
AC_MSG_ERROR([support for EBCDIC and UTF-8/16/32 cannot be enabled at the same time])
fi
if test "x$enable_ebcdic_nl25" = "xno"; then
case "$ac_pcre_newline_value" in
10) ac_pcre_newline_value=21 ;;
3338) ac_pcre_newline_value=3349 ;;
esac
else
case "$ac_pcre_newline_value" in
10) ac_pcre_newline_value=37 ;;
3338) ac_pcre_newline_value=3365 ;;
esac
fi
fi
# Check argument to --with-link-size
case "$with_link_size" in
2|3|4) ;;
*)
AC_MSG_ERROR([invalid argument \"$with_link_size\" to --with-link-size option])
;;
esac
AH_TOP([
/* PCRE is written in Standard C, but there are a few non-standard things it
can cope with, allowing it to run on SunOS4 and other "close to standard"
systems.
In environments that support the GNU autotools, config.h.in is converted into
config.h by the "configure" script. In environments that use CMake,
config-cmake.in is converted into config.h. If you are going to build PCRE "by
hand" without using "configure" or CMake, you should copy the distributed
config.h.generic to config.h, and edit the macro definitions to be the way you
need them. You must then add -DHAVE_CONFIG_H to all of your compile commands,
so that config.h is included at the start of every source.
Alternatively, you can avoid editing by using -D on the compiler command line
to set the macro values. In this case, you do not have to set -DHAVE_CONFIG_H,
but if you do, default values will be taken from config.h for non-boolean
macros that are not defined on the command line.
Boolean macros such as HAVE_STDLIB_H and SUPPORT_PCRE8 should either be defined
(conventionally to 1) for TRUE, and not defined at all for FALSE. All such
macros are listed as a commented #undef in config.h.generic. Macros such as
MATCH_LIMIT, whose actual value is relevant, have defaults defined, but are
surrounded by #ifndef/#endif lines so that the value can be overridden by -D.
PCRE uses memmove() if HAVE_MEMMOVE is defined; otherwise it uses bcopy() if
HAVE_BCOPY is defined. If your system has neither bcopy() nor memmove(), make
sure both macros are undefined; an emulation function will then be used. */])