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

Diff of /code/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 708 by ph10, Fri Sep 23 11:03:03 2011 UTC revision 1055 by chpe, Tue Oct 16 15:53:30 2012 UTC
# Line 9  dnl The PCRE_PRERELEASE feature is for i Line 9  dnl The PCRE_PRERELEASE feature is for i
9  dnl be defined as -RC2, for example. For real releases, it should be empty.  dnl be defined as -RC2, for example. For real releases, it should be empty.
10    
11  m4_define(pcre_major, [8])  m4_define(pcre_major, [8])
12  m4_define(pcre_minor, [20])  m4_define(pcre_minor, [32])
13  m4_define(pcre_prerelease, [-RC2])  m4_define(pcre_prerelease, [-RC1])
14  m4_define(pcre_date, [2011-09-23])  m4_define(pcre_date, [2012-08-08])
15    
16    # NOTE: The CMakeLists.txt file searches for the above variables in the first
17    # 50 lines of this file. Please update that if the variables above are moved.
18    
19  # Libtool shared library interface versions (current:revision:age)  # Libtool shared library interface versions (current:revision:age)
20  m4_define(libpcre_version, [0:1:0])  m4_define(libpcre_version, [1:1:0])
21  m4_define(libpcreposix_version, [0:0:0])  m4_define(libpcre16_version, [0:1:0])
22    m4_define(libpcre32_version, [0:1:0])
23    m4_define(libpcreposix_version, [0:1:0])
24  m4_define(libpcrecpp_version, [0:0:0])  m4_define(libpcrecpp_version, [0:0:0])
25    
26  AC_PREREQ(2.57)  AC_PREREQ(2.57)
27  AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)  AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)
28  AC_CONFIG_SRCDIR([pcre.h.in])  AC_CONFIG_SRCDIR([pcre.h.in])
29  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
30    m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31  AC_CONFIG_HEADERS(config.h)  AC_CONFIG_HEADERS(config.h)
32    
33  # This was added at the suggestion of libtoolize (03-Jan-10)  # This was added at the suggestion of libtoolize (03-Jan-10)
# Line 104  then Line 110  then
110    htmldir='${docdir}/html'    htmldir='${docdir}/html'
111  fi  fi
112    
113    # Handle --disable-pcre8 (enabled by default)
114    AC_ARG_ENABLE(pcre8,
115                  AS_HELP_STRING([--disable-pcre8],
116                                 [disable 8 bit character support]),
117                  , enable_pcre8=unset)
118    AC_SUBST(enable_pcre8)
119    
120    # Handle --enable-pcre16 (disabled by default)
121    AC_ARG_ENABLE(pcre16,
122                  AS_HELP_STRING([--enable-pcre16],
123                                 [enable 16 bit character support]),
124                  , enable_pcre16=unset)
125    AC_SUBST(enable_pcre16)
126    
127    # Handle --enable-pcre32 (disabled by default)
128    AC_ARG_ENABLE(pcre32,
129                  AS_HELP_STRING([--enable-pcre32],
130                                 [enable 32 bit character support]),
131                  , enable_pcre32=unset)
132    AC_SUBST(enable_pcre32)
133    
134  # Handle --disable-cpp. The substitution of enable_cpp is needed for use in  # Handle --disable-cpp. The substitution of enable_cpp is needed for use in
135  # pcre-config.  # pcre-config.
136  AC_ARG_ENABLE(cpp,  AC_ARG_ENABLE(cpp,
137                AS_HELP_STRING([--disable-cpp],                AS_HELP_STRING([--disable-cpp],
138                               [disable C++ support]),                               [disable C++ support]),
139                , enable_cpp=yes)                , enable_cpp=unset)
140  AC_SUBST(enable_cpp)  AC_SUBST(enable_cpp)
141    
142  # Handle --enable-jit (disabled by default)  # Handle --enable-jit (disabled by default)
# Line 133  AC_ARG_ENABLE(rebuild-chartables, Line 160  AC_ARG_ENABLE(rebuild-chartables,
160  # Handle --enable-utf8 (disabled by default)  # Handle --enable-utf8 (disabled by default)
161  AC_ARG_ENABLE(utf8,  AC_ARG_ENABLE(utf8,
162                AS_HELP_STRING([--enable-utf8],                AS_HELP_STRING([--enable-utf8],
163                               [enable UTF-8 support (incompatible with --enable-ebcdic)]),                               [another name for --enable-utf. Kept only for compatibility reasons]),
164                , enable_utf8=unset)                , enable_utf8=unset)
165    
166    # Handle --enable-utf (disabled by default)
167    AC_ARG_ENABLE(utf,
168                  AS_HELP_STRING([--enable-utf],
169                                 [enable UTF-8/16/32 support (incompatible with --enable-ebcdic)]),
170                  , enable_utf=unset)
171    
172  # Handle --enable-unicode-properties  # Handle --enable-unicode-properties
173  AC_ARG_ENABLE(unicode-properties,  AC_ARG_ENABLE(unicode-properties,
174                AS_HELP_STRING([--enable-unicode-properties],                AS_HELP_STRING([--enable-unicode-properties],
175                               [enable Unicode properties support (implies --enable-utf8)]),                               [enable Unicode properties support (implies --enable-utf)]),
176                , enable_unicode_properties=no)                , enable_unicode_properties=no)
177    
178  # Handle --enable-newline=NL  # Handle newline options
 dnl AC_ARG_ENABLE(newline,  
 dnl               AS_HELP_STRING([--enable-newline=NL],  
 dnl                              [use NL as newline (lf, cr, crlf, anycrlf, any; default=lf)]),  
 dnl               , enable_newline=lf)  
   
 # Separate newline options  
