/[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 550 by ph10, Sun Oct 10 16:24:11 2010 UTC revision 1412 by ph10, Sun Dec 15 17:01:46 2013 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, [11])  m4_define(pcre_minor, [34])
13  m4_define(pcre_prerelease, [-RC1])  m4_define(pcre_prerelease, [])
14  m4_define(pcre_date, [2010-10-09])  m4_define(pcre_date, [2013-12-15])
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, [3:2:2])
21  m4_define(libpcreposix_version, [0:0:0])  m4_define(libpcre16_version, [2:2:2])
22    m4_define(libpcre32_version, [0:2:0])
23    m4_define(libpcreposix_version, [0:2: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 is a new thing required to stop a warning from automake 1.12
34    m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
35    
36  # This was added at the suggestion of libtoolize (03-Jan-10)  # This was added at the suggestion of libtoolize (03-Jan-10)
37  AC_CONFIG_MACRO_DIR([m4])  AC_CONFIG_MACRO_DIR([m4])
38    
# Line 42  remember_set_CXXFLAGS="$CXXFLAGS" Line 51  remember_set_CXXFLAGS="$CXXFLAGS"
51    
52  AC_PROG_CC  AC_PROG_CC
53  AC_PROG_CXX  AC_PROG_CXX
54    AM_PROG_CC_C_O
55    
56  if test "x$remember_set_CFLAGS" = "x"  if test "x$remember_set_CFLAGS" = "x"
57  then  then
# Line 68  fi Line 78  fi
78  # AC_PROG_CXX will return "g++" even if no c++ compiler is installed.  # AC_PROG_CXX will return "g++" even if no c++ compiler is installed.
79  # Check for that case, and just disable c++ code if g++ doesn't run.  # Check for that case, and just disable c++ code if g++ doesn't run.
80  AC_LANG_PUSH(C++)  AC_LANG_PUSH(C++)
81  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[]),, CXX=""; CXXCP=""; CXXFLAGS="")  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],, CXX=""; CXXCP=""; CXXFLAGS="")
82  AC_LANG_POP  AC_LANG_POP
83    
84  # Check for a 64-bit integer type  # Check for a 64-bit integer type
# Line 76  AC_TYPE_INT64_T Line 86  AC_TYPE_INT64_T
86    
87  AC_PROG_INSTALL  AC_PROG_INSTALL
88  AC_LIBTOOL_WIN32_DLL  AC_LIBTOOL_WIN32_DLL
89  AC_PROG_LIBTOOL  LT_INIT
90  AC_PROG_LN_S  AC_PROG_LN_S
91    
92    # Check for GCC visibility feature
93    
94    PCRE_VISIBILITY
95    
96    # Versioning
97    
98  PCRE_MAJOR="pcre_major"  PCRE_MAJOR="pcre_major"
99  PCRE_MINOR="pcre_minor"  PCRE_MINOR="pcre_minor"
100  PCRE_PRERELEASE="pcre_prerelease"  PCRE_PRERELEASE="pcre_prerelease"
# Line 104  then Line 120  then
120    htmldir='${docdir}/html'    htmldir='${docdir}/html'
121  fi  fi
122    
123    # Handle --disable-pcre8 (enabled by default)
124    AC_ARG_ENABLE(pcre8,
125                  AS_HELP_STRING([--disable-pcre8],
126                                 [disable 8 bit character support]),
127                  , enable_pcre8=unset)
128    AC_SUBST(enable_pcre8)
129    
130    # Handle --enable-pcre16 (disabled by default)
131    AC_ARG_ENABLE(pcre16,
132                  AS_HELP_STRING([--enable-pcre16],
133                                 [enable 16 bit character support]),
134                  , enable_pcre16=unset)
135    AC_SUBST(enable_pcre16)
136    
137    # Handle --enable-pcre32 (disabled by default)
138    AC_ARG_ENABLE(pcre32,
139                  AS_HELP_STRING([--enable-pcre32],
140                                 [enable 32 bit character support]),
141                  , enable_pcre32=unset)
142    AC_SUBST(enable_pcre32)
143    
144  # 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
145  # pcre-config.  # pcre-config.
146  AC_ARG_ENABLE(cpp,  AC_ARG_ENABLE(cpp,
147                AS_HELP_STRING([--disable-cpp],                AS_HELP_STRING([--disable-cpp],
148                               [disable C++ support]),                               [disable C++ support]),
149                , enable_cpp=yes)                , enable_cpp=unset)
150  AC_SUBST(enable_cpp)  AC_SUBST(enable_cpp)
151    
152    # Handle --enable-jit (disabled by default)
153    AC_ARG_ENABLE(jit,
154                  AS_HELP_STRING([--enable-jit],
155                                 [enable Just-In-Time compiling support]),
156                  , enable_jit=no)
157    
158    # Handle --disable-pcregrep-jit (enabled by default)
159    AC_ARG_ENABLE(pcregrep-jit,
160                  AS_HELP_STRING([--disable-pcregrep-jit],
161                                 [disable JIT support in pcregrep]),
162                  , enable_pcregrep_jit=yes)
163    
164  # Handle --enable-rebuild-chartables  # Handle --enable-rebuild-chartables
165  AC_ARG_ENABLE(rebuild-chartables,  AC_ARG_ENABLE(rebuild-chartables,
166                AS_HELP_STRING([--enable-rebuild-chartables],                AS_HELP_STRING([--enable-rebuild-chartables],
# Line 121  AC_ARG_ENABLE(rebuild-chartables, Line 170  AC_ARG_ENABLE(rebuild-chartables,
170  # Handle --enable-utf8 (disabled by default)  # Handle --enable-utf8 (disabled by default)
171  AC_ARG_ENABLE(utf8,  AC_ARG_ENABLE(utf8,
172                AS_HELP_STRING([--enable-utf8],                AS_HELP_STRING([--enable-utf8],
173                               [enable UTF-8 support (incompatible with --enable-ebcdic)]),                               [another name for --enable-utf. Kept only for compatibility reasons]),
174                , enable_utf8=unset)                , enable_utf8=unset)
175    
176    # Handle --enable-utf (disabled by default)
177    AC_ARG_ENABLE(utf,
178                  AS_HELP_STRING([--enable-utf],
179                                 [enable UTF-8/16/32 support (incompatible with --enable-ebcdic)]),
180                  , enable_utf=unset)
181    
182  # Handle --enable-unicode-properties  # Handle --enable-unicode-properties
183  AC_ARG_ENABLE(unicode-properties,  AC_ARG_ENABLE(unicode-properties,
184                AS_HELP_STRING([--enable-unicode-properties],                AS_HELP_STRING([--enable-unicode-properties],
185                               [enable Unicode properties support (implies --enable-utf8)]),                               [enable Unicode properties support (implies --enable-utf)]),
186                , enable_unicode_properties=no)                , enable_unicode_properties=no)
187    
188  # 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  
189  ac_pcre_newline=lf  ac_pcre_newline=lf
190  AC_ARG_ENABLE(newline-is-cr,  AC_ARG_ENABLE(newline-is-cr,
191                AS_HELP_STRING([--enable-newline-is-cr],                AS_HELP_STRING([--enable-newline-is-cr],
# Line 169  AC_ARG_ENABLE(bsr-anycrlf, Line 218  AC_ARG_ENABLE(bsr-anycrlf,
218  # Handle --enable-ebcdic  # Handle --enable-ebcdic
219  AC_ARG_ENABLE(ebcdic,  AC_ARG_ENABLE(ebcdic,
220                AS_HELP_STRING([--enable-ebcdic],                AS_HELP_STRING([--enable-ebcdic],
221                               [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]),
222                , enable_ebcdic=no)                , enable_ebcdic=no)
223    
224    # Handle --enable-ebcdic-nl25
225    AC_ARG_ENABLE(ebcdic-nl25,
226                  AS_HELP_STRING([--enable-ebcdic-nl25],
227                                 [set EBCDIC code for NL to 0x25 instead of 0x15; it implies --enable-ebcdic]),
228                  , enable_ebcdic_nl25=no)
229    
230  # Handle --disable-stack-for-recursion  # Handle --disable-stack-for-recursion
231  AC_ARG_ENABLE(stack-for-recursion,  AC_ARG_ENABLE(stack-for-recursion,
232                AS_HELP_STRING([--disable-stack-for-recursion],                AS_HELP_STRING([--disable-stack-for-recursion],
# Line 190  AC_ARG_ENABLE(pcregrep-libbz2, Line 245  AC_ARG_ENABLE(pcregrep-libbz2,
245                               [link pcregrep with libbz2 to handle .bz2 files]),                               [link pcregrep with libbz2 to handle .bz2 files]),
246                , enable_pcregrep_libbz2=no)                , enable_pcregrep_libbz2=no)
247    
248    # Handle --with-pcregrep-bufsize=N
249    AC_ARG_WITH(pcregrep-bufsize,
250                  AS_HELP_STRING([--with-pcregrep-bufsize=N],
251                                 [pcregrep buffer size (default=20480)]),
252                  , with_pcregrep_bufsize=20480)
253    
254    # Handle --enable-pcretest-libedit
255    AC_ARG_ENABLE(pcretest-libedit,
256                  AS_HELP_STRING([--enable-pcretest-libedit],
257                                 [link pcretest with libedit]),
258                  , enable_pcretest_libedit=no)
259    
260  # Handle --enable-pcretest-libreadline  # Handle --enable-pcretest-libreadline
261  AC_ARG_ENABLE(pcretest-libreadline,  AC_ARG_ENABLE(pcretest-libreadline,
262                AS_HELP_STRING([--enable-pcretest-libreadline],                AS_HELP_STRING([--enable-pcretest-libreadline],
# Line 208  AC_ARG_WITH(link-size, Line 275  AC_ARG_WITH(link-size,
275                             [internal link size (2, 3, or 4 allowed; default=2)]),                             [internal link size (2, 3, or 4 allowed; default=2)]),
276              , with_link_size=2)              , with_link_size=2)
277    
278    # Handle --with-parens-nest-limit=N
279    AC_ARG_WITH(parens-nest-limit,
280                AS_HELP_STRING([--with-parens-nest-limit=N],
281                               [nested parentheses limit (default=250)]),
282                , with_parens_nest_limit=250)
283    
284  # Handle --with-match-limit=N  # Handle --with-match-limit=N
285  AC_ARG_WITH(match-limit,  AC_ARG_WITH(match-limit,
286              AS_HELP_STRING([--with-match-limit=N],              AS_HELP_STRING([--with-match-limit=N],
# Line 227  AC_ARG_WITH(match-limit-recursion, Line 300  AC_ARG_WITH(match-limit-recursion,
300                             [default limit on internal recursion (default=MATCH_LIMIT)]),                             [default limit on internal recursion (default=MATCH_LIMIT)]),
301              , with_match_limit_recursion=MATCH_LIMIT)              , with_match_limit_recursion=MATCH_LIMIT)
302    
303  # Make sure that if enable_unicode_properties was set, that UTF-8 support  # Handle --enable-valgrind
304  # is enabled.  AC_ARG_ENABLE(valgrind,
305  #                AS_HELP_STRING([--enable-valgrind],
306                                 [valgrind support]),
307                  , enable_valgrind=no)
308    
309    # Enable code coverage reports using gcov
310    AC_ARG_ENABLE(coverage,
311                  AS_HELP_STRING([--enable-coverage],
312                                 [enable code coverage reports using gcov]),
313                  , enable_coverage=no)
314    
315    # Copy enable_utf8 value to enable_utf for compatibility reasons
316    if test "x$enable_utf8" != "xunset"
317    then
318      if test "x$enable_utf" != "xunset"
319      then
320        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.])
321      fi
322      enable_utf=$enable_utf8
323    fi
324    
325    # Set the default value for pcre8
326    if test "x$enable_pcre8" = "xunset"
327    then
328      enable_pcre8=yes
329    fi
330    
331    # Set the default value for pcre16
332    if test "x$enable_pcre16" = "xunset"
333    then
334      enable_pcre16=no
335    fi
336    
337    # Set the default value for pcre32
338    if test "x$enable_pcre32" = "xunset"
339    then
340      enable_pcre32=no
341    fi
342    
343    # Make sure enable_pcre8 or enable_pcre16 was set
344    if test "x$enable_pcre8$enable_pcre16$enable_pcre32" = "xnonono"
345    then
346      AC_MSG_ERROR([At least one of 8, 16 or 32 bit pcre library must be enabled])
347    fi
348    
349    # Make sure that if enable_unicode_properties was set, that UTF support is enabled.
350  if test "x$enable_unicode_properties" = "xyes"  if test "x$enable_unicode_properties" = "xyes"
351  then  then
352    if test "x$enable_utf8" = "xno"    if test "x$enable_utf" = "xno"
353    then    then
354      AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])      AC_MSG_ERROR([support for Unicode properties requires UTF-8/16/32 support])
355    fi    fi
356    enable_utf8=yes    enable_utf=yes
357  fi  fi
358    
359  if test "x$enable_utf8" = "xunset"  # enable_utf is disabled by default.
360    if test "x$enable_utf" = "xunset"
361  then  then
362    enable_utf8=no    enable_utf=no
363  fi  fi
364    
365  # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.  # enable_cpp copies the value of enable_pcre8 by default
366  # 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"  
367  then  then
368    enable_rebuild_chartables=yes    enable_cpp=$enable_pcre8
369    if test "x$enable_utf8" = "xyes"  fi
370    
371    # Make sure that if enable_cpp was set, that enable_pcre8 support is enabled
372    if test "x$enable_cpp" = "xyes"
373    then
374      if test "x$enable_pcre8" = "xno"
375    then    then
376      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])
377    fi    fi
378  fi  fi
379    
380  # Convert the newline identifier into the appropriate integer value.  # Convert the newline identifier into the appropriate integer value. The first
381    # three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they
382    # are changed below.
383    
384  case "$enable_newline" in  case "$enable_newline" in
385    lf)      ac_pcre_newline_value=10   ;;    lf)      ac_pcre_newline_value=10   ;;
386    cr)      ac_pcre_newline_value=13   ;;    cr)      ac_pcre_newline_value=13   ;;
# Line 270  case "$enable_newline" in Line 392  case "$enable_newline" in
392    ;;    ;;
393  esac  esac
394    
395    # --enable-ebcdic-nl25 implies --enable-ebcdic
396    if test "x$enable_ebcdic_nl25" = "xyes"; then
397      enable_ebcdic=yes
398    fi
399    
400    # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled,
401    # and the newline value is adjusted appropriately (CR is still 13, but LF is
402    # 21 or 37). Also check that UTF support is not requested, because PCRE cannot
403    # handle EBCDIC and UTF in the same build. To do so it would need to use
404    # different character constants depending on the mode.
405    #
406    if test "x$enable_ebcdic" = "xyes"; then
407      enable_rebuild_chartables=yes
408    
409      if test "x$enable_utf" = "xyes"; then
410        AC_MSG_ERROR([support for EBCDIC and UTF-8/16/32 cannot be enabled at the same time])
411      fi
412    
413      if test "x$enable_ebcdic_nl25" = "xno"; then
414        case "$ac_pcre_newline_value" in
415          10)   ac_pcre_newline_value=21 ;;
416          3338) ac_pcre_newline_value=3349 ;;
417        esac
418      else
419        case "$ac_pcre_newline_value" in
420          10)   ac_pcre_newline_value=37 ;;
421          3338) ac_pcre_newline_value=3365 ;;
422        esac
423      fi
424    fi
425    
426  # Check argument to --with-link-size  # Check argument to --with-link-size
427  case "$with_link_size" in  case "$with_link_size" in
428    2|3|4) ;;    2|3|4) ;;
# Line 279  case "$with_link_size" in Line 432  case "$with_link_size" in
432  esac  esac
433    
434  AH_TOP([  AH_TOP([
435  /* 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
436  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"
437  Standard C, but there are a few non-standard things it can cope with, allowing  systems.
438  it to run on SunOS4 and other "close to standard" systems.  
439    In environments that support the GNU autotools, config.h.in is converted into
440  If you are going to build PCRE "by hand" on a system without "configure" you  config.h by the "configure" script. In environments that use CMake,
441  should copy the distributed config.h.generic to config.h, and then set up the  config-cmake.in is converted into config.h. If you are going to build PCRE "by
442  macro definitions the way you need them. You must then add -DHAVE_CONFIG_H to  hand" without using "configure" or CMake, you should copy the distributed
443  all of your compile commands, so that config.h is included at the start of  config.h.generic to config.h, and edit the macro definitions to be the way you
444  every source.  need them. You must then add -DHAVE_CONFIG_H to all of your compile commands,
445    so that config.h is included at the start of every source.
446    
447  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
448  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,
449    but if you do, default values will be taken from config.h for non-boolean
450  PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if  macros that are not defined on the command line.
451  HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set  
452  them both to 0; an emulation function will be used. */])  Boolean macros such as HAVE_STDLIB_H and SUPPORT_PCRE8 should either be defined
453    (conventionally to 1) for TRUE, and not defined at all for FALSE. All such
454    macros are listed as a commented #undef in config.h.generic. Macros such as
455    MATCH_LIMIT, whose actual value is relevant, have defaults defined, but are
456    surrounded by #ifndef/#endif lines so that the value can be overridden by -D.
457    
458    PCRE uses memmove() if HAVE_MEMMOVE is defined; otherwise it uses bcopy() if
459    HAVE_BCOPY is defined. If your system has neither bcopy() nor memmove(), make
460    sure both macros are undefined; an emulation function will then be used. */])
461    
462  # Checks for header files.  # Checks for header files.
463  AC_HEADER_STDC  AC_HEADER_STDC
# Line 304  AC_CHECK_HEADERS(limits.h sys/types.h sy Line 466  AC_CHECK_HEADERS(limits.h sys/types.h sy
466  # The files below are C++ header files.  # The files below are C++ header files.
467  pcre_have_type_traits="0"  pcre_have_type_traits="0"
468  pcre_have_bits_type_traits="0"  pcre_have_bits_type_traits="0"
469    
470    if test "x$enable_cpp" = "xyes" -a -z "$CXX"; then
471       AC_MSG_ERROR([You need a C++ compiler for C++ support.])
472    fi
473    
474  if test "x$enable_cpp" = "xyes" -a -n "$CXX"  if test "x$enable_cpp" = "xyes" -a -n "$CXX"
475  then  then
476  AC_LANG_PUSH(C++)  AC_LANG_PUSH(C++)
# Line 320  for flag in "-alias,__ZN7pcrecpp2RE6no_a Line 487  for flag in "-alias,__ZN7pcrecpp2RE6no_a
487    LDFLAGS="$OLD_LDFLAGS -Wl,$flag"    LDFLAGS="$OLD_LDFLAGS -Wl,$flag"
488    # We try to run the linker with this new ld flag.  If the link fails,    # We try to run the linker with this new ld flag.  If the link fails,
489    # we give up and remove the new flag from LDFLAGS.    # we give up and remove the new flag from LDFLAGS.
490    AC_LINK_IFELSE(AC_LANG_PROGRAM([namespace pcrecpp {    AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace pcrecpp {
491                                      class RE { static int no_arg; };                                      class RE { static int no_arg; };
492                                      int RE::no_arg;                                      int RE::no_arg;
493                                    }],                                    }],
494                                   []),                                   [])],
495                   [AC_MSG_RESULT([yes]);                   [AC_MSG_RESULT([yes]);
496                    EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";                    EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";
497                    break;],                    break;],
# Line 361  for fn in strtoq strtoll _strtoi64 strto Line 528  for fn in strtoq strtoll _strtoi64 strto
528    else    else
529      include=stdlib.h      include=stdlib.h
530    fi    fi
531    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <$include>],    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$include>],
532                                      [char* e; return $fn("100", &e, 10)]),                                      [char* e; return $fn("100", &e, 10)])],
533                      [AC_MSG_RESULT(yes)                      [AC_MSG_RESULT(yes)
534                       AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1,                       AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1,
535                                          [Define to 1 if you have `$fn'.])                                          [Define to 1 if you have `$fn'.])
# Line 392  AC_SUBST(pcre_have_type_traits) Line 559  AC_SUBST(pcre_have_type_traits)
559  AC_SUBST(pcre_have_bits_type_traits)  AC_SUBST(pcre_have_bits_type_traits)
560    
561  # Conditional compilation  # Conditional compilation
562    AM_CONDITIONAL(WITH_PCRE8, test "x$enable_pcre8" = "xyes")
563    AM_CONDITIONAL(WITH_PCRE16, test "x$enable_pcre16" = "xyes")
564    AM_CONDITIONAL(WITH_PCRE32, test "x$enable_pcre32" = "xyes")
565  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
566  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
567    AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
568    AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")
569    AM_CONDITIONAL(WITH_VALGRIND, test "x$enable_valgrind" = "xyes")
570    
571  # Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
572    
# Line 434  AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_ Line 607  AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_
607  AC_MSG_CHECKING([for libbz2])  AC_MSG_CHECKING([for libbz2])
608  OLD_LIBS="$LIBS"  OLD_LIBS="$LIBS"
609  LIBS="$LIBS -lbz2"  LIBS="$LIBS -lbz2"
610  AC_LINK_IFELSE( AC_LANG_PROGRAM([[  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
611  #ifdef HAVE_BZLIB_H  #ifdef HAVE_BZLIB_H
612  #include <bzlib.h>  #include <bzlib.h>
613  #endif]],  #endif]],
614  [[return (int)BZ2_bzopen("conftest", "rb");]]),  [[return (int)BZ2_bzopen("conftest", "rb");]])],
615  [AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;],  [AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;],
616  AC_MSG_RESULT([no]))  AC_MSG_RESULT([no]))
617  LIBS="$OLD_LIBS"  LIBS="$OLD_LIBS"
618    
619  # Check for the availabiity of libreadline  # Check for the availabiity of libreadline
620    
621  AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])  if test "$enable_pcretest_libreadline" = "yes"; then
622  AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])   AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
623  AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1])   AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
624     AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"],
625       [unset ac_cv_lib_readline_readline;
626        AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"],
627         [unset ac_cv_lib_readline_readline;
628          AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"],
629           [unset ac_cv_lib_readline_readline;
630            AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"],
631             [unset ac_cv_lib_readline_readline;
632              AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"],
633               [unset ac_cv_lib_readline_readline;
634                AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"],
635                 [LIBREADLINE=""],
636                 [-ltermcap])],
637               [-lncursesw])],
638             [-lncurses])],
639           [-lcurses])],
640         [-ltinfo])])
641     AC_SUBST(LIBREADLINE)
642     if test -n "$LIBREADLINE"; then
643       if test "$LIBREADLINE" != "-lreadline"; then
644         echo "-lreadline needs $LIBREADLINE"
645         LIBREADLINE="-lreadline $LIBREADLINE"
646       fi
647     fi
648    fi
649    
650    
651    # Check for the availability of libedit. Different distributions put its
652    # headers in different places. Try to cover the most common ones.
653    
654    if test "$enable_pcretest_libedit" = "yes"; then
655      AC_CHECK_HEADERS([editline/readline.h], [HAVE_EDITLINE_READLINE_H=1],
656        [AC_CHECK_HEADERS([edit/readline/readline.h], [HAVE_READLINE_READLINE_H=1],
657          [AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_READLINE_H=1])])])
658      AC_CHECK_LIB([edit], [readline], [LIBEDIT="-ledit"])
659    fi
660    
661  # This facilitates -ansi builds under Linux  # This facilitates -ansi builds under Linux
662  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
# Line 455  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable Line 664  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable
664  PCRE_STATIC_CFLAG=""  PCRE_STATIC_CFLAG=""
665  if test "x$enable_shared" = "xno" ; then  if test "x$enable_shared" = "xno" ; then
666    AC_DEFINE([PCRE_STATIC], [1], [    AC_DEFINE([PCRE_STATIC], [1], [
667      Define if linking statically (TODO: make nice with Libtool)])      Define to any value if linking statically (TODO: make nice with Libtool)])
668    PCRE_STATIC_CFLAG="-DPCRE_STATIC"    PCRE_STATIC_CFLAG="-DPCRE_STATIC"
669  fi  fi
670  AC_SUBST(PCRE_STATIC_CFLAG)  AC_SUBST(PCRE_STATIC_CFLAG)
671    
672  # Here is where pcre specific defines are handled  # Here is where pcre specific defines are handled
673    
674  if test "$enable_utf8" = "yes"; then  if test "$enable_pcre8" = "yes"; then
675    AC_DEFINE([SUPPORT_UTF8], [], [    AC_DEFINE([SUPPORT_PCRE8], [], [
676      Define to enable support for the UTF-8 Unicode encoding. This will      Define to any value to enable the 8 bit PCRE library.])
677      work even in an EBCDIC environment, but it is incompatible with  fi
678      the EBCDIC macro. That is, PCRE can support *either* EBCDIC code  
679      *or* ASCII/UTF-8, but not both at once.])  if test "$enable_pcre16" = "yes"; then
680      AC_DEFINE([SUPPORT_PCRE16], [], [
681        Define to any value to enable the 16 bit PCRE library.])
682    fi
683    
684    if test "$enable_pcre32" = "yes"; then
685      AC_DEFINE([SUPPORT_PCRE32], [], [
686        Define to any value to enable the 32 bit PCRE library.])
687    fi
688    
689    if test "$enable_jit" = "yes"; then
690      AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])])
691      CC="$PTHREAD_CC"
692      CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
693      LIBS="$PTHREAD_LIBS $LIBS"
694      AC_DEFINE([SUPPORT_JIT], [], [
695        Define to any value to enable support for Just-In-Time compiling.])
696    else
697      enable_pcregrep_jit="no"
698    fi
699    
700    if test "$enable_pcregrep_jit" = "yes"; then
701      AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [
702        Define to any value to enable JIT support in pcregrep.])
703    fi
704    
705    if test "$enable_utf" = "yes"; then
706      AC_DEFINE([SUPPORT_UTF], [], [
707        Define to any value to enable support for the UTF-8/16/32 Unicode encoding.
708        This will work even in an EBCDIC environment, but it is incompatible
709        with the EBCDIC macro. That is, PCRE can support *either* EBCDIC
710        code *or* ASCII/UTF-8/16/32, but not both at once.])
711  fi  fi
712    
713  if test "$enable_unicode_properties" = "yes"; then  if test "$enable_unicode_properties" = "yes"; then
714    AC_DEFINE([SUPPORT_UCP], [], [    AC_DEFINE([SUPPORT_UCP], [], [
715      Define to enable support for Unicode properties])      Define to any value to enable support for Unicode properties.])
716  fi  fi
717    
718  if test "$enable_stack_for_recursion" = "no"; then  if test "$enable_stack_for_recursion" = "no"; then
719    AC_DEFINE([NO_RECURSE], [], [    AC_DEFINE([NO_RECURSE], [], [
720      PCRE uses recursive function calls to handle backtracking while      PCRE uses recursive function calls to handle backtracking while
721      matching. This can sometimes be a problem on systems that have      matching. This can sometimes be a problem on systems that have
722      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
723      doesn't use recursion in the match() function; instead it creates      version that doesn't use recursion in the match() function; instead
724      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
725      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
726      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).])  
727  fi  fi
728    
729  if test "$enable_pcregrep_libz" = "yes"; then  if test "$enable_pcregrep_libz" = "yes"; then
730    AC_DEFINE([SUPPORT_LIBZ], [], [    AC_DEFINE([SUPPORT_LIBZ], [], [
731      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
732      able to handle .gz files.])      able to handle .gz files.])
733  fi  fi
734    
735  if test "$enable_pcregrep_libbz2" = "yes"; then  if test "$enable_pcregrep_libbz2" = "yes"; then
736    AC_DEFINE([SUPPORT_LIBBZ2], [], [    AC_DEFINE([SUPPORT_LIBBZ2], [], [
737      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
738      able to handle .bz2 files.])      is able to handle .bz2 files.])
739  fi  fi
740    
741  if test "$enable_pcretest_libreadline" = "yes"; then  if test $with_pcregrep_bufsize -lt 8192 ; then
742      with_pcregrep_bufsize="8192"
743    fi
744    
745    AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [
746      The value of PCREGREP_BUFSIZE determines the size of buffer used by pcregrep
747      to hold parts of the file it is searching. This is also the minimum value.
748      The actual amount of memory used by pcregrep is three times this number,
749      because it allows for the buffering of "before" and "after" lines.])
750    
751    if test "$enable_pcretest_libedit" = "yes"; then
752      AC_DEFINE([SUPPORT_LIBEDIT], [], [
753        Define to any value to allow pcretest to be linked with libedit.])
754      LIBREADLINE="$LIBEDIT"
755    elif test "$enable_pcretest_libreadline" = "yes"; then
756    AC_DEFINE([SUPPORT_LIBREADLINE], [], [    AC_DEFINE([SUPPORT_LIBREADLINE], [], [
757      Define to allow pcretest to be linked with libreadline.])      Define to any value to allow pcretest to be linked with libreadline.])
758  fi  fi
759    
760  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
761    The value of NEWLINE determines the newline character sequence. On    The value of NEWLINE determines the default newline character sequence. PCRE
762    systems that support it, "configure" can be used to override the    client programs can override this by selecting other values at run time. In
763    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
764    3338 (CRLF), -1 (ANY), or -2 (ANYCRLF).])    EBCDIC environments the value can be 21 or 37 (LF), 13 (CR), or 3349 or 3365
765      (CRLF) because there are two alternative codepoints (0x15 and 0x25) that are
766      used as the NL line terminator that is equivalent to ASCII LF. In both ASCII
767      and EBCDIC environments the value can also be -1 (ANY), or -2 (ANYCRLF).])
768    
769  if test "$enable_bsr_anycrlf" = "yes"; then  if test "$enable_bsr_anycrlf" = "yes"; then
770    AC_DEFINE([BSR_ANYCRLF], [], [    AC_DEFINE([BSR_ANYCRLF], [], [
771      By default, the \R escape sequence matches any Unicode line ending      By default, the \R escape sequence matches any Unicode line ending
772      character or sequence of characters. If BSR_ANYCRLF is defined, this is      character or sequence of characters. If BSR_ANYCRLF is defined (to any
773      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.
774      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.])  
775  fi  fi
776    
777  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [
# Line 526  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_l Line 779  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_l
779    links as offsets within the compiled regex. The default is 2, which    links as offsets within the compiled regex. The default is 2, which
780    allows for compiled patterns up to 64K long. This covers the vast    allows for compiled patterns up to 64K long. This covers the vast
781    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
782    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.])  
783    
784  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [
785    When calling PCRE via the POSIX interface, additional working storage    When calling PCRE via the POSIX interface, additional working storage
# Line 536  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHO Line 788  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHO
788    interface provides only two. If the number of expected substrings is    interface provides only two. If the number of expected substrings is
789    small, the wrapper function uses space on the stack, because this is    small, the wrapper function uses space on the stack, because this is
790    faster than using malloc() for each call. The threshold above which    faster than using malloc() for each call. The threshold above which
791    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.])
792    systems that support it, "configure" can be used to override this  
793    default.])  AC_DEFINE_UNQUOTED([PARENS_NEST_LIMIT], [$with_parens_nest_limit], [
794      The value of PARENS_NEST_LIMIT specifies the maximum depth of nested
795      parentheses (of any kind) in a pattern. This limits the amount of system
796      stack that is used while compiling a pattern.])
797    
798  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [
799    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 547  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with Line 802  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with
802    limit. The limit exists in order to catch runaway regular    limit. The limit exists in order to catch runaway regular
803    expressions that take for ever to determine that they do not match.    expressions that take for ever to determine that they do not match.
804    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
805    legitimate cases. On systems that support it, "configure" can be    legitimate cases.])
   used to override this default default.])  
