/[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 1230 by ph10, Fri Dec 7 10:22:16 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, [11])  m4_define(pcre_minor, [33])
13  m4_define(pcre_prerelease, [-RC1])  m4_define(pcre_prerelease, [-RC1])
14  m4_define(pcre_date, [2010-10-09])  m4_define(pcre_date, [2012-12-07])
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:0:2])
21  m4_define(libpcreposix_version, [0:0:0])  m4_define(libpcre16_version, [2:0:2])
22    m4_define(libpcre32_version, [0:0: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 42  remember_set_CXXFLAGS="$CXXFLAGS" Line 48  remember_set_CXXFLAGS="$CXXFLAGS"
48    
49  AC_PROG_CC  AC_PROG_CC
50  AC_PROG_CXX  AC_PROG_CXX
51    AM_PROG_CC_C_O
52    
53  if test "x$remember_set_CFLAGS" = "x"  if test "x$remember_set_CFLAGS" = "x"
54  then  then
# Line 68  fi Line 75  fi
75  # 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.
76  # 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.
77  AC_LANG_PUSH(C++)  AC_LANG_PUSH(C++)
78  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[]),, CXX=""; CXXCP=""; CXXFLAGS="")  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],, CXX=""; CXXCP=""; CXXFLAGS="")
79  AC_LANG_POP  AC_LANG_POP
80    
81  # Check for a 64-bit integer type  # Check for a 64-bit integer type
# Line 76  AC_TYPE_INT64_T Line 83  AC_TYPE_INT64_T
83    
84  AC_PROG_INSTALL  AC_PROG_INSTALL
85  AC_LIBTOOL_WIN32_DLL  AC_LIBTOOL_WIN32_DLL
86  AC_PROG_LIBTOOL  LT_INIT
87  AC_PROG_LN_S  AC_PROG_LN_S
88    
89    # Check for GCC visibility feature
90    
91    PCRE_VISIBILITY
92    
93    # Versioning
94    
95  PCRE_MAJOR="pcre_major"  PCRE_MAJOR="pcre_major"
96  PCRE_MINOR="pcre_minor"  PCRE_MINOR="pcre_minor"
97  PCRE_PRERELEASE="pcre_prerelease"  PCRE_PRERELEASE="pcre_prerelease"
# Line 104  then Line 117  then
117    htmldir='${docdir}/html'    htmldir='${docdir}/html'
118  fi  fi
119    
120    # Handle --disable-pcre8 (enabled by default)
121    AC_ARG_ENABLE(pcre8,
122                  AS_HELP_STRING([--disable-pcre8],
123                                 [disable 8 bit character support]),
124                  , enable_pcre8=unset)
125    AC_SUBST(enable_pcre8)
126    
127    # Handle --enable-pcre16 (disabled by default)
128    AC_ARG_ENABLE(pcre16,
129                  AS_HELP_STRING([--enable-pcre16],
130                                 [enable 16 bit character support]),
131                  , enable_pcre16=unset)
132    AC_SUBST(enable_pcre16)
133    
134    # Handle --enable-pcre32 (disabled by default)
135    AC_ARG_ENABLE(pcre32,
136                  AS_HELP_STRING([--enable-pcre32],
137                                 [enable 32 bit character support]),
138                  , enable_pcre32=unset)
139    AC_SUBST(enable_pcre32)
140    
141  # 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
142  # pcre-config.  # pcre-config.
143  AC_ARG_ENABLE(cpp,  AC_ARG_ENABLE(cpp,
144                AS_HELP_STRING([--disable-cpp],                AS_HELP_STRING([--disable-cpp],
145                               [disable C++ support]),                               [disable C++ support]),
146                , enable_cpp=yes)                , enable_cpp=unset)
147  AC_SUBST(enable_cpp)  AC_SUBST(enable_cpp)
148    
149    # Handle --enable-jit (disabled by default)
150    AC_ARG_ENABLE(jit,
151                  AS_HELP_STRING([--enable-jit],
152                                 [enable Just-In-Time compiling support]),
153                  , enable_jit=no)
154    
155    # Handle --disable-pcregrep-jit (enabled by default)
156    AC_ARG_ENABLE(pcregrep-jit,
157                  AS_HELP_STRING([--disable-pcregrep-jit],
158                                 [disable JIT support in pcregrep]),
159                  , enable_pcregrep_jit=yes)
160    
161  # Handle --enable-rebuild-chartables  # Handle --enable-rebuild-chartables
162  AC_ARG_ENABLE(rebuild-chartables,  AC_ARG_ENABLE(rebuild-chartables,
163                AS_HELP_STRING([--enable-rebuild-chartables],                AS_HELP_STRING([--enable-rebuild-chartables],
# Line 121  AC_ARG_ENABLE(rebuild-chartables, Line 167  AC_ARG_ENABLE(rebuild-chartables,
167  # Handle --enable-utf8 (disabled by default)  # Handle --enable-utf8 (disabled by default)
168  AC_ARG_ENABLE(utf8,  AC_ARG_ENABLE(utf8,
169                AS_HELP_STRING([--enable-utf8],                AS_HELP_STRING([--enable-utf8],
170                               [enable UTF-8 support (incompatible with --enable-ebcdic)]),                               [another name for --enable-utf. Kept only for compatibility reasons]),
171                , enable_utf8=unset)                , enable_utf8=unset)
172    
173    # Handle --enable-utf (disabled by default)
174    AC_ARG_ENABLE(utf,
175                  AS_HELP_STRING([--enable-utf],
176                                 [enable UTF-8/16/32 support (incompatible with --enable-ebcdic)]),
177                  , enable_utf=unset)
178    
179  # Handle --enable-unicode-properties  # Handle --enable-unicode-properties
180  AC_ARG_ENABLE(unicode-properties,  AC_ARG_ENABLE(unicode-properties,
181                AS_HELP_STRING([--enable-unicode-properties],                AS_HELP_STRING([--enable-unicode-properties],
182                               [enable Unicode properties support (implies --enable-utf8)]),                               [enable Unicode properties support (implies --enable-utf)]),
183                , enable_unicode_properties=no)                , enable_unicode_properties=no)
184    
185  # 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  
186  ac_pcre_newline=lf  ac_pcre_newline=lf
187  AC_ARG_ENABLE(newline-is-cr,  AC_ARG_ENABLE(newline-is-cr,
188                AS_HELP_STRING([--enable-newline-is-cr],                AS_HELP_STRING([--enable-newline-is-cr],
# Line 169  AC_ARG_ENABLE(bsr-anycrlf, Line 215  AC_ARG_ENABLE(bsr-anycrlf,
215  # Handle --enable-ebcdic  # Handle --enable-ebcdic
216  AC_ARG_ENABLE(ebcdic,  AC_ARG_ENABLE(ebcdic,
217                AS_HELP_STRING([--enable-ebcdic],                AS_HELP_STRING([--enable-ebcdic],
218                               [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]),
219                , enable_ebcdic=no)                , enable_ebcdic=no)
220    
221    # Handle --enable-ebcdic-nl25
222    AC_ARG_ENABLE(ebcdic-nl25,
223                  AS_HELP_STRING([--enable-ebcdic-nl25],
224                                 [set EBCDIC code for NL to 0x25 instead of 0x15; it implies --enable-ebcdic]),
225                  , enable_ebcdic_nl25=no)
226    
227  # Handle --disable-stack-for-recursion  # Handle --disable-stack-for-recursion
228  AC_ARG_ENABLE(stack-for-recursion,  AC_ARG_ENABLE(stack-for-recursion,
229                AS_HELP_STRING([--disable-stack-for-recursion],                AS_HELP_STRING([--disable-stack-for-recursion],
# Line 190  AC_ARG_ENABLE(pcregrep-libbz2, Line 242  AC_ARG_ENABLE(pcregrep-libbz2,
242                               [link pcregrep with libbz2 to handle .bz2 files]),                               [link pcregrep with libbz2 to handle .bz2 files]),
243                , enable_pcregrep_libbz2=no)                , enable_pcregrep_libbz2=no)
244    
245    # Handle --with-pcregrep-bufsize=N
246    AC_ARG_WITH(pcregrep-bufsize,
247                  AS_HELP_STRING([--with-pcregrep-bufsize=N],
248                                 [pcregrep buffer size (default=20480)]),
249                  , with_pcregrep_bufsize=20480)
250    
251    # Handle --enable-pcretest-libedit
252    AC_ARG_ENABLE(pcretest-libedit,
253                  AS_HELP_STRING([--enable-pcretest-libedit],
254                                 [link pcretest with libedit]),
255                  , enable_pcretest_libedit=no)
256    
257  # Handle --enable-pcretest-libreadline  # Handle --enable-pcretest-libreadline
258  AC_ARG_ENABLE(pcretest-libreadline,  AC_ARG_ENABLE(pcretest-libreadline,
259                AS_HELP_STRING([--enable-pcretest-libreadline],                AS_HELP_STRING([--enable-pcretest-libreadline],
# Line 227  AC_ARG_WITH(match-limit-recursion, Line 291  AC_ARG_WITH(match-limit-recursion,
291                             [default limit on internal recursion (default=MATCH_LIMIT)]),                             [default limit on internal recursion (default=MATCH_LIMIT)]),
292              , with_match_limit_recursion=MATCH_LIMIT)              , with_match_limit_recursion=MATCH_LIMIT)
293    
294  # Make sure that if enable_unicode_properties was set, that UTF-8 support  # Handle --enable-valgrind
295  # is enabled.  AC_ARG_ENABLE(valgrind,
296  #                AS_HELP_STRING([--enable-valgrind],
297                                 [valgrind support]),
298                  , enable_valgrind=no)
299    
300    # Enable code coverage reports using gcov
301    AC_ARG_ENABLE(coverage,
302                  AS_HELP_STRING([--enable-coverage],
303                                 [enable code coverage reports using gcov]),
304                  , enable_coverage=no)
305    
306    # Copy enable_utf8 value to enable_utf for compatibility reasons
307    if test "x$enable_utf8" != "xunset"
308    then
309      if test "x$enable_utf" != "xunset"
310      then
311        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.])
312      fi
313      enable_utf=$enable_utf8
314    fi
315    
316    # Set the default value for pcre8
317    if test "x$enable_pcre8" = "xunset"
318    then
319      enable_pcre8=yes
320    fi
321    
322    # Set the default value for pcre16
323    if test "x$enable_pcre16" = "xunset"
324    then
325      enable_pcre16=no
326    fi
327    
328    # Set the default value for pcre32
329    if test "x$enable_pcre32" = "xunset"
330    then
331      enable_pcre32=no
332    fi
333    
334    # Make sure enable_pcre8 or enable_pcre16 was set
335    if test "x$enable_pcre8$enable_pcre16$enable_pcre32" = "xnonono"
336    then
337      AC_MSG_ERROR([At least one of 8, 16 or 32 bit pcre library must be enabled])
338    fi
339    
340    # Make sure that if enable_unicode_properties was set, that UTF support is enabled.
341  if test "x$enable_unicode_properties" = "xyes"  if test "x$enable_unicode_properties" = "xyes"
342  then  then
343    if test "x$enable_utf8" = "xno"    if test "x$enable_utf" = "xno"
344    then    then
345      AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])      AC_MSG_ERROR([support for Unicode properties requires UTF-8/16/32 support])
346    fi    fi
347    enable_utf8=yes    enable_utf=yes
348  fi  fi
349    
350  if test "x$enable_utf8" = "xunset"  # enable_utf is disabled by default.
351    if test "x$enable_utf" = "xunset"
352  then  then
353    enable_utf8=no    enable_utf=no
354  fi  fi
355    
356  # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.  # enable_cpp copies the value of enable_pcre8 by default
357  # 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"  
358  then  then
359    enable_rebuild_chartables=yes    enable_cpp=$enable_pcre8
360    if test "x$enable_utf8" = "xyes"  fi
361    
362    # Make sure that if enable_cpp was set, that enable_pcre8 support is enabled
363    if test "x$enable_cpp" = "xyes"
364    then
365      if test "x$enable_pcre8" = "xno"
366    then    then
367      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])
368    fi    fi
369  fi  fi
370    
371  # Convert the newline identifier into the appropriate integer value.  # Convert the newline identifier into the appropriate integer value. The first
372    # three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they
373    # are changed below.
374    
375  case "$enable_newline" in  case "$enable_newline" in
376    lf)      ac_pcre_newline_value=10   ;;    lf)      ac_pcre_newline_value=10   ;;
377    cr)      ac_pcre_newline_value=13   ;;    cr)      ac_pcre_newline_value=13   ;;
# Line 270  case "$enable_newline" in Line 383  case "$enable_newline" in
383    ;;    ;;
384  esac  esac
385    
386    # --enable-ebcdic-nl25 implies --enable-ebcdic
387    if test "x$enable_ebcdic_nl25" = "xyes"; then
388      enable_ebcdic=yes
389    fi
390    
391    # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled,
392    # and the newline value is adjusted appropriately (CR is still 13, but LF is
393    # 21 or 37). Also check that UTF support is not requested, because PCRE cannot
394    # handle EBCDIC and UTF in the same build. To do so it would need to use
395    # different character constants depending on the mode.
396    #
397    if test "x$enable_ebcdic" = "xyes"; then
398      enable_rebuild_chartables=yes
399    
400      if test "x$enable_utf" = "xyes"; then
401        AC_MSG_ERROR([support for EBCDIC and UTF-8/16/32 cannot be enabled at the same time])
402      fi
403    
404      if test "x$enable_ebcdic_nl25" = "xno"; then
405        case "$ac_pcre_newline_value" in
406          10)   ac_pcre_newline_value=21 ;;
407          3338) ac_pcre_newline_value=3349 ;;
408        esac
409      else
410        case "$ac_pcre_newline_value" in
411          10)   ac_pcre_newline_value=37 ;;
412          3338) ac_pcre_newline_value=3365 ;;
413        esac
414      fi
415    fi
416    
417  # Check argument to --with-link-size  # Check argument to --with-link-size
418  case "$with_link_size" in  case "$with_link_size" in
419    2|3|4) ;;    2|3|4) ;;
# Line 279  case "$with_link_size" in Line 423  case "$with_link_size" in
423  esac  esac
424    
425  AH_TOP([  AH_TOP([
426  /* 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
427  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"
428  Standard C, but there are a few non-standard things it can cope with, allowing  systems.
429  it to run on SunOS4 and other "close to standard" systems.  
430    In environments that support the facilities, config.h.in is converted by
431  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
432  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
433  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
434  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
435  every source.  -DHAVE_CONFIG_H to all of your compile commands, so that config.h is included
436    at the start of every source.
437    
438  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
439  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 304  AC_CHECK_HEADERS(limits.h sys/types.h sy Line 449  AC_CHECK_HEADERS(limits.h sys/types.h sy
449  # The files below are C++ header files.  # The files below are C++ header files.
450  pcre_have_type_traits="0"  pcre_have_type_traits="0"
451  pcre_have_bits_type_traits="0"  pcre_have_bits_type_traits="0"
452    
453    if test "x$enable_cpp" = "xyes" -a -z "$CXX"; then
454       AC_MSG_ERROR([You need a C++ compiler for C++ support.])
455    fi
456    
457  if test "x$enable_cpp" = "xyes" -a -n "$CXX"  if test "x$enable_cpp" = "xyes" -a -n "$CXX"
458  then  then
459  AC_LANG_PUSH(C++)  AC_LANG_PUSH(C++)
# Line 320  for flag in "-alias,__ZN7pcrecpp2RE6no_a Line 470  for flag in "-alias,__ZN7pcrecpp2RE6no_a
470    LDFLAGS="$OLD_LDFLAGS -Wl,$flag"    LDFLAGS="$OLD_LDFLAGS -Wl,$flag"
471    # 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,
472    # we give up and remove the new flag from LDFLAGS.    # we give up and remove the new flag from LDFLAGS.
473    AC_LINK_IFELSE(AC_LANG_PROGRAM([namespace pcrecpp {    AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace pcrecpp {
474                                      class RE { static int no_arg; };                                      class RE { static int no_arg; };
475                                      int RE::no_arg;                                      int RE::no_arg;
476                                    }],                                    }],
477                                   []),                                   [])],
478                   [AC_MSG_RESULT([yes]);                   [AC_MSG_RESULT([yes]);
479                    EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";                    EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";
480                    break;],                    break;],
# Line 361  for fn in strtoq strtoll _strtoi64 strto Line 511  for fn in strtoq strtoll _strtoi64 strto
511    else    else
512      include=stdlib.h      include=stdlib.h
513    fi    fi
514    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <$include>],    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$include>],
515                                      [char* e; return $fn("100", &e, 10)]),                                      [char* e; return $fn("100", &e, 10)])],
516                      [AC_MSG_RESULT(yes)                      [AC_MSG_RESULT(yes)
517                       AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1,                       AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1,
518                                          [Define to 1 if you have `$fn'.])                                          [Define to 1 if you have `$fn'.])
# Line 392  AC_SUBST(pcre_have_type_traits) Line 542  AC_SUBST(pcre_have_type_traits)
542  AC_SUBST(pcre_have_bits_type_traits)  AC_SUBST(pcre_have_bits_type_traits)
543    
544  # Conditional compilation  # Conditional compilation
545    AM_CONDITIONAL(WITH_PCRE8, test "x$enable_pcre8" = "xyes")
546    AM_CONDITIONAL(WITH_PCRE16, test "x$enable_pcre16" = "xyes")
547    AM_CONDITIONAL(WITH_PCRE32, test "x$enable_pcre32" = "xyes")
548  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
549  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
550    AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
551    AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")
552    AM_CONDITIONAL(WITH_VALGRIND, test "x$enable_valgrind" = "xyes")
553    
554  # Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
555    
# Line 434  AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_ Line 590  AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_
590  AC_MSG_CHECKING([for libbz2])  AC_MSG_CHECKING([for libbz2])
591  OLD_LIBS="$LIBS"  OLD_LIBS="$LIBS"
592  LIBS="$LIBS -lbz2"  LIBS="$LIBS -lbz2"
593  AC_LINK_IFELSE( AC_LANG_PROGRAM([[  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
594  #ifdef HAVE_BZLIB_H  #ifdef HAVE_BZLIB_H
595  #include <bzlib.h>  #include <bzlib.h>
596  #endif]],  #endif]],
597  [[return (int)BZ2_bzopen("conftest", "rb");]]),  [[return (int)BZ2_bzopen("conftest", "rb");]])],
598  [AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;],  [AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;],
599  AC_MSG_RESULT([no]))  AC_MSG_RESULT([no]))
600  LIBS="$OLD_LIBS"  LIBS="$OLD_LIBS"
601    
602  # Check for the availabiity of libreadline  # Check for the availabiity of libreadline
603    
604  AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])  if test "$enable_pcretest_libreadline" = "yes"; then
605  AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])   AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
606  AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1])   AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
607     AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"],
608       [unset ac_cv_lib_readline_readline;
609        AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"],
610         [unset ac_cv_lib_readline_readline;
611          AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"],
612           [unset ac_cv_lib_readline_readline;
613            AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"],
614             [unset ac_cv_lib_readline_readline;
615              AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"],
616               [unset ac_cv_lib_readline_readline;
617                AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"],
618                 [LIBREADLINE=""],
619                 [-ltermcap])],
620               [-lncursesw])],
621             [-lncurses])],
622           [-lcurses])],
623         [-ltinfo])])
624     AC_SUBST(LIBREADLINE)
625     if test -n "$LIBREADLINE"; then
626       if test "$LIBREADLINE" != "-lreadline"; then
627         echo "-lreadline needs $LIBREADLINE"
628         LIBREADLINE="-lreadline $LIBREADLINE"
629       fi
630     fi
631    fi
632    
633    
634    # Check for the availability of libedit. Different distributions put its
635    # headers in different places. Try to cover the most common ones.
636    
637    if test "$enable_pcretest_libedit" = "yes"; then
638      AC_CHECK_HEADERS([editline/readline.h], [HAVE_EDITLINE_READLINE_H=1],
639        [AC_CHECK_HEADERS([edit/readline/readline.h], [HAVE_READLINE_READLINE_H=1],
640          [AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_READLINE_H=1])])])
641      AC_CHECK_LIB([edit], [readline], [LIBEDIT="-ledit"])
642    fi
643    
644  # This facilitates -ansi builds under Linux  # This facilitates -ansi builds under Linux
645  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 647  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable
647  PCRE_STATIC_CFLAG=""  PCRE_STATIC_CFLAG=""
648  if test "x$enable_shared" = "xno" ; then  if test "x$enable_shared" = "xno" ; then
649    AC_DEFINE([PCRE_STATIC], [1], [    AC_DEFINE([PCRE_STATIC], [1], [
650      Define if linking statically (TODO: make nice with Libtool)])      Define to any value if linking statically (TODO: make nice with Libtool)])
651    PCRE_STATIC_CFLAG="-DPCRE_STATIC"    PCRE_STATIC_CFLAG="-DPCRE_STATIC"
652  fi  fi
653  AC_SUBST(PCRE_STATIC_CFLAG)  AC_SUBST(PCRE_STATIC_CFLAG)
654    
655  # Here is where pcre specific defines are handled  # Here is where pcre specific defines are handled
656    
657  if test "$enable_utf8" = "yes"; then  if test "$enable_pcre8" = "yes"; then
658    AC_DEFINE([SUPPORT_UTF8], [], [    AC_DEFINE([SUPPORT_PCRE8], [], [
659      Define to enable support for the UTF-8 Unicode encoding. This will      Define to any value to enable the 8 bit PCRE library.])
660      work even in an EBCDIC environment, but it is incompatible with  fi
661      the EBCDIC macro. That is, PCRE can support *either* EBCDIC code  
662      *or* ASCII/UTF-8, but not both at once.])  if test "$enable_pcre16" = "yes"; then
663      AC_DEFINE([SUPPORT_PCRE16], [], [
664        Define to any value to enable the 16 bit PCRE library.])
665    fi
666    
667    if test "$enable_pcre32" = "yes"; then
668      AC_DEFINE([SUPPORT_PCRE32], [], [
669        Define to any value to enable the 32 bit PCRE library.])
670    fi
671    
672    if test "$enable_jit" = "yes"; then
673      AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])])
674      CC="$PTHREAD_CC"
675      CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
676      LIBS="$PTHREAD_LIBS $LIBS"
677      AC_DEFINE([SUPPORT_JIT], [], [
678        Define to any value to enable support for Just-In-Time compiling.])
679    else
680      enable_pcregrep_jit="no"
681    fi
682    
683    if test "$enable_pcregrep_jit" = "yes"; then
684      AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [
685        Define to any value to enable JIT support in pcregrep.])
686    fi
687    
688    if test "$enable_utf" = "yes"; then
689      AC_DEFINE([SUPPORT_UTF], [], [
690        Define to any value to enable support for the UTF-8/16/32 Unicode encoding.
691        This will work even in an EBCDIC environment, but it is incompatible
692        with the EBCDIC macro. That is, PCRE can support *either* EBCDIC
693        code *or* ASCII/UTF-8/16/32, but not both at once.])
694  fi  fi
695    
696  if test "$enable_unicode_properties" = "yes"; then  if test "$enable_unicode_properties" = "yes"; then
697    AC_DEFINE([SUPPORT_UCP], [], [    AC_DEFINE([SUPPORT_UCP], [], [
698      Define to enable support for Unicode properties])      Define to any value to enable support for Unicode properties.])
699  fi  fi
700    
701  if test "$enable_stack_for_recursion" = "no"; then  if test "$enable_stack_for_recursion" = "no"; then
702    AC_DEFINE([NO_RECURSE], [], [    AC_DEFINE([NO_RECURSE], [], [
703      PCRE uses recursive function calls to handle backtracking while      PCRE uses recursive function calls to handle backtracking while
704      matching. This can sometimes be a problem on systems that have      matching. This can sometimes be a problem on systems that have
705      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
706      doesn't use recursion in the match() function; instead it creates      version that doesn't use recursion in the match() function; instead
707      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
708      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
709      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).])  
710  fi  fi
711    
712  if test "$enable_pcregrep_libz" = "yes"; then  if test "$enable_pcregrep_libz" = "yes"; then
713    AC_DEFINE([SUPPORT_LIBZ], [], [    AC_DEFINE([SUPPORT_LIBZ], [], [
714      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
715      able to handle .gz files.])      able to handle .gz files.])
716  fi  fi
717    
718  if test "$enable_pcregrep_libbz2" = "yes"; then  if test "$enable_pcregrep_libbz2" = "yes"; then
719    AC_DEFINE([SUPPORT_LIBBZ2], [], [    AC_DEFINE([SUPPORT_LIBBZ2], [], [
720      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
721      able to handle .bz2 files.])      is able to handle .bz2 files.])
722  fi  fi
723    
724  if test "$enable_pcretest_libreadline" = "yes"; then  if test $with_pcregrep_bufsize -lt 8192 ; then
725      with_pcregrep_bufsize="8192"
726    fi
727    
728    AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [
729      The value of PCREGREP_BUFSIZE determines the size of buffer used by pcregrep
730      to hold parts of the file it is searching. This is also the minimum value.
731      The actual amount of memory used by pcregrep is three times this number,
732      because it allows for the buffering of "before" and "after" lines.])
733    
734    if test "$enable_pcretest_libedit" = "yes"; then
735      AC_DEFINE([SUPPORT_LIBEDIT], [], [
736        Define to any value to allow pcretest to be linked with libedit.])
737      LIBREADLINE="$LIBEDIT"
738    elif test "$enable_pcretest_libreadline" = "yes"; then
739    AC_DEFINE([SUPPORT_LIBREADLINE], [], [    AC_DEFINE([SUPPORT_LIBREADLINE], [], [
740      Define to allow pcretest to be linked with libreadline.])      Define to any value to allow pcretest to be linked with libreadline.])
741  fi  fi
742    
743  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
744    The value of NEWLINE determines the newline character sequence. On    The value of NEWLINE determines the default newline character sequence. PCRE
745    systems that support it, "configure" can be used to override the    client programs can override this by selecting other values at run time. In
746    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
747    3338 (CRLF), -1 (ANY), or -2 (ANYCRLF).])    EBCDIC environments the value can be 21 or 37 (LF), 13 (CR), or 3349 or 3365
748      (CRLF) because there are two alternative codepoints (0x15 and 0x25) that are
749      used as the NL line terminator that is equivalent to ASCII LF. In both ASCII
750      and EBCDIC environments the value can also be -1 (ANY), or -2 (ANYCRLF).])
751    
752  if test "$enable_bsr_anycrlf" = "yes"; then  if test "$enable_bsr_anycrlf" = "yes"; then
753    AC_DEFINE([BSR_ANYCRLF], [], [    AC_DEFINE([BSR_ANYCRLF], [], [
754      By default, the \R escape sequence matches any Unicode line ending      By default, the \R escape sequence matches any Unicode line ending
755      character or sequence of characters. If BSR_ANYCRLF is defined, this is      character or sequence of characters. If BSR_ANYCRLF is defined (to any
756      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.
757      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.])  
758  fi  fi
759    
760  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 762  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_l
762    links as offsets within the compiled regex. The default is 2, which    links as offsets within the compiled regex. The default is 2, which
763    allows for compiled patterns up to 64K long. This covers the vast    allows for compiled patterns up to 64K long. This covers the vast
764    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
765    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.])  
766    
767  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [
768    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 771  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHO
771    interface provides only two. If the number of expected substrings is    interface provides only two. If the number of expected substrings is
772    small, the wrapper function uses space on the stack, because this is    small, the wrapper function uses space on the stack, because this is
773    faster than using malloc() for each call. The threshold above which    faster than using malloc() for each call. The threshold above which
774    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.])  
775    
776  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [
777    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 780  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with
780    limit. The limit exists in order to catch runaway regular    limit. The limit exists in order to catch runaway regular
781    expressions that take for ever to determine that they do not match.    expressions that take for ever to determine that they do not match.
782    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
783    legitimate cases. On systems that support it, "configure" can be    legitimate cases.])
   used to override this default default.])  
784    
785  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [
786    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 791  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSIO
791    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
792    have any useful effect, it must be less than the value of    have any useful effect, it must be less than the value of
793    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.
794    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.])  
795    
796  AC_DEFINE([MAX_NAME_SIZE], [32], [  AC_DEFINE([MAX_NAME_SIZE], [32], [
797    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 807  AH_VERBATIM([PCRE_EXP_DEFN], [
807  /* 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
808     Win32, and it needs some magic to be inserted before the definition     Win32, and it needs some magic to be inserted before the definition
809     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
810     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
811     defaults to "extern" for a C compiler and "extern C" for a C++      __declspec value is used for Windows systems; in other environments
812     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.
813     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
814     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"
815     which are internal to the library. */     in the C sense, but which are internal to the library. */
816  #undef PCRE_EXP_DEFN])  #undef PCRE_EXP_DEFN])
817    
818  if test "$enable_ebcdic" = "yes"; then  if test "$enable_ebcdic" = "yes"; then
819    AC_DEFINE_UNQUOTED([EBCDIC], [], [    AC_DEFINE_UNQUOTED([EBCDIC], [], [
820      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
821      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
822      "configure", this can be done via --enable-ebcdic. PCRE will then      NEWLINE macro below to set a suitable EBCDIC newline, commonly 21 (0x15).
823      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
824      this macro, PCRE will assume input strings are ASCII or UTF-8 Unicode.      automatically adjusted. When EBCDIC is set, PCRE assumes that all input
825      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
826      EBCDIC and UTF-8.])      input strings are ASCII or UTF-8/16/32 Unicode. It is not possible to build
827        a version of PCRE that supports both EBCDIC and UTF-8/16/32.])
828    fi
829    
830    if test "$enable_ebcdic_nl25" = "yes"; then
831      AC_DEFINE_UNQUOTED([EBCDIC_NL25], [], [
832        In an EBCDIC environment, define this macro to any value to arrange for
833        the NL character to be 0x25 instead of the default 0x15. NL plays the role
834        that LF does in an ASCII/Unicode environment. The value must also be set in
835        the NEWLINE macro below. On systems that can use "configure" or CMake to
836        set EBCDIC_NL25, the adjustment of NEWLINE is automatic.])
837    fi
838    
839    if test "$enable_valgrind" = "yes"; then
840      AC_DEFINE_UNQUOTED([SUPPORT_VALGRIND], [], [
841         Valgrind support to find invalid memory reads.])
842  fi  fi
843    
844  # Platform specific issues  # Platform specific issues
# Line 613  esac Line 859  esac
859  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \
860                         $NO_UNDEFINED -version-info libpcre_version"                         $NO_UNDEFINED -version-info libpcre_version"
861    
862    EXTRA_LIBPCRE16_LDFLAGS="$EXTRA_LIBPCRE16_LDFLAGS \
863                           $NO_UNDEFINED -version-info libpcre16_version"
864    
865    EXTRA_LIBPCRE32_LDFLAGS="$EXTRA_LIBPCRE32_LDFLAGS \
866                           $NO_UNDEFINED -version-info libpcre32_version"
867    
868  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \
869                              $NO_UNDEFINED -version-info libpcreposix_version"                              $NO_UNDEFINED -version-info libpcreposix_version"
870    
# Line 621  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE Line 873  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE
873                            $EXPORT_ALL_SYMBOLS"                            $EXPORT_ALL_SYMBOLS"
874    
875  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
876    AC_SUBST(EXTRA_LIBPCRE16_LDFLAGS)
877    AC_SUBST(EXTRA_LIBPCRE32_LDFLAGS)
878  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
879  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
880    
881  # When we run 'make distcheck', use these arguments.  # When we run 'make distcheck', use these arguments. Turning off compiler
882  DISTCHECK_CONFIGURE_FLAGS="--enable-cpp --enable-unicode-properties"  # optimization makes it run faster.
883    DISTCHECK_CONFIGURE_FLAGS="CFLAGS='' CXXFLAGS='' --enable-pcre16 --enable-pcre32 --enable-jit --enable-cpp --enable-unicode-properties"
884  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
885    
886  # 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 914  AC_SUBST(LIBBZ2)
914    
915  # Similarly for --enable-pcretest-readline  # Similarly for --enable-pcretest-readline
916    
917    if test "$enable_pcretest_libedit" = "yes"; then
918      if test "$enable_pcretest_libreadline" = "yes"; then
919        echo "** Cannot use both --enable-pcretest-libedit and --enable-pcretest-readline"
920        exit 1
921      fi
922      if test "$HAVE_EDITLINE_READLINE_H" != "1" -a \
923              "$HAVE_READLINE_READLINE_H" != "1"; then
924        echo "** Cannot --enable-pcretest-libedit because neither editline/readline.h"
925        echo "** nor readline/readline.h was found."
926        exit 1
927      fi
928      if test -z "$LIBEDIT"; then
929        echo "** Cannot --enable-pcretest-libedit because libedit library was not found."
930        exit 1
931      fi
932    fi
933    
934  if test "$enable_pcretest_libreadline" = "yes"; then  if test "$enable_pcretest_libreadline" = "yes"; then
935    if test "$HAVE_READLINE_H" != "1"; then    if test "$HAVE_READLINE_H" != "1"; then
936      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 940  if test "$enable_pcretest_libreadline" =
940      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
941      exit 1      exit 1
942    fi    fi
943    LIBREADLINE="-lreadline"    if test -z "$LIBREADLINE"; then
944        echo "** Cannot --enable-pcretest-readline because readline library was not found."
945        exit 1
946      fi
947    fi
948    
949    # Check for valgrind
950    
951    if test "$enable_valgrind" = "yes"; then
952      m4_ifdef([PKG_CHECK_MODULES],
953               [PKG_CHECK_MODULES([VALGRIND],[valgrind])],
954               [AC_MSG_ERROR([pkg-config not supported])])
955  fi  fi
956  AC_SUBST(LIBREADLINE)  
957    # test code coverage reporting
958    if test "$enable_coverage" = "yes"; then
959      if test "x$GCC" != "xyes"; then
960        AC_MSG_ERROR([Code coverage reports can only be generated when using GCC])
961      fi
962    
963      # ccache is incompatible with gcov
964      AC_PATH_PROG([SHTOOL],[shtool],[false])
965      case `$SHTOOL path $CC` in
966        *ccache*) cc_ccache=yes;;
967        *) cc_ccache=no;;
968      esac
969    
970      if test "$cc_ccache" = "yes"; then
971        if test -z "$CCACHE_DISABLE" -o "$CCACHE_DISABLE" != "1"; then
972          AC_MSG_ERROR([must export CCACHE_DISABLE=1 to disable ccache for code coverage])
973        fi
974      fi
975    
976      AC_ARG_VAR([LCOV],[the ltp lcov program])
977      AC_PATH_PROG([LCOV],[lcov],[false])
978      if test "x$LCOV" = "xfalse"; then
979        AC_MSG_ERROR([lcov not found])
980      fi
981    
982      AC_ARG_VAR([GENHTML],[the ltp genhtml program])
983      AC_PATH_PROG([GENHTML],[genhtml],[false])
984      if test "x$GENHTML" = "xfalse"; then
985        AC_MSG_ERROR([genhtml not found])
986      fi
987    
988      AC_DEFINE([SUPPORT_GCOV],[1], [
989        Define to allow pcretest and pcregrep to be linked with gcov, so that they
990        are able to generate code coverage reports.])
991    
992      # And add flags needed for gcov
993      GCOV_CFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
994      GCOV_CXXFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
995      GCOV_LIBS="-lgcov"
996      AC_SUBST([GCOV_CFLAGS])
997      AC_SUBST([GCOV_CXXFLAGS])
998      AC_SUBST([GCOV_LIBS])
999    fi # enable_coverage
1000    
1001    AM_CONDITIONAL([WITH_GCOV],[test "x$enable_coverage" = "xyes"])
1002    
1003  # Produce these files, in addition to config.h.  # Produce these files, in addition to config.h.
1004  AC_CONFIG_FILES(  AC_CONFIG_FILES(
1005          Makefile          Makefile
1006          libpcre.pc          libpcre.pc
1007          libpcreposix.pc          libpcre16.pc
1008            libpcre32.pc
1009            libpcreposix.pc
1010          libpcrecpp.pc          libpcrecpp.pc
1011          pcre-config          pcre-config
1012          pcre.h          pcre.h
# Line 693  AC_CONFIG_COMMANDS([delete-old-chartable Line 1023  AC_CONFIG_COMMANDS([delete-old-chartable
1023    
1024  AC_OUTPUT  AC_OUTPUT
1025    
1026  # Print out a nice little message after configure is run displaying your  # Print out a nice little message after configure is run displaying the
1027  # chosen options.  # chosen options.
1028    
1029    ebcdic_nl_code=n/a
1030    if test "$enable_ebcdic_nl25" = "yes"; then
1031      ebcdic_nl_code=0x25
1032    elif test "$enable_ebcdic" = "yes"; then
1033      ebcdic_nl_code=0x15
1034    fi
1035    
1036  cat <<EOF  cat <<EOF
1037    
1038  $PACKAGE-$VERSION configuration summary:  $PACKAGE-$VERSION configuration summary:
# Line 707  $PACKAGE-$VERSION configuration summary: Line 1044  $PACKAGE-$VERSION configuration summary:
1044      C++ compiler .................... : ${CXX}      C++ compiler .................... : ${CXX}
1045      Linker .......................... : ${LD}      Linker .......................... : ${LD}
1046      C preprocessor flags ............ : ${CPPFLAGS}      C preprocessor flags ............ : ${CPPFLAGS}
1047      C compiler flags ................ : ${CFLAGS}      C compiler flags ................ : ${CFLAGS} ${VISIBILITY_CFLAGS}
1048      C++ compiler flags .............. : ${CXXFLAGS}      C++ compiler flags .............. : ${CXXFLAGS} ${VISIBILITY_CXXFLAGS}
1049      Linker flags .................... : ${LDFLAGS}      Linker flags .................... : ${LDFLAGS}
1050      Extra libraries ................. : ${LIBS}      Extra libraries ................. : ${LIBS}
1051    
1052        Build 8 bit pcre library ........ : ${enable_pcre8}
1053        Build 16 bit pcre library ....... : ${enable_pcre16}
1054        Build 32 bit pcre library ....... : ${enable_pcre32}
1055      Build C++ library ............... : ${enable_cpp}      Build C++ library ............... : ${enable_cpp}
1056      Enable UTF-8 support ............ : ${enable_utf8}      Enable JIT compiling support .... : ${enable_jit}
1057        Enable UTF-8/16/32 support ...... : ${enable_utf}
1058      Unicode properties .............. : ${enable_unicode_properties}      Unicode properties .............. : ${enable_unicode_properties}
1059      Newline char/sequence ........... : ${enable_newline}      Newline char/sequence ........... : ${enable_newline}
1060      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
1061      EBCDIC coding ................... : ${enable_ebcdic}      EBCDIC coding ................... : ${enable_ebcdic}
1062        EBCDIC code for NL .............. : ${ebcdic_nl_code}
1063      Rebuild char tables ............. : ${enable_rebuild_chartables}      Rebuild char tables ............. : ${enable_rebuild_chartables}
1064      Use stack recursion ............. : ${enable_stack_for_recursion}      Use stack recursion ............. : ${enable_stack_for_recursion}
1065      POSIX mem threshold ............. : ${with_posix_malloc_threshold}      POSIX mem threshold ............. : ${with_posix_malloc_threshold}
# Line 726  $PACKAGE-$VERSION configuration summary: Line 1068  $PACKAGE-$VERSION configuration summary:
1068      Match limit recursion ........... : ${with_match_limit_recursion}      Match limit recursion ........... : ${with_match_limit_recursion}
1069      Build shared libs ............... : ${enable_shared}      Build shared libs ............... : ${enable_shared}
1070      Build static libs ............... : ${enable_static}      Build static libs ............... : ${enable_static}
1071        Use JIT in pcregrep ............. : ${enable_pcregrep_jit}
1072        Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}
1073      Link pcregrep with libz ......... : ${enable_pcregrep_libz}      Link pcregrep with libz ......... : ${enable_pcregrep_libz}
1074      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
1075        Link pcretest with libedit ...... : ${enable_pcretest_libedit}
1076      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
1077        Valgrind support ................ : ${enable_valgrind}
1078        Code coverage ................... : ${enable_coverage}
1079    
1080  EOF  EOF
1081    

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

  ViewVC Help
Powered by ViewVC 1.1.5