179  ac_pcre_newline=lf  ac_pcre_newline=lf
180  AC_ARG_ENABLE(newline-is-cr,  AC_ARG_ENABLE(newline-is-cr,
181                AS_HELP_STRING([--enable-newline-is-cr],                AS_HELP_STRING([--enable-newline-is-cr],
# Line 181  AC_ARG_ENABLE(bsr-anycrlf, Line 208  AC_ARG_ENABLE(bsr-anycrlf,
208  # Handle --enable-ebcdic  # Handle --enable-ebcdic
209  AC_ARG_ENABLE(ebcdic,  AC_ARG_ENABLE(ebcdic,
210                AS_HELP_STRING([--enable-ebcdic],                AS_HELP_STRING([--enable-ebcdic],
211                               [assume EBCDIC coding rather than ASCII; incompatible with --enable-utf8; use only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]),                               [assume EBCDIC coding rather than ASCII; incompatible with --enable-utf; use only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]),
212                , enable_ebcdic=no)                , enable_ebcdic=no)
213    
214    # Handle --enable-ebcdic-nl25
215    AC_ARG_ENABLE(ebcdic-nl25,
216                  AS_HELP_STRING([--enable-ebcdic-nl25],
217                                 [set EBCDIC code for NL to 0x25 instead of 0x15; it implies --enable-ebcdic]),
218                  , enable_ebcdic_nl25=no)
219    
220  # Handle --disable-stack-for-recursion  # Handle --disable-stack-for-recursion
221  AC_ARG_ENABLE(stack-for-recursion,  AC_ARG_ENABLE(stack-for-recursion,
222                AS_HELP_STRING([--disable-stack-for-recursion],                AS_HELP_STRING([--disable-stack-for-recursion],
# Line 208  AC_ARG_WITH(pcregrep-bufsize, Line 241  AC_ARG_WITH(pcregrep-bufsize,
241                               [pcregrep buffer size (default=20480)]),                               [pcregrep buffer size (default=20480)]),
242                , with_pcregrep_bufsize=20480)                , with_pcregrep_bufsize=20480)
243    
244    # Handle --enable-pcretest-libedit
245    AC_ARG_ENABLE(pcretest-libedit,
246                  AS_HELP_STRING([--enable-pcretest-libedit],
247                                 [link pcretest with libedit]),
248                  , enable_pcretest_libedit=no)
249    
250  # Handle --enable-pcretest-libreadline  # Handle --enable-pcretest-libreadline
251  AC_ARG_ENABLE(pcretest-libreadline,  AC_ARG_ENABLE(pcretest-libreadline,
252                AS_HELP_STRING([--enable-pcretest-libreadline],                AS_HELP_STRING([--enable-pcretest-libreadline],
# Line 245  AC_ARG_WITH(match-limit-recursion, Line 284  AC_ARG_WITH(match-limit-recursion,
284                             [default limit on internal recursion (default=MATCH_LIMIT)]),                             [default limit on internal recursion (default=MATCH_LIMIT)]),
285              , with_match_limit_recursion=MATCH_LIMIT)              , with_match_limit_recursion=MATCH_LIMIT)
286    
287  # Make sure that if enable_unicode_properties was set, that UTF-8 support  # Copy enable_utf8 value to enable_utf for compatibility reasons
288  # is enabled.  if test "x$enable_utf8" != "xunset"
289  #  then
290      if test "x$enable_utf" != "xunset"
291      then
292        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.])
293      fi
294      enable_utf=$enable_utf8
295    fi
296    
297    # Set the default value for pcre8
298    if test "x$enable_pcre8" = "xunset"
299    then
300      enable_pcre8=yes
301    fi
302    
303    # Set the default value for pcre16
304    if test "x$enable_pcre16" = "xunset"
305    then
306      enable_pcre16=no
307    fi
308    
309    # Set the default value for pcre32
310    if test "x$enable_pcre32" = "xunset"
311    then
312      enable_pcre32=no
313    fi
314    
315    # Make sure enable_pcre8 or enable_pcre16 was set
316    if test "x$enable_pcre8$enable_pcre16$enable_pcre32" = "xnonono"
317    then
318      AC_MSG_ERROR([At least one of 8, 16 or 32 bit pcre library must be enabled])
319    fi
320    
321    # Make sure that if enable_unicode_properties was set, that UTF support is enabled.
322  if test "x$enable_unicode_properties" = "xyes"  if test "x$enable_unicode_properties" = "xyes"
323  then  then
324    if test "x$enable_utf8" = "xno"    if test "x$enable_utf" = "xno"
325    then    then
326      AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])      AC_MSG_ERROR([support for Unicode properties requires UTF-8/16/32 support])
327    fi    fi
328    enable_utf8=yes    enable_utf=yes
329  fi  fi
330    
331  if test "x$enable_utf8" = "xunset"  # enable_utf is disabled by default.
332    if test "x$enable_utf" = "xunset"
333  then  then
334    enable_utf8=no    enable_utf=no
335  fi  fi
336    
337  # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.  # enable_cpp copies the value of enable_pcre8 by default
338  # Also check that UTF-8 support is not requested, because PCRE cannot handle  if test "x$enable_cpp" = "xunset"
 # EBCDIC and UTF-8 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"  
