--- code/trunk/configure.ac 2010/03/10 16:08:01 507 +++ code/trunk/configure.ac 2011/09/11 14:31:21 691 @@ -9,9 +9,9 @@ dnl be defined as -RC2, for example. For real releases, it should be empty. m4_define(pcre_major, [8]) -m4_define(pcre_minor, [02]) +m4_define(pcre_minor, [20]) m4_define(pcre_prerelease, [-RC1]) -m4_define(pcre_date, [2010-03-10]) +m4_define(pcre_date, [2011-09-12]) # Libtool shared library interface versions (current:revision:age) m4_define(libpcre_version, [0:1:0]) @@ -68,7 +68,7 @@ # AC_PROG_CXX will return "g++" even if no c++ compiler is installed. # Check for that case, and just disable c++ code if g++ doesn't run. AC_LANG_PUSH(C++) -AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[]),, CXX=""; CXXCP=""; CXXFLAGS="") +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],, CXX=""; CXXCP=""; CXXFLAGS="") AC_LANG_POP # Check for a 64-bit integer type @@ -76,7 +76,7 @@ AC_PROG_INSTALL AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL +LT_INIT AC_PROG_LN_S PCRE_MAJOR="pcre_major" @@ -112,6 +112,18 @@ , enable_cpp=yes) 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], @@ -190,6 +202,12 @@ [link pcregrep with libbz2 to handle .bz2 files]), , enable_pcregrep_libbz2=no) +# Handle --with-pcregrep-bufsize=N +AC_ARG_WITH(pcregrep-bufsize, + AS_HELP_STRING([--with-pcregrep-bufsize=N], + [pcregrep buffer size (default=20480)]), + , with_pcregrep_bufsize=20480) + # Handle --enable-pcretest-libreadline AC_ARG_ENABLE(pcretest-libreadline, AS_HELP_STRING([--enable-pcretest-libreadline], @@ -320,11 +338,11 @@ LDFLAGS="$OLD_LDFLAGS -Wl,$flag" # We try to run the linker with this new ld flag. If the link fails, # we give up and remove the new flag from LDFLAGS. - AC_LINK_IFELSE(AC_LANG_PROGRAM([namespace pcrecpp { + AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace pcrecpp { class RE { static int no_arg; }; int RE::no_arg; }], - []), + [])], [AC_MSG_RESULT([yes]); EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag"; break;], @@ -361,8 +379,8 @@ else include=stdlib.h fi - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <$include>], - [char* e; return $fn("100", &e, 10)]), + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$include>], + [char* e; return $fn("100", &e, 10)])], [AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1, [Define to 1 if you have `$fn'.]) @@ -394,6 +412,8 @@ # Conditional compilation AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes") AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes") +AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes") +AM_CONDITIONAL(WITH_UTF8, test "x$enable_utf8" = "xyes") # Checks for typedefs, structures, and compiler characteristics. @@ -434,11 +454,11 @@ AC_MSG_CHECKING([for libbz2]) OLD_LIBS="$LIBS" LIBS="$LIBS -lbz2" -AC_LINK_IFELSE( AC_LANG_PROGRAM([[ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_BZLIB_H #include #endif]], -[[return (int)BZ2_bzopen("conftest", "rb");]]), +[[return (int)BZ2_bzopen("conftest", "rb");]])], [AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;], AC_MSG_RESULT([no])) LIBS="$OLD_LIBS" @@ -462,6 +482,18 @@ # Here is where pcre specific defines are handled +if test "$enable_jit" = "yes"; then + AC_DEFINE([SUPPORT_JIT], [], [ + Define to enable support for Just-In-Time compiling.]) +else + enable_pcregrep_jit="no" +fi + +if test "$enable_pcregrep_jit" = "yes"; then + AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [ + Define to enable JIT support in pcregrep.]) +fi + if test "$enable_utf8" = "yes"; then AC_DEFINE([SUPPORT_UTF8], [], [ Define to enable support for the UTF-8 Unicode encoding. This will @@ -472,7 +504,7 @@ if test "$enable_unicode_properties" = "yes"; then AC_DEFINE([SUPPORT_UCP], [], [ - Define to enable support for Unicode properties]) + Define to enable support for Unicode properties.]) fi if test "$enable_stack_for_recursion" = "no"; then @@ -500,6 +532,18 @@ able to handle .bz2 files.]) fi +if test $with_pcregrep_bufsize -lt 8192 ; then + with_pcregrep_bufsize="8192" +fi + +AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [ + The value of PCREGREP_BUFSIZE determines the size of buffer used by + pcregrep to hold parts of the file it is searching. On systems that + support it, "configure" can be used to override the default, which is + 8192. This is also the minimum value. The actual amount of memory used by + pcregrep is three times this number, because it allows for the buffering of + "before" and "after" lines.]) + if test "$enable_pcretest_libreadline" = "yes"; then AC_DEFINE([SUPPORT_LIBREADLINE], [], [ Define to allow pcretest to be linked with libreadline.]) @@ -625,7 +669,7 @@ AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS) # When we run 'make distcheck', use these arguments. -DISTCHECK_CONFIGURE_FLAGS="--enable-cpp --enable-unicode-properties" +DISTCHECK_CONFIGURE_FLAGS="--enable-jit --enable-cpp --enable-unicode-properties" AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is @@ -713,6 +757,7 @@ Extra libraries ................. : ${LIBS} Build C++ library ............... : ${enable_cpp} + Enable JIT compiling support .... : ${enable_jit} Enable UTF-8 support ............ : ${enable_utf8} Unicode properties .............. : ${enable_unicode_properties} Newline char/sequence ........... : ${enable_newline} @@ -726,6 +771,8 @@ Match limit recursion ........... : ${with_match_limit_recursion} Build shared libs ............... : ${enable_shared} Build static libs ............... : ${enable_static} + Use JIT in pcregrep ............. : ${enable_pcregrep_jit} + Buffer size for pcregrep ........ : ${with_pcregrep_bufsize} Link pcregrep with libz ......... : ${enable_pcregrep_libz} Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2} Link pcretest with libreadline .. : ${enable_pcretest_libreadline}