Updated makefiles and autoconf macros for new pcre

master
Yevgen Muntyan 2006-07-27 06:07:38 -05:00
parent a9f10afca2
commit 8bc4c8afb5
8 changed files with 90 additions and 159 deletions

View File

@ -18,6 +18,7 @@ AM_CFLAGS = \
-I$(top_builddir)/$(MOO_SRC_PREFIX) \
-I$(top_srcdir)/$(MOO_SRC_PREFIX)/mooutils \
-I$(top_builddir)/$(MOO_SRC_PREFIX)/mooutils \
-I$(top_srcdir)/$(MOO_SRC_PREFIX)/mooutils/pcre \
$(MOO_CFLAGS) \
$(PYTHON_INCLUDES) \
$(PYGTK_CFLAGS) \

View File

@ -95,125 +95,54 @@ fi
## build pcre
##
if test x$MOO_BUILD_PCRE = xyes; then
dnl Provide the current PCRE version information. Do not use numbers
dnl with leading zeros for the minor version, as they end up in a C
dnl macro, and may be treated as octal constants. Stick to single
dnl digits for minor numbers less than 10. There are unlikely to be
dnl that many releases anyway.
PCRE_MAJOR=6
PCRE_MINOR=4
PCRE_DATE=05-Sep-2005
PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR}
AC_DEFINE([PCRE_MAJOR], $PCRE_MAJOR, [pcre library major version])
AC_DEFINE([PCRE_MINOR], $PCRE_MINOR, [pcre library minor version])
AC_DEFINE([PCRE_DATE], $PCRE_DATE, [pcre library release date])
dnl Default values for miscellaneous macros
AC_DEFINE(POSIX_MALLOC_THRESHOLD, 10, [POSIX_MALLOC_THRESHOLD])
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_FUNCS(bcopy memmove strerror)
AC_CHECK_TYPES([long long], [pcre_have_long_long="1"], [pcre_have_long_long="0"])
AC_CHECK_TYPES([unsigned long long], [pcre_have_ulong_long="1"], [pcre_have_ulong_long="0"])
AC_SUBST(pcre_have_long_long)
AC_SUBST(pcre_have_ulong_long)
AC_DEFINE(NEWLINE, '\n', [The value of NEWLINE determines the newline character used in pcre])
dnl Checks for library functions.
AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll)
dnl Handle --enable-utf8
AC_DEFINE(SUPPORT_UTF8, , [SUPPORT_UTF8])
# XXX
# dnl Handle --enable-unicode-properties
AC_DEFINE(SUPPORT_UCP, , [SUPPORT_UCP])
AC_DEFINE(PCRE_EXPORT, , [PCRE_EXPORT - empty since we do not need pcre api be exported])
# dnl Handle --enable-newline-is-cr
#
# AC_ARG_ENABLE(newline-is-cr,
# [ --enable-newline-is-cr use CR as the newline character],
# if test "$enableval" = "yes"; then
# NEWLINE=-DNEWLINE=13
# fi
# )
#
# dnl Handle --enable-newline-is-lf
#
# AC_ARG_ENABLE(newline-is-lf,
# [ --enable-newline-is-lf use LF as the newline character],
# if test "$enableval" = "yes"; then
# NEWLINE=-DNEWLINE=10
# fi
# )
AC_DEFINE(NEWLINE, '\n', [The value of NEWLINE determines the newline character])
# XXX
# dnl Handle --enable-ebcdic
#
# AC_ARG_ENABLE(ebcdic,
# [ --enable-ebcdic assume EBCDIC coding rather than ASCII],
# if test "$enableval" == "yes"; then
# EBCDIC=-DEBCDIC=1
# fi
# )
AC_DEFINE(EBCDIC, 0, [If you are compiling for a system that uses EBCDIC instead of ASCII dnl
character codes, define this macro as 1.])
# dnl Handle --disable-stack-for-recursion
#
# AC_ARG_ENABLE(stack-for-recursion,
# [ --disable-stack-for-recursion disable use of stack recursion when matching],
# if test "$enableval" = "no"; then
# NO_RECURSE=-DNO_RECURSE
# fi
# )
# dnl Handle --with-link-size=n
# AC_ARG_WITH(link-size,
# [ --with-link-size=2 internal link size (2, 3, or 4 allowed)],
# LINK_SIZE=-DLINK_SIZE=$withval
# )
AC_DEFINE(LINK_SIZE, 2, [The value of LINK_SIZE determines the number of bytes used to store dnl
links as offsets within the compiled regex. The default is 2, which allows for dnl
compiled patterns up to 64K long. This covers the vast majority of cases. dnl
However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows for dnl
longer patterns in extreme cases.])
AC_DEFINE(POSIX_MALLOC_THRESHOLD, 10, [POSIX_MALLOC_THRESHOLD])
# dnl Handle --with-match_limit=n
#
# AC_ARG_WITH(match-limit,
# [ --with-match-limit=10000000 default limit on internal looping)],
# MATCH_LIMIT=-DMATCH_LIMIT=$withval
# )
AC_DEFINE(MATCH_LIMIT, 10000000, [The value of MATCH_LIMIT determines the default number of times the match() dnl
function can be called during a single execution of pcre_exec(). (There is a dnl
runtime method of setting a different limit.) The limit exists in order to dnl
catch runaway regular expressions that take for ever to determine that they do dnl
not match. The default is set very large so that it does not accidentally catch dnl
legitimate cases.])
AC_DEFINE(MATCH_LIMIT_RECURSION, MATCH_LIMIT, [The above limit applies to all calls of match(), whether or not they
increase the recursion depth. In some environments it is desirable to limit the
depth of recursive calls of match() more strictly, in order to restrict the
maximum amount of stack (or heap, if NO_RECURSE is defined) that is used. The
value of MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
have any useful effect, it must be less than the value of MATCH_LIMIT. There is
a runtime method for setting a different limit. On systems that support it,
"configure" can be used to override this default default.])
AC_DEFINE(MAX_NAME_SIZE, 32, [These three limits are parameterized just in case anybody ever wants to
change them. Care must be taken if they are increased, because they guard
against integer overflow caused by enormously large patterns.])
AC_DEFINE(MAX_NAME_COUNT, 10000, [MAX_NAME_COUNT])
AC_DEFINE(MAX_DUPLENGTH, 30000, [MAX_DUPLENGTH])
AC_SUBST(PCRE_MAJOR)
AC_SUBST(PCRE_MINOR)
AC_SUBST(PCRE_DATE)
AC_SUBST(PCRE_VERSION)
AC_DEFINE(SUPPORT_UTF8, , [SUPPORT_UTF8])
AC_DEFINE(SUPPORT_UCP, , [SUPPORT_UCP])
dnl pcre does "#if !EBCDIC", not "#ifndef EBCDIC"
AC_DEFINE(EBCDIC, 0, [If you are compiling for a system that uses EBCDIC instead of ASCII dnl
character codes, define this macro as 1.])
# AC_ARG_ENABLE(stack-for-recursion,
# [ --disable-stack-for-recursion disable use of stack recursion when matching],
# if test "$enableval" = "no"; then
# NO_RECURSE=-DNO_RECURSE
# fi
# )
fi
]) # end of MOO_AC_PCRE