339  then  then
340    enable_rebuild_chartables=yes    enable_cpp=$enable_pcre8
341    if test "x$enable_utf8" = "xyes"  fi
342    
343    # Make sure that if enable_cpp was set, that enable_pcre8 support is enabled
344    if test "x$enable_cpp" = "xyes"
345    then
346      if test "x$enable_pcre8" = "xno"
347    then    then
348      AC_MSG_ERROR([support for EBCDIC and UTF-8 cannot be enabled at the same time])      AC_MSG_ERROR([C++ library requires pcre library with 8 bit characters])
349    fi    fi
350  fi  fi
351    
352  # Convert the newline identifier into the appropriate integer value.  # Convert the newline identifier into the appropriate integer value. The first
353    # three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they
354    # are changed below.
355    
356  case "$enable_newline" in  case "$enable_newline" in
357    lf)      ac_pcre_newline_value=10   ;;    lf)      ac_pcre_newline_value=10   ;;
358    cr)      ac_pcre_newline_value=13   ;;    cr)      ac_pcre_newline_value=13   ;;
# Line 288  case "$enable_newline" in Line 364  case "$enable_newline" in
364    ;;    ;;
365  esac  esac
366    
367    # --enable-ebcdic-nl25 implies --enable-ebcdic
368    if test "x$enable_ebcdic_nl25" = "xyes"; then
369      enable_ebcdic=yes
370    fi
371    
372    # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled,
373    # and the newline value is adjusted appropriately (CR is still 13, but LF is
374    # 21 or 37). Also check that UTF support is not requested, because PCRE cannot
375    # handle EBCDIC and UTF in the same build. To do so it would need to use
376    # different character constants depending on the mode.
377    #
378    if test "x$enable_ebcdic" = "xyes"; then
379      enable_rebuild_chartables=yes
380    
381      if test "x$enable_utf" = "xyes"; then
382        AC_MSG_ERROR([support for EBCDIC and UTF-8/16/32 cannot be enabled at the same time])
383      fi
384    
385      if test "x$enable_ebcdic_nl25" = "xno"; then
386        case "$ac_pcre_newline_value" in
387          10)   ac_pcre_newline_value=21 ;;
388          3338) ac_pcre_newline_value=3349 ;;
389        esac
390      else
391        case "$ac_pcre_newline_value" in
392          10)   ac_pcre_newline_value=37 ;;
393          3338) ac_pcre_newline_value=3365 ;;
394        esac
395      fi
396    fi
397    
398  # Check argument to --with-link-size  # Check argument to --with-link-size
399  case "$with_link_size" in  case "$with_link_size" in
400    2|3|4) ;;    2|3|4) ;;
# Line 297  case "$with_link_size" in Line 404  case "$with_link_size" in
404  esac  esac
405    
406  AH_TOP([  AH_TOP([
407  /* On Unix-like systems config.h.in is converted by "configure" into config.h.  /* PCRE is written in Standard C, but there are a few non-standard things it
408  Some other environments also support the use of "configure". PCRE is written in  can cope with, allowing it to run on SunOS4 and other "close to standard"
409  Standard C, but there are a few non-standard things it can cope with, allowing  systems.
410  it to run on SunOS4 and other "close to standard" systems.  
411    In environments that support the facilities, config.h.in is converted by
412  If you are going to build PCRE "by hand" on a system without "configure" you  "configure", or config-cmake.h.in is converted by CMake, into config.h. If you
413  should copy the distributed config.h.generic to config.h, and then set up the  are going to build PCRE "by hand" without using "configure" or CMake, you
414  macro definitions the way you need them. You must then add -DHAVE_CONFIG_H to  should copy the distributed config.h.generic to config.h, and then edit the
415  all of your compile commands, so that config.h is included at the start of  macro definitions to be the way you need them. You must then add
416  every source.  -DHAVE_CONFIG_H to all of your compile commands, so that config.h is included
417    at the start of every source.
418    
419  Alternatively, you can avoid editing by using -D on the compiler command line  Alternatively, you can avoid editing by using -D on the compiler command line
420  to set the macro values. In this case, you do not have to set -DHAVE_CONFIG_H.  to set the macro values. In this case, you do not have to set -DHAVE_CONFIG_H.
# Line 410  AC_SUBST(pcre_have_type_traits) Line 518  AC_SUBST(pcre_have_type_traits)
518  AC_SUBST(pcre_have_bits_type_traits)  AC_SUBST(pcre_have_bits_type_traits)
519    
520  # Conditional compilation  # Conditional compilation
521    AM_CONDITIONAL(WITH_PCRE8, test "x$enable_pcre8" = "xyes")
522    AM_CONDITIONAL(WITH_PCRE16, test "x$enable_pcre16" = "xyes")
523    AM_CONDITIONAL(WITH_PCRE32, test "x$enable_pcre32" = "xyes")
524  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
525  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
526  AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")  AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
527  AM_CONDITIONAL(WITH_UTF8, test "x$enable_utf8" = "xyes")  AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")
528    
529  # Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
530    
# Line 465  LIBS="$OLD_LIBS" Line 576  LIBS="$OLD_LIBS"
576    
577  # Check for the availabiity of libreadline  # Check for the availabiity of libreadline
578    
579  AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])  if test "$enable_pcretest_libreadline" = "yes"; then
580  AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])   AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
581  AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1])   AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
582     AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"],
583       [unset ac_cv_lib_readline_readline;
584        AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"],
585         [unset ac_cv_lib_readline_readline;
586          AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"],
587           [unset ac_cv_lib_readline_readline;
588            AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"],
589             [unset ac_cv_lib_readline_readline;
590              AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"],
591               [unset ac_cv_lib_readline_readline;
592                AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"],
593                 [LIBREADLINE=""],
594                 [-ltermcap])],
595               [-lncursesw])],
596             [-lncurses])],
597           [-lcurses])],
598         [-ltinfo])])
599     AC_SUBST(LIBREADLINE)
600     if test -n "$LIBREADLINE"; then
601       if test "$LIBREADLINE" != "-lreadline"; then
602         echo "-lreadline needs $LIBREADLINE"
603         LIBREADLINE="-lreadline $LIBREADLINE"
604       fi
605     fi
606    fi
607    
608    
609    # Check for the availability of libedit. Different distributions put its
610    # headers in different places. Try to cover the most common ones.
611    
612    if test "$enable_pcretest_libedit" = "yes"; then
613      AC_CHECK_HEADERS([editline/readline.h], [HAVE_EDITLINE_READLINE_H=1],
614        [AC_CHECK_HEADERS([edit/readline/readline.h], [HAVE_READLINE_READLINE_H=1],
615          [AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_READLINE_H=1])])])
616      AC_CHECK_LIB([edit], [readline], [LIBEDIT="-ledit"])
617    fi
618    
619  # This facilitates -ansi builds under Linux  # This facilitates -ansi builds under Linux
620  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
# Line 475  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable Line 622  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable
622  PCRE_STATIC_CFLAG=""  PCRE_STATIC_CFLAG=""
623  if test "x$enable_shared" = "xno" ; then  if test "x$enable_shared" = "xno" ; then
624    AC_DEFINE([PCRE_STATIC], [1], [    AC_DEFINE([PCRE_STATIC], [1], [
625      Define if linking statically (TODO: make nice with Libtool)])      Define to any value if linking statically (TODO: make nice with Libtool)])
626    PCRE_STATIC_CFLAG="-DPCRE_STATIC"    PCRE_STATIC_CFLAG="-DPCRE_STATIC"
627  fi  fi
628  AC_SUBST(PCRE_STATIC_CFLAG)  AC_SUBST(PCRE_STATIC_CFLAG)
629    
630  # Here is where pcre specific defines are handled  # Here is where pcre specific defines are handled
631    
632    if test "$enable_pcre8" = "yes"; then
633      AC_DEFINE([SUPPORT_PCRE8], [], [
634        Define to any value to enable the 8 bit PCRE library.])
635    fi
636    
637    if test "$enable_pcre16" = "yes"; then
638      AC_DEFINE([SUPPORT_PCRE16], [], [
639        Define to any value to enable the 16 bit PCRE library.])
640    fi
641    
642    if test "$enable_pcre32" = "yes"; then
643      AC_DEFINE([SUPPORT_PCRE32], [], [
644        Define to any value to enable the 32 bit PCRE library.])
645    fi
646    
647  if test "$enable_jit" = "yes"; then  if test "$enable_jit" = "yes"; then
648      AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])])
649      CC="$PTHREAD_CC"
650      CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
651      LIBS="$PTHREAD_LIBS $LIBS"
652    AC_DEFINE([SUPPORT_JIT], [], [    AC_DEFINE([SUPPORT_JIT], [], [
653      Define to enable support for Just-In-Time compiling.])      Define to any value to enable support for Just-In-Time compiling.])
654  else  else
655    enable_pcregrep_jit="no"    enable_pcregrep_jit="no"
656  fi  fi
657    
658  if test "$enable_pcregrep_jit" = "yes"; then  if test "$enable_pcregrep_jit" = "yes"; then
659    AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [    AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [
660      Define to enable JIT support in pcregrep.])      Define to any value to enable JIT support in pcregrep.])
661  fi  fi
662    
663  if test "$enable_utf8" = "yes"; then  if test "$enable_utf" = "yes"; then
664    AC_DEFINE([SUPPORT_UTF8], [], [    AC_DEFINE([SUPPORT_UTF], [], [
665      Define to enable support for the UTF-8 Unicode encoding. This will      Define to any value to enable support for the UTF-8/16/32 Unicode encoding.
666      work even in an EBCDIC environment, but it is incompatible with      This will work even in an EBCDIC environment, but it is incompatible
667      the EBCDIC macro. That is, PCRE can support *either* EBCDIC code      with the EBCDIC macro. That is, PCRE can support *either* EBCDIC
668      *or* ASCII/UTF-8, but not both at once.])      code *or* ASCII/UTF-8/16/32, but not both at once.])
669  fi  fi
670    
671  if test "$enable_unicode_properties" = "yes"; then  if test "$enable_unicode_properties" = "yes"; then
672    AC_DEFINE([SUPPORT_UCP], [], [    AC_DEFINE([SUPPORT_UCP], [], [
673      Define to enable support for Unicode properties.])      Define to any value to enable support for Unicode properties.])
674  fi  fi
675    
676  if test "$enable_stack_for_recursion" = "no"; then  if test "$enable_stack_for_recursion" = "no"; then
677    AC_DEFINE([NO_RECURSE], [], [    AC_DEFINE([NO_RECURSE], [], [
678      PCRE uses recursive function calls to handle backtracking while      PCRE uses recursive function calls to handle backtracking while
679      matching. This can sometimes be a problem on systems that have      matching. This can sometimes be a problem on systems that have
680      stacks of limited size. Define NO_RECURSE to get a version that      stacks of limited size. Define NO_RECURSE to any value to get a
681      doesn't use recursion in the match() function; instead it creates      version that doesn't use recursion in the match() function; instead
682      its own stack by steam using pcre_recurse_malloc() to obtain memory      it creates its own stack by steam using pcre_recurse_malloc() to obtain
683      from the heap. For more detail, see the comments and other stuff      memory from the heap. For more detail, see the comments and other stuff
684      just above the match() function. On systems that support it,      just above the match() function.])
     "configure" can be used to set this in the Makefile  
     (use --disable-stack-for-recursion).])  
685  fi  fi
686    
687  if test "$enable_pcregrep_libz" = "yes"; then  if test "$enable_pcregrep_libz" = "yes"; then
688    AC_DEFINE([SUPPORT_LIBZ], [], [    AC_DEFINE([SUPPORT_LIBZ], [], [
689      Define to allow pcregrep to be linked with libz, so that it is      Define to any value to allow pcregrep to be linked with libz, so that it is
690      able to handle .gz files.])      able to handle .gz files.])
691  fi  fi
692    
693  if test "$enable_pcregrep_libbz2" = "yes"; then  if test "$enable_pcregrep_libbz2" = "yes"; then
694    AC_DEFINE([SUPPORT_LIBBZ2], [], [    AC_DEFINE([SUPPORT_LIBBZ2], [], [
695      Define to allow pcregrep to be linked with libbz2, so that it is      Define to any value to allow pcregrep to be linked with libbz2, so that it
696      able to handle .bz2 files.])      is able to handle .bz2 files.])
697  fi  fi
698    
699  if test $with_pcregrep_bufsize -lt 8192 ; then  if test $with_pcregrep_bufsize -lt 8192 ; then
# Line 537  if test $with_pcregrep_bufsize -lt 8192 Line 701  if test $with_pcregrep_bufsize -lt 8192
701  fi  fi
702    
703  AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [  AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [
704    The value of PCREGREP_BUFSIZE determines the size of buffer used by    The value of PCREGREP_BUFSIZE determines the size of buffer used by pcregrep
705    pcregrep to hold parts of the file it is searching. On systems that    to hold parts of the file it is searching. This is also the minimum value.
706    support it, "configure" can be used to override the default, which is    The actual amount of memory used by pcregrep is three times this number,
707    8192. This is also the minimum value. The actual amount of memory used by    because it allows for the buffering of "before" and "after" lines.])
708    pcregrep is three times this number, because it allows for the buffering of  
709    "before" and "after" lines.])  if test "$enable_pcretest_libedit" = "yes"; then
710      AC_DEFINE([SUPPORT_LIBEDIT], [], [
711  if test "$enable_pcretest_libreadline" = "yes"; then      Define to any value to allow pcretest to be linked with libedit.])
712      LIBREADLINE="$LIBEDIT"
713    elif test "$enable_pcretest_libreadline" = "yes"; then
714    AC_DEFINE([SUPPORT_LIBREADLINE], [], [    AC_DEFINE([SUPPORT_LIBREADLINE], [], [
715      Define to allow pcretest to be linked with libreadline.])      Define to any value to allow pcretest to be linked with libreadline.])
716  fi  fi
717    
718  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
719    The value of NEWLINE determines the newline character sequence. On    The value of NEWLINE determines the default newline character sequence. PCRE
720    systems that support it, "configure" can be used to override the    client programs can override this by selecting other values at run time. In
721    default, which is 10. The possible values are 10 (LF), 13 (CR),    ASCII environments, the value can be 10 (LF), 13 (CR), or 3338 (CRLF); in
722    3338 (CRLF), -1 (ANY), or -2 (ANYCRLF).])    EBCDIC environments the value can be 21 or 37 (LF), 13 (CR), or 3349 or 3365
723      (CRLF) because there are two alternative codepoints (0x15 and 0x25) that are
724      used as the NL line terminator that is equivalent to ASCII LF. In both ASCII
725      and EBCDIC environments the value can also be -1 (ANY), or -2 (ANYCRLF).])
726    
727  if test "$enable_bsr_anycrlf" = "yes"; then  if test "$enable_bsr_anycrlf" = "yes"; then
728    AC_DEFINE([BSR_ANYCRLF], [], [    AC_DEFINE([BSR_ANYCRLF], [], [
729      By default, the \R escape sequence matches any Unicode line ending      By default, the \R escape sequence matches any Unicode line ending
730      character or sequence of characters. If BSR_ANYCRLF is defined, this is      character or sequence of characters. If BSR_ANYCRLF is defined (to any
731      changed so that backslash-R matches only CR, LF, or CRLF. The build-      value), this is changed so that backslash-R matches only CR, LF, or CRLF.
732      time default can be overridden by the user of PCRE at runtime. On      The build-time default can be overridden by the user of PCRE at runtime.])
     systems that support it, "configure" can be used to override the  
     default.])  
733  fi  fi
734    
735  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [
# Line 570  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_l Line 737  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_l
737    links as offsets within the compiled regex. The default is 2, which    links as offsets within the compiled regex. The default is 2, which
738    allows for compiled patterns up to 64K long. This covers the vast    allows for compiled patterns up to 64K long. This covers the vast
739    majority of cases. However, PCRE can also be compiled to use 3 or 4    majority of cases. However, PCRE can also be compiled to use 3 or 4
740    bytes instead. This allows for longer patterns in extreme cases. On    bytes instead. This allows for longer patterns in extreme cases.])
   systems that support it, "configure" can be used to override this default.])  
741    
742  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [
743    When calling PCRE via the POSIX interface, additional working storage    When calling PCRE via the POSIX interface, additional working storage
# Line 580  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHO Line 746  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHO
746    interface provides only two. If the number of expected substrings is    interface provides only two. If the number of expected substrings is
747    small, the wrapper function uses space on the stack, because this is    small, the wrapper function uses space on the stack, because this is
748    faster than using malloc() for each call. The threshold above which    faster than using malloc() for each call. The threshold above which
749    the stack is no longer used is defined by POSIX_MALLOC_THRESHOLD. On    the stack is no longer used is defined by POSIX_MALLOC_THRESHOLD.])
   systems that support it, "configure" can be used to override this  
   default.])  
750    
751  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [
752    The value of MATCH_LIMIT determines the default number of times the    The value of MATCH_LIMIT determines the default number of times the
# Line 591  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with Line 755  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with
755    limit. The limit exists in order to catch runaway regular    limit. The limit exists in order to catch runaway regular
756    expressions that take for ever to determine that they do not match.    expressions that take for ever to determine that they do not match.
757    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
758    legitimate cases. On systems that support it, "configure" can be    legitimate cases.])
   used to override this default default.])  
759    
760  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [
761    The above limit applies to all calls of match(), whether or not they    The above limit applies to all calls of match(), whether or not they
# Line 603  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSIO Line 766  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSIO
766    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
767    have any useful effect, it must be less than the value of    have any useful effect, it must be less than the value of
768    MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT.    MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT.
769    There is a runtime method for setting a different limit. On systems    There is a runtime method for setting a different limit.])
   that support it, "configure" can be used to override the default.])  
770    
771  AC_DEFINE([MAX_NAME_SIZE], [32], [  AC_DEFINE([MAX_NAME_SIZE], [32], [
772    This limit is parameterized just in case anybody ever wants to    This limit is parameterized just in case anybody ever wants to
# Line 620  AH_VERBATIM([PCRE_EXP_DEFN], [ Line 782  AH_VERBATIM([PCRE_EXP_DEFN], [
782  /* If you are compiling for a system other than a Unix-like system or  /* If you are compiling for a system other than a Unix-like system or
783     Win32, and it needs some magic to be inserted before the definition     Win32, and it needs some magic to be inserted before the definition
784     of a function that is exported by the library, define this macro to     of a function that is exported by the library, define this macro to
785     contain the relevant magic. If you do not define this macro, it     contain the relevant magic. If you do not define this macro, a suitable
786     defaults to "extern" for a C compiler and "extern C" for a C++      __declspec value is used for Windows systems; in other environments
787     compiler on non-Win32 systems. This macro apears at the start of     "extern" is used for a C compiler and "extern C" for a C++ compiler.
788     every exported function that is part of the external API. It does     This macro apears at the start of every exported function that is part
789     not appear on functions that are "external" in the C sense, but     of the external API. It does not appear on functions that are "external"
790     which are internal to the library. */     in the C sense, but which are internal to the library. */
791  #undef PCRE_EXP_DEFN])  #undef PCRE_EXP_DEFN])
792    
793  if test "$enable_ebcdic" = "yes"; then  if test "$enable_ebcdic" = "yes"; then
794    AC_DEFINE_UNQUOTED([EBCDIC], [], [    AC_DEFINE_UNQUOTED([EBCDIC], [], [
795      If you are compiling for a system that uses EBCDIC instead of ASCII      If you are compiling for a system that uses EBCDIC instead of ASCII
796      character codes, define this macro as 1. On systems that can use      character codes, define this macro to any value. You must also edit the
797      "configure", this can be done via --enable-ebcdic. PCRE will then      NEWLINE macro below to set a suitable EBCDIC newline, commonly 21 (0x15).
798      assume that all input strings are in EBCDIC. If you do not define      On systems that can use "configure" or CMake to set EBCDIC, NEWLINE is
799      this macro, PCRE will assume input strings are ASCII or UTF-8 Unicode.      automatically adjusted. When EBCDIC is set, PCRE assumes that all input
800      It is not possible to build a version of PCRE that supports both      strings are in EBCDIC. If you do not define this macro, PCRE will assume
801      EBCDIC and UTF-8.])      input strings are ASCII or UTF-8/16/32 Unicode. It is not possible to build
802  fi      a version of PCRE that supports both EBCDIC and UTF-8/16/32.])
803    fi
804    
805    if test "$enable_ebcdic_nl25" = "yes"; then
806      AC_DEFINE_UNQUOTED([EBCDIC_NL25], [], [
807        In an EBCDIC environment, define this macro to any value to arrange for
808        the NL character to be 0x25 instead of the default 0x15. NL plays the role
809        that LF does in an ASCII/Unicode environment. The value must also be set in
810        the NEWLINE macro below. On systems that can use "configure" or CMake to
811        set EBCDIC_NL25, the adjustment of NEWLINE is automatic.])
812    fi
813    
814  # Platform specific issues  # Platform specific issues
815  NO_UNDEFINED=  NO_UNDEFINED=
# Line 657  esac Line 829  esac
829  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \
830                         $NO_UNDEFINED -version-info libpcre_version"                         $NO_UNDEFINED -version-info libpcre_version"
831    
832    EXTRA_LIBPCRE16_LDFLAGS="$EXTRA_LIBPCRE16_LDFLAGS \
833                           $NO_UNDEFINED -version-info libpcre16_version"
834    
835    EXTRA_LIBPCRE32_LDFLAGS="$EXTRA_LIBPCRE32_LDFLAGS \
836                           $NO_UNDEFINED -version-info libpcre32_version"
837    
838  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \
839                              $NO_UNDEFINED -version-info libpcreposix_version"                              $NO_UNDEFINED -version-info libpcreposix_version"
840    
# Line 665  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE Line 843  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE
843                            $EXPORT_ALL_SYMBOLS"                            $EXPORT_ALL_SYMBOLS"
844    
845  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
846    AC_SUBST(EXTRA_LIBPCRE16_LDFLAGS)
847    AC_SUBST(EXTRA_LIBPCRE32_LDFLAGS)
848  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
849  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
850    
851  # When we run 'make distcheck', use these arguments.  # When we run 'make distcheck', use these arguments. Turning off compiler
852  DISTCHECK_CONFIGURE_FLAGS="--enable-jit --enable-cpp --enable-unicode-properties"  # optimization makes it run faster.
853    DISTCHECK_CONFIGURE_FLAGS="CFLAGS='' CXXFLAGS='' --enable-pcre16 --enable-pcre32 --enable-jit --enable-cpp --enable-unicode-properties"
854  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
855    
856  # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is  # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
# Line 703  AC_SUBST(LIBBZ2) Line 884  AC_SUBST(LIBBZ2)
884    
885  # Similarly for --enable-pcretest-readline  # Similarly for --enable-pcretest-readline
886    
887    if test "$enable_pcretest_libedit" = "yes"; then
888      if test "$enable_pcretest_libreadline" = "yes"; then
889        echo "** Cannot use both --enable-pcretest-libedit and --enable-pcretest-readline"
890        exit 1
891      fi
892      if test "$HAVE_EDITLINE_READLINE_H" != "1" -a \
893              "$HAVE_READLINE_READLINE_H" != "1"; then
894        echo "** Cannot --enable-pcretest-libedit because neither editline/readline.h"
895        echo "** nor readline/readline.h was found."
896        exit 1
897      fi
898      if test -z "$LIBEDIT"; then
899        echo "** Cannot --enable-pcretest-libedit because libedit library was not found."
900        exit 1
901      fi
902    fi
903    
904  if test "$enable_pcretest_libreadline" = "yes"; then  if test "$enable_pcretest_libreadline" = "yes"; then
905    if test "$HAVE_READLINE_H" != "1"; then    if test "$HAVE_READLINE_H" != "1"; then
906      echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found."      echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found."
# Line 712  if test "$enable_pcretest_libreadline" = Line 910  if test "$enable_pcretest_libreadline" =
910      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
911      exit 1      exit 1
912    fi    fi
913    LIBREADLINE="-lreadline"    if test -z "$LIBREADLINE"; then
914        echo "** Cannot --enable-pcretest-readline because readline library was not found."
915        exit 1
916      fi
917  fi  fi
 AC_SUBST(LIBREADLINE)  
918    
919  # Produce these files, in addition to config.h.  # Produce these files, in addition to config.h.
920  AC_CONFIG_FILES(  AC_CONFIG_FILES(
921          Makefile          Makefile
922          libpcre.pc          libpcre.pc
923          libpcreposix.pc          libpcre16.pc
924            libpcre32.pc
925            libpcreposix.pc
926          libpcrecpp.pc          libpcrecpp.pc
927          pcre-config          pcre-config
928          pcre.h          pcre.h
# Line 737  AC_CONFIG_COMMANDS([delete-old-chartable Line 939  AC_CONFIG_COMMANDS([delete-old-chartable
939    
940  AC_OUTPUT  AC_OUTPUT
941    
942  # Print out a nice little message after configure is run displaying your  # Print out a nice little message after configure is run displaying the
943  # chosen options.  # chosen options.
944    
945    ebcdic_nl_code=n/a
946    if test "$enable_ebcdic_nl25" = "yes"; then
947      ebcdic_nl_code=0x25
948    elif test "$enable_ebcdic" = "yes"; then
949      ebcdic_nl_code=0x15
950    fi
951    
952  cat <<EOF  cat <<EOF
953    
954  $PACKAGE-$VERSION configuration summary:  $PACKAGE-$VERSION configuration summary:
# Line 756  $PACKAGE-$VERSION configuration summary: Line 965  $PACKAGE-$VERSION configuration summary:
965      Linker flags .................... : ${LDFLAGS}      Linker flags .................... : ${LDFLAGS}
966      Extra libraries ................. : ${LIBS}      Extra libraries ................. : ${LIBS}
967    
968        Build 8 bit pcre library ........ : ${enable_pcre8}
969        Build 16 bit pcre library ....... : ${enable_pcre16}
970        Build 32 bit pcre library ....... : ${enable_pcre32}
971      Build C++ library ............... : ${enable_cpp}      Build C++ library ............... : ${enable_cpp}
972      Enable JIT compiling support .... : ${enable_jit}      Enable JIT compiling support .... : ${enable_jit}
973      Enable UTF-8 support ............ : ${enable_utf8}      Enable UTF-8/16/32 support ...... : ${enable_utf}
974      Unicode properties .............. : ${enable_unicode_properties}      Unicode properties .............. : ${enable_unicode_properties}
975      Newline char/sequence ........... : ${enable_newline}      Newline char/sequence ........... : ${enable_newline}
976      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
977      EBCDIC coding ................... : ${enable_ebcdic}      EBCDIC coding ................... : ${enable_ebcdic}
978        EBCDIC code for NL .............. : ${ebcdic_nl_code}
979      Rebuild char tables ............. : ${enable_rebuild_chartables}      Rebuild char tables ............. : ${enable_rebuild_chartables}
980      Use stack recursion ............. : ${enable_stack_for_recursion}      Use stack recursion ............. : ${enable_stack_for_recursion}
981      POSIX mem threshold ............. : ${with_posix_malloc_threshold}      POSIX mem threshold ............. : ${with_posix_malloc_threshold}
# Line 775  $PACKAGE-$VERSION configuration summary: Line 988  $PACKAGE-$VERSION configuration summary:
988      Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}      Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}
989      Link pcregrep with libz ......... : ${enable_pcregrep_libz}      Link pcregrep with libz ......... : ${enable_pcregrep_libz}
990      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
991        Link pcretest with libedit ...... : ${enable_pcretest_libedit}
992      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
993    
994  EOF  EOF

Legend:
Removed from v.708  
changed lines
  Added in v.1055

  ViewVC Help
Powered by ViewVC 1.1.5