806    
807  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [
808    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 559  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSIO Line 813  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSIO
813    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
814    have any useful effect, it must be less than the value of    have any useful effect, it must be less than the value of
815    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.
816    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.])  
817    
818  AC_DEFINE([MAX_NAME_SIZE], [32], [  AC_DEFINE([MAX_NAME_SIZE], [32], [
819    This limit is parameterized just in case anybody ever wants to    This limit is parameterized just in case anybody ever wants to
# Line 576  AH_VERBATIM([PCRE_EXP_DEFN], [ Line 829  AH_VERBATIM([PCRE_EXP_DEFN], [
829  /* 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
830     Win32, and it needs some magic to be inserted before the definition     Win32, and it needs some magic to be inserted before the definition
831     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
832     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
833     defaults to "extern" for a C compiler and "extern C" for a C++      __declspec value is used for Windows systems; in other environments
834     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.
835     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
836     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"
837     which are internal to the library. */     in the C sense, but which are internal to the library. */
838  #undef PCRE_EXP_DEFN])  #undef PCRE_EXP_DEFN])
839    
840  if test "$enable_ebcdic" = "yes"; then  if test "$enable_ebcdic" = "yes"; then
841    AC_DEFINE_UNQUOTED([EBCDIC], [], [    AC_DEFINE_UNQUOTED([EBCDIC], [], [
842      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
843      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
844      "configure", this can be done via --enable-ebcdic. PCRE will then      NEWLINE macro below to set a suitable EBCDIC newline, commonly 21 (0x15).
845      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
846      this macro, PCRE will assume input strings are ASCII or UTF-8 Unicode.      automatically adjusted. When EBCDIC is set, PCRE assumes that all input
847      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
848      EBCDIC and UTF-8.])      input strings are ASCII or UTF-8/16/32 Unicode. It is not possible to build
849        a version of PCRE that supports both EBCDIC and UTF-8/16/32.])
850    fi
851    
852    if test "$enable_ebcdic_nl25" = "yes"; then
853      AC_DEFINE_UNQUOTED([EBCDIC_NL25], [], [
854        In an EBCDIC environment, define this macro to any value to arrange for
855        the NL character to be 0x25 instead of the default 0x15. NL plays the role
856        that LF does in an ASCII/Unicode environment. The value must also be set in
857        the NEWLINE macro below. On systems that can use "configure" or CMake to
858        set EBCDIC_NL25, the adjustment of NEWLINE is automatic.])
859    fi
860    
861    if test "$enable_valgrind" = "yes"; then
862      AC_DEFINE_UNQUOTED([SUPPORT_VALGRIND], [], [
863         Define to any value for valgrind support to find invalid memory reads.])
864  fi  fi
865    
866  # Platform specific issues  # Platform specific issues
# Line 613  esac Line 881  esac
881  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \
882                         $NO_UNDEFINED -version-info libpcre_version"                         $NO_UNDEFINED -version-info libpcre_version"
883    
884    EXTRA_LIBPCRE16_LDFLAGS="$EXTRA_LIBPCRE16_LDFLAGS \
885                           $NO_UNDEFINED -version-info libpcre16_version"
886    
887    EXTRA_LIBPCRE32_LDFLAGS="$EXTRA_LIBPCRE32_LDFLAGS \
888                           $NO_UNDEFINED -version-info libpcre32_version"
889    
890  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \
891                              $NO_UNDEFINED -version-info libpcreposix_version"                              $NO_UNDEFINED -version-info libpcreposix_version"
892    
# Line 621  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE Line 895  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE
895                            $EXPORT_ALL_SYMBOLS"                            $EXPORT_ALL_SYMBOLS"
896    
897  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
898    AC_SUBST(EXTRA_LIBPCRE16_LDFLAGS)
899    AC_SUBST(EXTRA_LIBPCRE32_LDFLAGS)
900  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
901  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
902    
903  # When we run 'make distcheck', use these arguments.  # When we run 'make distcheck', use these arguments. Turning off compiler
904  DISTCHECK_CONFIGURE_FLAGS="--enable-cpp --enable-unicode-properties"  # optimization makes it run faster.
905    DISTCHECK_CONFIGURE_FLAGS="CFLAGS='' CXXFLAGS='' --enable-pcre16 --enable-pcre32 --enable-jit --enable-cpp --enable-unicode-properties"
906  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
907    
908  # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is  # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
# Line 659  AC_SUBST(LIBBZ2) Line 936  AC_SUBST(LIBBZ2)
936    
937  # Similarly for --enable-pcretest-readline  # Similarly for --enable-pcretest-readline
938    
939    if test "$enable_pcretest_libedit" = "yes"; then
940      if test "$enable_pcretest_libreadline" = "yes"; then
941        echo "** Cannot use both --enable-pcretest-libedit and --enable-pcretest-readline"
942        exit 1
943      fi
944      if test "$HAVE_EDITLINE_READLINE_H" != "1" -a \
945              "$HAVE_READLINE_READLINE_H" != "1"; then
946        echo "** Cannot --enable-pcretest-libedit because neither editline/readline.h"
947        echo "** nor readline/readline.h was found."
948        exit 1
949      fi
950      if test -z "$LIBEDIT"; then
951        echo "** Cannot --enable-pcretest-libedit because libedit library was not found."
952        exit 1
953      fi
954    fi
955    
956  if test "$enable_pcretest_libreadline" = "yes"; then  if test "$enable_pcretest_libreadline" = "yes"; then
957    if test "$HAVE_READLINE_H" != "1"; then    if test "$HAVE_READLINE_H" != "1"; then
958      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 668  if test "$enable_pcretest_libreadline" = Line 962  if test "$enable_pcretest_libreadline" =
962      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
963      exit 1      exit 1
964    fi    fi
965    LIBREADLINE="-lreadline"    if test -z "$LIBREADLINE"; then
966        echo "** Cannot --enable-pcretest-readline because readline library was not found."
967        exit 1
968      fi
969    fi
970    
971    # Handle valgrind support
972    
973    if test "$enable_valgrind" = "yes"; then
974      m4_ifdef([PKG_CHECK_MODULES],
975               [PKG_CHECK_MODULES([VALGRIND],[valgrind])],
976               [AC_MSG_ERROR([pkg-config not supported])])
977  fi  fi
978  AC_SUBST(LIBREADLINE)  
979    # Handle code coverage reporting support
980    if test "$enable_coverage" = "yes"; then
981      if test "x$GCC" != "xyes"; then
982        AC_MSG_ERROR([Code coverage reports can only be generated when using GCC])
983      fi
984    
985      # ccache is incompatible with gcov
986      AC_PATH_PROG([SHTOOL],[shtool],[false])
987      case `$SHTOOL path $CC` in
988        *ccache*) cc_ccache=yes;;
989        *) cc_ccache=no;;
990      esac
991    
992      if test "$cc_ccache" = "yes"; then
993        if test -z "$CCACHE_DISABLE" -o "$CCACHE_DISABLE" != "1"; then
994          AC_MSG_ERROR([must export CCACHE_DISABLE=1 to disable ccache for code coverage])
995        fi
996      fi
997    
998      AC_ARG_VAR([LCOV],[the ltp lcov program])
999      AC_PATH_PROG([LCOV],[lcov],[false])
1000      if test "x$LCOV" = "xfalse"; then
1001        AC_MSG_ERROR([lcov not found])
1002      fi
1003    
1004      AC_ARG_VAR([GENHTML],[the ltp genhtml program])
1005      AC_PATH_PROG([GENHTML],[genhtml],[false])
1006      if test "x$GENHTML" = "xfalse"; then
1007        AC_MSG_ERROR([genhtml not found])
1008      fi
1009    
1010      # Set flags needed for gcov
1011      GCOV_CFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
1012      GCOV_CXXFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
1013      GCOV_LIBS="-lgcov"
1014      AC_SUBST([GCOV_CFLAGS])
1015      AC_SUBST([GCOV_CXXFLAGS])
1016      AC_SUBST([GCOV_LIBS])
1017    fi # enable_coverage
1018    
1019    AM_CONDITIONAL([WITH_GCOV],[test "x$enable_coverage" = "xyes"])
1020    
1021  # Produce these files, in addition to config.h.  # Produce these files, in addition to config.h.
1022  AC_CONFIG_FILES(  AC_CONFIG_FILES(
1023          Makefile          Makefile
1024          libpcre.pc          libpcre.pc
1025          libpcreposix.pc          libpcre16.pc
1026            libpcre32.pc
1027            libpcreposix.pc
1028          libpcrecpp.pc          libpcrecpp.pc
1029          pcre-config          pcre-config
1030          pcre.h          pcre.h
# Line 693  AC_CONFIG_COMMANDS([delete-old-chartable Line 1041  AC_CONFIG_COMMANDS([delete-old-chartable
1041    
1042  AC_OUTPUT  AC_OUTPUT
1043    
1044  # Print out a nice little message after configure is run displaying your  # Print out a nice little message after configure is run displaying the
1045  # chosen options.  # chosen options.
1046    
1047    ebcdic_nl_code=n/a
1048    if test "$enable_ebcdic_nl25" = "yes"; then
1049      ebcdic_nl_code=0x25
1050    elif test "$enable_ebcdic" = "yes"; then
1051      ebcdic_nl_code=0x15
1052    fi
1053    
1054  cat <<EOF  cat <<EOF
1055    
1056  $PACKAGE-$VERSION configuration summary:  $PACKAGE-$VERSION configuration summary:
# Line 707  $PACKAGE-$VERSION configuration summary: Line 1062  $PACKAGE-$VERSION configuration summary:
1062      C++ compiler .................... : ${CXX}      C++ compiler .................... : ${CXX}
1063      Linker .......................... : ${LD}      Linker .......................... : ${LD}
1064      C preprocessor flags ............ : ${CPPFLAGS}      C preprocessor flags ............ : ${CPPFLAGS}
1065      C compiler flags ................ : ${CFLAGS}      C compiler flags ................ : ${CFLAGS} ${VISIBILITY_CFLAGS}
1066      C++ compiler flags .............. : ${CXXFLAGS}      C++ compiler flags .............. : ${CXXFLAGS} ${VISIBILITY_CXXFLAGS}
1067      Linker flags .................... : ${LDFLAGS}      Linker flags .................... : ${LDFLAGS}
1068      Extra libraries ................. : ${LIBS}      Extra libraries ................. : ${LIBS}
1069    
1070        Build 8 bit pcre library ........ : ${enable_pcre8}
1071        Build 16 bit pcre library ....... : ${enable_pcre16}
1072        Build 32 bit pcre library ....... : ${enable_pcre32}
1073      Build C++ library ............... : ${enable_cpp}      Build C++ library ............... : ${enable_cpp}
1074      Enable UTF-8 support ............ : ${enable_utf8}      Enable JIT compiling support .... : ${enable_jit}
1075        Enable UTF-8/16/32 support ...... : ${enable_utf}
1076      Unicode properties .............. : ${enable_unicode_properties}      Unicode properties .............. : ${enable_unicode_properties}
1077      Newline char/sequence ........... : ${enable_newline}      Newline char/sequence ........... : ${enable_newline}
1078      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
1079      EBCDIC coding ................... : ${enable_ebcdic}      EBCDIC coding ................... : ${enable_ebcdic}
1080        EBCDIC code for NL .............. : ${ebcdic_nl_code}
1081      Rebuild char tables ............. : ${enable_rebuild_chartables}      Rebuild char tables ............. : ${enable_rebuild_chartables}
1082      Use stack recursion ............. : ${enable_stack_for_recursion}      Use stack recursion ............. : ${enable_stack_for_recursion}
1083      POSIX mem threshold ............. : ${with_posix_malloc_threshold}      POSIX mem threshold ............. : ${with_posix_malloc_threshold}
1084      Internal link size .............. : ${with_link_size}      Internal link size .............. : ${with_link_size}
1085        Nested parentheses limit ........ : ${with_parens_nest_limit}
1086      Match limit ..................... : ${with_match_limit}      Match limit ..................... : ${with_match_limit}
1087      Match limit recursion ........... : ${with_match_limit_recursion}      Match limit recursion ........... : ${with_match_limit_recursion}
1088      Build shared libs ............... : ${enable_shared}      Build shared libs ............... : ${enable_shared}
1089      Build static libs ............... : ${enable_static}      Build static libs ............... : ${enable_static}
1090        Use JIT in pcregrep ............. : ${enable_pcregrep_jit}
1091        Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}
1092      Link pcregrep with libz ......... : ${enable_pcregrep_libz}      Link pcregrep with libz ......... : ${enable_pcregrep_libz}
1093      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
1094        Link pcretest with libedit ...... : ${enable_pcretest_libedit}
1095      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
1096        Valgrind support ................ : ${enable_valgrind}
1097        Code coverage ................... : ${enable_coverage}
1098    
1099  EOF  EOF
1100    

Legend:
Removed from v.550  
changed lines
  Added in v.1412

  ViewVC Help
Powered by ViewVC 1.1.5