View File

@ -26,7 +26,7 @@
</ignoreparts>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description/>
<description></description>
<secondaryLanguages>
<language>C</language>
</secondaryLanguages>
@ -48,21 +48,21 @@
</run>
<configurations>
<debug>
<configargs>--enable-debug=full --enable-all-gcc-warnings --enable-printing --disable-static</configargs>
<configargs>--enable-debug --enable-all-gcc-warnings --enable-printing --disable-static --without-system-pcre</configargs>
<builddir>build/debug</builddir>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
<cflags>-O0 -g3</cflags>
<topsourcedir/>
<cppflags/>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<f77flags/>
<topsourcedir></topsourcedir>
<cppflags></cppflags>
<ccompilerbinary></ccompilerbinary>
<cxxcompilerbinary></cxxcompilerbinary>
<f77compilerbinary></f77compilerbinary>
<f77flags></f77flags>
<envvars/>
<ldflags/>
<cxxflags/>
<ldflags></ldflags>
<cxxflags></cxxflags>
</debug>
<gtk-print>
<configargs>--enable-debug --enable-all-gcc-warnings --without-python --prefix=/usr/local/gtk-print</configargs>
@ -221,15 +221,15 @@
</kdevautoproject>
<kdevdebugger>
<general>
<dbgshell/>
<dbgshell></dbgshell>
<programargs>--g-fatal-warnings -n</programargs>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>true</floatingtoolbar>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<gdbpath></gdbpath>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
</general>
<display>
<staticmembers>true</staticmembers>
@ -327,7 +327,7 @@
</codecompletion>
<references/>
<creategettersetter>
<prefixGet/>
<prefixGet></prefixGet>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>

View File

@ -8,27 +8,25 @@ moopcre_sources = \
$(moopcre)/pcre_chartables.c \
$(moopcre)/pcre_compile.c \
$(moopcre)/pcre_config.c \
$(moopcre)/pcre_dfa_exec.c \
$(moopcre)/pcre_exec.c \
$(moopcre)/pcre_fullinfo.c \
$(moopcre)/pcre_get.c \
$(moopcre)/pcre_globals.c \
$(moopcre)/pcre.h \
$(moopcre)/pcre_info.c \
$(moopcre)/pcre_internal.h \
$(moopcre)/pcre_maketables.c \
$(moopcre)/pcre_ord2utf8.c \
$(moopcre)/pcre_refcount.c \
$(moopcre)/pcre_study.c \
$(moopcre)/pcre_tables.c \
$(moopcre)/pcre_try_flipped.c \
$(moopcre)/pcre_ucp_findchar.c \
$(moopcre)/pcre_ucp_searchfuncs.c \
$(moopcre)/pcre_valid_utf8.c \
$(moopcre)/pcre_version.c \
$(moopcre)/pcre_xclass.c \
$(moopcre)/pcre.h \
$(moopcre)/ucp.h \
$(moopcre)/ucpinternal.h
if MOO_BUILD_PCRE
moo_sources += $(moopcre_sources)
else
@ -37,9 +35,8 @@ endif
moo_extra_dist += \
$(moopcre)/AUTHORS \
$(moopcre)/COPYING.pcre \
$(moopcre)/ChangeLog \
$(moopcre)/COPYING.pcre \
$(moopcre)/NEWS \
$(moopcre)/dftables.c \
$(moopcre)/pcre_printint.src \
$(moopcre)/ucptable.c
$(moopcre)/ucptable.c \
$(moopcre)/pcre_printint.src

View File

@ -49,6 +49,7 @@ supporting internal functions that are not used by other modules. */
/* When DEBUG is defined, we need the pcre_printint() function, which is also
used by pcretest. DEBUG is not defined when building a production library. */
#undef DEBUG
#ifdef DEBUG
#include "pcre_printint.src"
#endif
@ -291,7 +292,7 @@ static const unsigned char digitab[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 40 */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 72- | */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 50 */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 88- */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 88- */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 60 */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 104- ? */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 70 */
@ -325,7 +326,7 @@ static const unsigned char ebcdic_chartab[] = { /* chartable partial dup */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - 71 */
0x00,0x00,0x00,0x80,0x00,0x80,0x80,0x80, /* 72- | */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* & - 87 */
0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00, /* 88- */
0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00, /* 88- */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - -103 */
0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x80, /* 104- ? */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 112-119 */

View File

@ -150,6 +150,7 @@ typedef struct stateblock {
#define INTS_PER_STATEBLOCK (sizeof(stateblock)/sizeof(int))
#undef DEBUG
#ifdef DEBUG
/*************************************************
* Print character string *

View File

@ -81,6 +81,7 @@ static const char rep_max[] = { 0, 0, 0, 0, 1, 1 };
#undef DEBUG
#ifdef DEBUG
/*************************************************
* Debugging function to print chars *

View File

@ -47,6 +47,7 @@ functions whose names all begin with "_pcre_". */
/* Define DEBUG to get debugging output on stdout. */
#undef DEBUG
#if 0
#define DEBUG
#endif