/[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 172 by ph10, Tue Jun 5 10:40:13 2007 UTC revision 1163 by ph10, Tue Oct 23 10:57:30 2012 UTC
# Line 1  Line 1 
1  dnl Process this file with autoconf to produce a configure script.  dnl Process this file with autoconf to produce a configure script.
2    
3  dnl NOTE FOR MAINTAINERS: Do not use major or minor version numbers with  dnl NOTE FOR MAINTAINERS: Do not use minor version numbers 08 or 09 because
4  dnl leading zeros, because they may be treated as octal constants. The  dnl the leading zeros may cause them to be treated as invalid octal constants
5  dnl PCRE_PRERELEASE feature is for identifying release candidates. It might  dnl if a PCRE user writes code that uses PCRE_MINOR as a number. There is now
6  dnl be defined as -RC2, for example. For real releases, it should be defined  dnl a check further down that throws an error if 08 or 09 are used.
7  dnl empty.  
8    dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might
9  m4_define(pcre_major, [7])  dnl be defined as -RC2, for example. For real releases, it should be empty.
10  m4_define(pcre_minor, [2])  
11  m4_define(pcre_prerelease, [-RC2])  m4_define(pcre_major, [8])
12  m4_define(pcre_date, [2007-06-05])  m4_define(pcre_minor, [32])
13    m4_define(pcre_prerelease, [-RC1])
14    m4_define(pcre_date, [2012-08-08])
15    
16    # NOTE: The CMakeLists.txt file searches for the above variables in the first
17    # 50 lines of this file. Please update that if the variables above are moved.
18    
19  # Libtool shared library interface versions (current:revision:age)  # Libtool shared library interface versions (current:revision:age)
20  m4_define(libpcre_version, [0:1:0])  m4_define(libpcre_version, [1:1:0])
21  m4_define(libpcreposix_version, [0:0:0])  m4_define(libpcre16_version, [0:1:0])
22    m4_define(libpcre32_version, [0:1:0])
23    m4_define(libpcreposix_version, [0:1:0])
24  m4_define(libpcrecpp_version, [0:0:0])  m4_define(libpcrecpp_version, [0:0:0])
25    
26  AC_PREREQ(2.57)  AC_PREREQ(2.57)
27  AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)  AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)
28  AC_CONFIG_SRCDIR([pcre.h.in])  AC_CONFIG_SRCDIR([pcre.h.in])
29  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])  AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
30    m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
31  AC_CONFIG_HEADERS(config.h)  AC_CONFIG_HEADERS(config.h)
32    
33    # This was added at the suggestion of libtoolize (03-Jan-10)
34    AC_CONFIG_MACRO_DIR([m4])
35    
36  # The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just  # The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just
37  # "-g" for any other compiler. There doesn't seem to be a standard way of  # "-g" for any other compiler. There doesn't seem to be a standard way of
38  # getting rid of the -g (which I don't think is needed for a production  # getting rid of the -g (which I don't think is needed for a production
# Line 37  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 60  then Line 72  then
72    fi    fi
73  fi  fi
74    
75    # 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.
77    AC_LANG_PUSH(C++)
78    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],, CXX=""; CXXCP=""; CXXFLAGS="")
79    AC_LANG_POP
80    
81    # Check for a 64-bit integer type
82    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  PCRE_MAJOR="pcre_major"  PCRE_MAJOR="pcre_major"
# Line 71  PCRE_MINOR="pcre_minor" Line 91  PCRE_MINOR="pcre_minor"
91  PCRE_PRERELEASE="pcre_prerelease"  PCRE_PRERELEASE="pcre_prerelease"
92  PCRE_DATE="pcre_date"  PCRE_DATE="pcre_date"
93    
94    if test "$PCRE_MINOR" = "08" -o "$PCRE_MINOR" = "09"
95    then
96      echo "***"
97      echo "*** Minor version number $PCRE_MINOR must not be used. ***"
98      echo "*** Use only 01 to 07 or 10 onwards, to avoid octal issues. ***"
99      echo "***"
100      exit 1
101    fi
102    
103  AC_SUBST(PCRE_MAJOR)  AC_SUBST(PCRE_MAJOR)
104  AC_SUBST(PCRE_MINOR)  AC_SUBST(PCRE_MINOR)
105  AC_SUBST(PCRE_PRERELEASE)  AC_SUBST(PCRE_PRERELEASE)
# Line 82  then Line 111  then
111    htmldir='${docdir}/html'    htmldir='${docdir}/html'
112  fi  fi
113    
114  # Handle --disable-cpp  # Handle --disable-pcre8 (enabled by default)
115    AC_ARG_ENABLE(pcre8,
116                  AS_HELP_STRING([--disable-pcre8],
117                                 [disable 8 bit character support]),
118                  , enable_pcre8=unset)
119    AC_SUBST(enable_pcre8)
120    
121    # Handle --enable-pcre16 (disabled by default)
122    AC_ARG_ENABLE(pcre16,
123                  AS_HELP_STRING([--enable-pcre16],
124                                 [enable 16 bit character support]),
125                  , enable_pcre16=unset)
126    AC_SUBST(enable_pcre16)
127    
128    # Handle --enable-pcre32 (disabled by default)
129    AC_ARG_ENABLE(pcre32,
130                  AS_HELP_STRING([--enable-pcre32],
131                                 [enable 32 bit character support]),
132                  , enable_pcre32=unset)
133    AC_SUBST(enable_pcre32)
134    
135    # Handle --disable-cpp. The substitution of enable_cpp is needed for use in
136    # pcre-config.
137  AC_ARG_ENABLE(cpp,  AC_ARG_ENABLE(cpp,
138                AS_HELP_STRING([--disable-cpp],                AS_HELP_STRING([--disable-cpp],
139                               [disable C++ support]),                               [disable C++ support]),
140                , enable_cpp=yes)                , enable_cpp=unset)
141    AC_SUBST(enable_cpp)
142    
143    # Handle --enable-jit (disabled by default)
144    AC_ARG_ENABLE(jit,
145                  AS_HELP_STRING([--enable-jit],
146                                 [enable Just-In-Time compiling support]),
147                  , enable_jit=no)
148    
149    # Handle --disable-pcregrep-jit (enabled by default)
150    AC_ARG_ENABLE(pcregrep-jit,
151                  AS_HELP_STRING([--disable-pcregrep-jit],
152                                 [disable JIT support in pcregrep]),
153                  , enable_pcregrep_jit=yes)
154    
155  # Handle --enable-rebuild-chartables  # Handle --enable-rebuild-chartables
156  AC_ARG_ENABLE(rebuild-chartables,  AC_ARG_ENABLE(rebuild-chartables,
# Line 97  AC_ARG_ENABLE(rebuild-chartables, Line 161  AC_ARG_ENABLE(rebuild-chartables,
161  # Handle --enable-utf8 (disabled by default)  # Handle --enable-utf8 (disabled by default)
162  AC_ARG_ENABLE(utf8,  AC_ARG_ENABLE(utf8,
163                AS_HELP_STRING([--enable-utf8],                AS_HELP_STRING([--enable-utf8],
164                               [enable UTF-8 support]),                               [another name for --enable-utf. Kept only for compatibility reasons]),
165                , enable_utf8=unset)                , enable_utf8=unset)
166    
167    # Handle --enable-utf (disabled by default)
168    AC_ARG_ENABLE(utf,
169                  AS_HELP_STRING([--enable-utf],
170                                 [enable UTF-8/16/32 support (incompatible with --enable-ebcdic)]),
171                  , enable_utf=unset)
172    
173  # Handle --enable-unicode-properties  # Handle --enable-unicode-properties
174  AC_ARG_ENABLE(unicode-properties,  AC_ARG_ENABLE(unicode-properties,
175                AS_HELP_STRING([--enable-unicode-properties],                AS_HELP_STRING([--enable-unicode-properties],
176                               [enable Unicode properties support (implies --enable-utf8)]),                               [enable Unicode properties support (implies --enable-utf)]),
177                , enable_unicode_properties=no)                , enable_unicode_properties=no)
178    
179  # 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  
180  ac_pcre_newline=lf  ac_pcre_newline=lf
181  AC_ARG_ENABLE(newline-is-cr,  AC_ARG_ENABLE(newline-is-cr,
182                AS_HELP_STRING([--enable-newline-is-cr],                AS_HELP_STRING([--enable-newline-is-cr],
# Line 136  AC_ARG_ENABLE(newline-is-any, Line 200  AC_ARG_ENABLE(newline-is-any,
200                ac_pcre_newline=any)                ac_pcre_newline=any)
201  enable_newline="$ac_pcre_newline"  enable_newline="$ac_pcre_newline"
202    
203    # Handle --enable-bsr-anycrlf
204    AC_ARG_ENABLE(bsr-anycrlf,
205                  AS_HELP_STRING([--enable-bsr-anycrlf],
206                                 [\R matches only CR, LF, CRLF by default]),
207                  , enable_bsr_anycrlf=no)
208    
209  # Handle --enable-ebcdic  # Handle --enable-ebcdic
210  AC_ARG_ENABLE(ebcdic,  AC_ARG_ENABLE(ebcdic,
211                AS_HELP_STRING([--enable-ebcdic],                AS_HELP_STRING([--enable-ebcdic],
212                               [assume EBCDIC coding rather than ASCII (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]),
213                , enable_ebcdic=no)                , enable_ebcdic=no)
214    
215    # Handle --enable-ebcdic-nl25
216    AC_ARG_ENABLE(ebcdic-nl25,
217                  AS_HELP_STRING([--enable-ebcdic-nl25],
218                                 [set EBCDIC code for NL to 0x25 instead of 0x15; it implies --enable-ebcdic]),
219                  , enable_ebcdic_nl25=no)
220    
221  # Handle --disable-stack-for-recursion  # Handle --disable-stack-for-recursion
222  AC_ARG_ENABLE(stack-for-recursion,  AC_ARG_ENABLE(stack-for-recursion,
223                AS_HELP_STRING([--disable-stack-for-recursion],                AS_HELP_STRING([--disable-stack-for-recursion],
224                               [don't use stack recursion when matching]),                               [don't use stack recursion when matching]),
225                , enable_stack_for_recursion=yes)                , enable_stack_for_recursion=yes)
226    
227    # Handle --enable-pcregrep-libz
228    AC_ARG_ENABLE(pcregrep-libz,
229                  AS_HELP_STRING([--enable-pcregrep-libz],
230                                 [link pcregrep with libz to handle .gz files]),
231                  , enable_pcregrep_libz=no)
232    
233    # Handle --enable-pcregrep-libbz2
234    AC_ARG_ENABLE(pcregrep-libbz2,
235                  AS_HELP_STRING([--enable-pcregrep-libbz2],
236                                 [link pcregrep with libbz2 to handle .bz2 files]),
237                  , enable_pcregrep_libbz2=no)
238    
239    # Handle --with-pcregrep-bufsize=N
240    AC_ARG_WITH(pcregrep-bufsize,
241                  AS_HELP_STRING([--with-pcregrep-bufsize=N],
242                                 [pcregrep buffer size (default=20480)]),
243                  , with_pcregrep_bufsize=20480)
244    
245    # Handle --enable-pcretest-libedit
246    AC_ARG_ENABLE(pcretest-libedit,
247                  AS_HELP_STRING([--enable-pcretest-libedit],
248                                 [link pcretest with libedit]),
249                  , enable_pcretest_libedit=no)
250    
251    # Handle --enable-pcretest-libreadline
252    AC_ARG_ENABLE(pcretest-libreadline,
253                  AS_HELP_STRING([--enable-pcretest-libreadline],
254                                 [link pcretest with libreadline]),
255                  , enable_pcretest_libreadline=no)
256    
257  # Handle --with-posix-malloc-threshold=NBYTES  # Handle --with-posix-malloc-threshold=NBYTES
258  AC_ARG_WITH(posix-malloc-threshold,  AC_ARG_WITH(posix-malloc-threshold,
259              AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES],              AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES],
# Line 179  AC_ARG_WITH(match-limit-recursion, Line 285  AC_ARG_WITH(match-limit-recursion,
285                             [default limit on internal recursion (default=MATCH_LIMIT)]),                             [default limit on internal recursion (default=MATCH_LIMIT)]),
286              , with_match_limit_recursion=MATCH_LIMIT)              , with_match_limit_recursion=MATCH_LIMIT)
287    
288  # Make sure that if enable_unicode_properties was set, that UTF-8 support  # Handle --enable-valgrind
289  # is enabled.  AC_ARG_ENABLE(valgrind,
290  #                AS_HELP_STRING([--enable-valgrind],
291                                 [valgrind support]),
292                  , enable_valgrind=no)
293    
294    # Enable code coverage reports using gcov
295    AC_ARG_ENABLE(coverage,
296                  AS_HELP_STRING([--enable-coverage],
297                                 [enable code coverage reports using gcov]),
298                  , enable_coverage=no)
299    
300    # Copy enable_utf8 value to enable_utf for compatibility reasons
301    if test "x$enable_utf8" != "xunset"
302    then
303      if test "x$enable_utf" != "xunset"
304      then
305        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.])
306      fi
307      enable_utf=$enable_utf8
308    fi
309    
310    # Set the default value for pcre8
311    if test "x$enable_pcre8" = "xunset"
312    then
313      enable_pcre8=yes
314    fi
315    
316    # Set the default value for pcre16
317    if test "x$enable_pcre16" = "xunset"
318    then
319      enable_pcre16=no
320    fi
321    
322    # Set the default value for pcre32
323    if test "x$enable_pcre32" = "xunset"
324    then
325      enable_pcre32=no
326    fi
327    
328    # Make sure enable_pcre8 or enable_pcre16 was set
329    if test "x$enable_pcre8$enable_pcre16$enable_pcre32" = "xnonono"
330    then
331      AC_MSG_ERROR([At least one of 8, 16 or 32 bit pcre library must be enabled])
332    fi
333    
334    # Make sure that if enable_unicode_properties was set, that UTF support is enabled.
335  if test "x$enable_unicode_properties" = "xyes"  if test "x$enable_unicode_properties" = "xyes"
336  then  then
337    if test "x$enable_utf8" = "xno"    if test "x$enable_utf" = "xno"
338    then    then
339      AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])      AC_MSG_ERROR([support for Unicode properties requires UTF-8/16/32 support])
340    fi    fi
341    enable_utf8=yes    enable_utf=yes
342  fi  fi
343    
344  if test "x$enable_utf8" = "xunset"  # enable_utf is disabled by default.
345    if test "x$enable_utf" = "xunset"
346  then  then
347    enable_utf8=no    enable_utf=no
348  fi  fi
349    
350  # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.  # enable_cpp copies the value of enable_pcre8 by default
351  #  if test "x$enable_cpp" = "xunset"
 if test "x$enable_ebcdic" = "xyes"  
352  then  then
353    enable_rebuild_chartables=yes    enable_cpp=$enable_pcre8
354  fi  fi
355    
356  # Convert the newline identifier into the appropriate integer value.  # Make sure that if enable_cpp was set, that enable_pcre8 support is enabled
357    if test "x$enable_cpp" = "xyes"
358    then
359      if test "x$enable_pcre8" = "xno"
360      then
361        AC_MSG_ERROR([C++ library requires pcre library with 8 bit characters])
362      fi
363    fi
364    
365    # Convert the newline identifier into the appropriate integer value. The first
366    # three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they
367    # are changed below.
368    
369  case "$enable_newline" in  case "$enable_newline" in
370    lf)      ac_pcre_newline_value=10   ;;    lf)      ac_pcre_newline_value=10   ;;
371    cr)      ac_pcre_newline_value=13   ;;    cr)      ac_pcre_newline_value=13   ;;
# Line 215  case "$enable_newline" in Line 377  case "$enable_newline" in
377    ;;    ;;
378  esac  esac
379    
380    # --enable-ebcdic-nl25 implies --enable-ebcdic
381    if test "x$enable_ebcdic_nl25" = "xyes"; then
382      enable_ebcdic=yes
383    fi
384    
385    # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled,
386    # and the newline value is adjusted appropriately (CR is still 13, but LF is
387    # 21 or 37). Also check that UTF support is not requested, because PCRE cannot
388    # handle EBCDIC and UTF in the same build. To do so it would need to use
389    # different character constants depending on the mode.
390    #
391    if test "x$enable_ebcdic" = "xyes"; then
392      enable_rebuild_chartables=yes
393    
394      if test "x$enable_utf" = "xyes"; then
395        AC_MSG_ERROR([support for EBCDIC and UTF-8/16/32 cannot be enabled at the same time])
396      fi
397    
398      if test "x$enable_ebcdic_nl25" = "xno"; then
399        case "$ac_pcre_newline_value" in
400          10)   ac_pcre_newline_value=21 ;;
401          3338) ac_pcre_newline_value=3349 ;;
402        esac
403      else
404        case "$ac_pcre_newline_value" in
405          10)   ac_pcre_newline_value=37 ;;
406          3338) ac_pcre_newline_value=3365 ;;
407        esac
408      fi
409    fi
410    
411  # Check argument to --with-link-size  # Check argument to --with-link-size
412  case "$with_link_size" in  case "$with_link_size" in
413    2|3|4) ;;    2|3|4) ;;
# Line 224  case "$with_link_size" in Line 417  case "$with_link_size" in
417  esac  esac
418    
419  AH_TOP([  AH_TOP([
420  /* 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
421  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"
422  Standard C, but there are a few non-standard things it can cope with, allowing  systems.
423  it to run on SunOS4 and other "close to standard" systems.  
424    In environments that support the facilities, config.h.in is converted by
425  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
426  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
427  macros the way you need them. Alternatively, you can avoid editing by using -D  should copy the distributed config.h.generic to config.h, and then edit the
428  on the compiler command line to set the macro values.  macro definitions to be the way you need them. You must then add
429    -DHAVE_CONFIG_H to all of your compile commands, so that config.h is included
430    at the start of every source.
431    
432    Alternatively, you can avoid editing by using -D on the compiler command line
433    to set the macro values. In this case, you do not have to set -DHAVE_CONFIG_H.
434    
435  PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if  PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if
436  HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set  HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set
# Line 249  if test "x$enable_cpp" = "xyes" -a -n "$ Line 447  if test "x$enable_cpp" = "xyes" -a -n "$
447  then  then
448  AC_LANG_PUSH(C++)  AC_LANG_PUSH(C++)
449    
450    # Older versions of pcre defined pcrecpp::no_arg, but in new versions
451    # it's called pcrecpp::RE::no_arg.  For backwards ABI compatibility,
452    # we want to make one an alias for the other.  Different systems do
453    # this in different ways.  Some systems, for instance, can do it via
454    # a linker flag: -alias (for os x 10.5) or -i (for os x <=10.4).
455    OLD_LDFLAGS="$LDFLAGS"
456    for flag in "-alias,__ZN7pcrecpp2RE6no_argE,__ZN7pcrecpp6no_argE" \
457                "-i__ZN7pcrecpp6no_argE:__ZN7pcrecpp2RE6no_argE"; do
458      AC_MSG_CHECKING([for alias support in the linker])
459      LDFLAGS="$OLD_LDFLAGS -Wl,$flag"
460      # We try to run the linker with this new ld flag.  If the link fails,
461      # we give up and remove the new flag from LDFLAGS.
462      AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace pcrecpp {
463                                        class RE { static int no_arg; };
464                                        int RE::no_arg;
465                                      }],
466                                     [])],
467                     [AC_MSG_RESULT([yes]);
468                      EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";
469                      break;],
470                     AC_MSG_RESULT([no]))
471    done
472    LDFLAGS="$OLD_LDFLAGS"
473    
474  # We could be more clever here, given we're doing AC_SUBST with this  # We could be more clever here, given we're doing AC_SUBST with this
475  # (eg set a var to be the name of the include file we want). But we're not  # (eg set a var to be the name of the include file we want). But we're not
476  # so it's easy to change back to 'regular' autoconf vars if we needed to.  # so it's easy to change back to 'regular' autoconf vars if we needed to.
# Line 258  AC_CHECK_HEADERS(bits/type_traits.h, [pc Line 480  AC_CHECK_HEADERS(bits/type_traits.h, [pc
480                                       [pcre_have_bits_type_traits="0"])                                       [pcre_have_bits_type_traits="0"])
481  AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],  AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],
482                                  [pcre_have_type_traits="0"])                                  [pcre_have_type_traits="0"])
483    
484    # (This isn't c++-specific, but is only used in pcrecpp.cc, so try this
485    # in a c++ context.  This matters becuase strtoimax is C99 and may not
486    # be supported by the C++ compiler.)
487    # Figure out how to create a longlong from a string: strtoll and
488    # equiv.  It's not enough to call AC_CHECK_FUNCS: hpux has a
489    # strtoll, for instance, but it only takes 2 args instead of 3!
490    # We have to call AH_TEMPLATE since AC_DEFINE_UNQUOTED below is complex.
491    AH_TEMPLATE(HAVE_STRTOQ, [Define to 1 if you have `strtoq'.])
492    AH_TEMPLATE(HAVE_STRTOLL, [Define to 1 if you have `strtoll'.])
493    AH_TEMPLATE(HAVE__STRTOI64, [Define to 1 if you have `_strtoi64'.])
494    AH_TEMPLATE(HAVE_STRTOIMAX, [Define to 1 if you have `strtoimax'.])
495    have_strto_fn=0
496    for fn in strtoq strtoll _strtoi64 strtoimax; do
497      AC_MSG_CHECKING([for $fn])
498      if test "$fn" = strtoimax; then
499        include=stdint.h
500      else
501        include=stdlib.h
502      fi
503      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$include>],
504                                        [char* e; return $fn("100", &e, 10)])],
505                        [AC_MSG_RESULT(yes)
506                         AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1,
507                                            [Define to 1 if you have `$fn'.])
508                         have_strto_fn=1
509                         break],
510                        [AC_MSG_RESULT(no)])
511    done
512    
513    if test "$have_strto_fn" = 1; then
514      AC_CHECK_TYPES([long long],
515                     [pcre_have_long_long="1"],
516                     [pcre_have_long_long="0"])
517      AC_CHECK_TYPES([unsigned long long],
518                     [pcre_have_ulong_long="1"],
519                     [pcre_have_ulong_long="0"])
520    else
521      pcre_have_long_long="0"
522      pcre_have_ulong_long="0"
523    fi
524    AC_SUBST(pcre_have_long_long)
525    AC_SUBST(pcre_have_ulong_long)
526    
527  AC_LANG_POP  AC_LANG_POP
528  fi  fi
529  # Using AC_SUBST eliminates the need to include config.h in a public .h file  # Using AC_SUBST eliminates the need to include config.h in a public .h file
# Line 265  AC_SUBST(pcre_have_type_traits) Line 531  AC_SUBST(pcre_have_type_traits)
531  AC_SUBST(pcre_have_bits_type_traits)  AC_SUBST(pcre_have_bits_type_traits)
532    
533  # Conditional compilation  # Conditional compilation
534    AM_CONDITIONAL(WITH_PCRE8, test "x$enable_pcre8" = "xyes")
535    AM_CONDITIONAL(WITH_PCRE16, test "x$enable_pcre16" = "xyes")
536    AM_CONDITIONAL(WITH_PCRE32, test "x$enable_pcre32" = "xyes")
537  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
538  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
539    AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
540    AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")
541    AM_CONDITIONAL(WITH_VALGRIND, test "x$enable_valgrind" = "xyes")
542    
543  # Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
544    
545  AC_C_CONST  AC_C_CONST
546  AC_TYPE_SIZE_T  AC_TYPE_SIZE_T
547    
 AC_CHECK_TYPES([long long],  
                [pcre_have_long_long="1"],  
                [pcre_have_long_long="0"])  
 AC_CHECK_TYPES([unsigned long long],  
                [pcre_have_ulong_long="1"],  
                [pcre_have_ulong_long="0"])  
 AC_SUBST(pcre_have_long_long)  
 AC_SUBST(pcre_have_ulong_long)  
   
548  # Checks for library functions.  # Checks for library functions.
549    
550  AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll)  AC_CHECK_FUNCS(bcopy memmove strerror)
551    
552    # Check for the availability of libz (aka zlib)
553    
554    AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1])
555    AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1])
556    
557    # Check for the availability of libbz2. Originally we just used AC_CHECK_LIB,
558    # as for libz. However, this had the following problem, diagnosed and fixed by
559    # a user:
560    #
561    #   - libbz2 uses the Pascal calling convention (WINAPI) for the functions
562    #     under Win32.
563    #   - The standard autoconf AC_CHECK_LIB fails to include "bzlib.h",
564    #     therefore missing the function definition.
565    #   - The compiler thus generates a "C" signature for the test function.
566    #   - The linker fails to find the "C" function.
567    #   - PCRE fails to configure if asked to do so against libbz2.
568    #
569    # Solution:
570    #
571    #   - Replace the AC_CHECK_LIB test with a custom test.
572    
573    AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1])
574    # Original test
575    # AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1])
576    #
577    # Custom test follows
578    
579    AC_MSG_CHECKING([for libbz2])
580    OLD_LIBS="$LIBS"
581    LIBS="$LIBS -lbz2"
582    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
583    #ifdef HAVE_BZLIB_H
584    #include <bzlib.h>
585    #endif]],
586    [[return (int)BZ2_bzopen("conftest", "rb");]])],
587    [AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;],
588    AC_MSG_RESULT([no]))
589    LIBS="$OLD_LIBS"
590    
591    # Check for the availabiity of libreadline
592    
593    if test "$enable_pcretest_libreadline" = "yes"; then
594     AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
595     AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
596     AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"],
597       [unset ac_cv_lib_readline_readline;
598        AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"],
599         [unset ac_cv_lib_readline_readline;
600          AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"],
601           [unset ac_cv_lib_readline_readline;
602            AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"],
603             [unset ac_cv_lib_readline_readline;
604              AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"],
605               [unset ac_cv_lib_readline_readline;
606                AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"],
607                 [LIBREADLINE=""],
608                 [-ltermcap])],
609               [-lncursesw])],
610             [-lncurses])],
611           [-lcurses])],
612         [-ltinfo])])
613     AC_SUBST(LIBREADLINE)
614     if test -n "$LIBREADLINE"; then
615       if test "$LIBREADLINE" != "-lreadline"; then
616         echo "-lreadline needs $LIBREADLINE"
617         LIBREADLINE="-lreadline $LIBREADLINE"
618       fi
619     fi
620    fi
621    
622    
623    # Check for the availability of libedit. Different distributions put its
624    # headers in different places. Try to cover the most common ones.
625    
626    if test "$enable_pcretest_libedit" = "yes"; then
627      AC_CHECK_HEADERS([editline/readline.h], [HAVE_EDITLINE_READLINE_H=1],
628        [AC_CHECK_HEADERS([edit/readline/readline.h], [HAVE_READLINE_READLINE_H=1],
629          [AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_READLINE_H=1])])])
630      AC_CHECK_LIB([edit], [readline], [LIBEDIT="-ledit"])
631    fi
632    
633  # This facilitates -ansi builds under Linux  # This facilitates -ansi builds under Linux
634  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
635    
636    PCRE_STATIC_CFLAG=""
637  if test "x$enable_shared" = "xno" ; then  if test "x$enable_shared" = "xno" ; then
638    AC_DEFINE([PCRE_STATIC], [1], [    AC_DEFINE([PCRE_STATIC], [1], [
639      Define if linking statically (TODO: make nice with Libtool)])      Define to any value if linking statically (TODO: make nice with Libtool)])
640      PCRE_STATIC_CFLAG="-DPCRE_STATIC"
641  fi  fi
642    AC_SUBST(PCRE_STATIC_CFLAG)
643    
644  # Here is where pcre specific defines are handled  # Here is where pcre specific defines are handled
645    
646  if test "$enable_utf8" = "yes"; then  if test "$enable_pcre8" = "yes"; then
647    AC_DEFINE([SUPPORT_UTF8], [], [    AC_DEFINE([SUPPORT_PCRE8], [], [
648      Define to enable support for the UTF-8 Unicode encoding.])      Define to any value to enable the 8 bit PCRE library.])
649    fi
650    
651    if test "$enable_pcre16" = "yes"; then
652      AC_DEFINE([SUPPORT_PCRE16], [], [
653        Define to any value to enable the 16 bit PCRE library.])
654    fi
655    
656    if test "$enable_pcre32" = "yes"; then
657      AC_DEFINE([SUPPORT_PCRE32], [], [
658        Define to any value to enable the 32 bit PCRE library.])
659    fi
660    
661    if test "$enable_jit" = "yes"; then
662      AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])])
663      CC="$PTHREAD_CC"
664      CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
665      LIBS="$PTHREAD_LIBS $LIBS"
666      AC_DEFINE([SUPPORT_JIT], [], [
667        Define to any value to enable support for Just-In-Time compiling.])
668    else
669      enable_pcregrep_jit="no"
670    fi
671    
672    if test "$enable_pcregrep_jit" = "yes"; then
673      AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [
674        Define to any value to enable JIT support in pcregrep.])
675    fi
676    
677    if test "$enable_utf" = "yes"; then
678      AC_DEFINE([SUPPORT_UTF], [], [
679        Define to any value to enable support for the UTF-8/16/32 Unicode encoding.
680        This will work even in an EBCDIC environment, but it is incompatible
681        with the EBCDIC macro. That is, PCRE can support *either* EBCDIC
682        code *or* ASCII/UTF-8/16/32, but not both at once.])
683  fi  fi
684    
685  if test "$enable_unicode_properties" = "yes"; then  if test "$enable_unicode_properties" = "yes"; then
686    AC_DEFINE([SUPPORT_UCP], [], [    AC_DEFINE([SUPPORT_UCP], [], [
687      Define to enable support for Unicode properties])      Define to any value to enable support for Unicode properties.])
688  fi  fi
689    
690  if test "$enable_stack_for_recursion" = "no"; then  if test "$enable_stack_for_recursion" = "no"; then
691    AC_DEFINE([NO_RECURSE], [], [    AC_DEFINE([NO_RECURSE], [], [
692      PCRE uses recursive function calls to handle backtracking while      PCRE uses recursive function calls to handle backtracking while
693      matching. This can sometimes be a problem on systems that have      matching. This can sometimes be a problem on systems that have
694      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
695      doesn't use recursion in the match() function; instead it creates      version that doesn't use recursion in the match() function; instead
696      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
697      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
698      just above the match() function. On systems that support it,      just above the match() function.])
699      "configure" can be used to set this in the Makefile  fi
700      (use --disable-stack-for-recursion).])  
701    if test "$enable_pcregrep_libz" = "yes"; then
702      AC_DEFINE([SUPPORT_LIBZ], [], [
703        Define to any value to allow pcregrep to be linked with libz, so that it is
704        able to handle .gz files.])
705    fi
706    
707    if test "$enable_pcregrep_libbz2" = "yes"; then
708      AC_DEFINE([SUPPORT_LIBBZ2], [], [
709        Define to any value to allow pcregrep to be linked with libbz2, so that it
710        is able to handle .bz2 files.])
711    fi
712    
713    if test $with_pcregrep_bufsize -lt 8192 ; then
714      with_pcregrep_bufsize="8192"
715    fi
716    
717    AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [
718      The value of PCREGREP_BUFSIZE determines the size of buffer used by pcregrep
719      to hold parts of the file it is searching. This is also the minimum value.
720      The actual amount of memory used by pcregrep is three times this number,
721      because it allows for the buffering of "before" and "after" lines.])
722    
723    if test "$enable_pcretest_libedit" = "yes"; then
724      AC_DEFINE([SUPPORT_LIBEDIT], [], [
725        Define to any value to allow pcretest to be linked with libedit.])
726      LIBREADLINE="$LIBEDIT"
727    elif test "$enable_pcretest_libreadline" = "yes"; then
728      AC_DEFINE([SUPPORT_LIBREADLINE], [], [
729        Define to any value to allow pcretest to be linked with libreadline.])
730  fi  fi
731    
732  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
733    The value of NEWLINE determines the newline character sequence. On    The value of NEWLINE determines the default newline character sequence. PCRE
734    Unix-like systems, "configure" can be used to override the default,    client programs can override this by selecting other values at run time. In
735    which is 10. The possible values are 10 (LF), 13 (CR), 3338 (CRLF),    ASCII environments, the value can be 10 (LF), 13 (CR), or 3338 (CRLF); in
736    -1 (ANY), or -2 (ANYCRLF).])    EBCDIC environments the value can be 21 or 37 (LF), 13 (CR), or 3349 or 3365
737      (CRLF) because there are two alternative codepoints (0x15 and 0x25) that are
738      used as the NL line terminator that is equivalent to ASCII LF. In both ASCII
739      and EBCDIC environments the value can also be -1 (ANY), or -2 (ANYCRLF).])
740    
741    if test "$enable_bsr_anycrlf" = "yes"; then
742      AC_DEFINE([BSR_ANYCRLF], [], [
743        By default, the \R escape sequence matches any Unicode line ending
744        character or sequence of characters. If BSR_ANYCRLF is defined (to any
745        value), this is changed so that backslash-R matches only CR, LF, or CRLF.
746        The build-time default can be overridden by the user of PCRE at runtime.])
747    fi
748    
749  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [
750    The value of LINK_SIZE determines the number of bytes used to store    The value of LINK_SIZE determines the number of bytes used to store
751    links as offsets within the compiled regex. The default is 2, which    links as offsets within the compiled regex. The default is 2, which
752    allows for compiled patterns up to 64K long. This covers the vast    allows for compiled patterns up to 64K long. This covers the vast
753    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
754    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.])  
755    
756  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [
757    When calling PCRE via the POSIX interface, additional working storage    When calling PCRE via the POSIX interface, additional working storage
# Line 340  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHO Line 760  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHO
760    interface provides only two. If the number of expected substrings is    interface provides only two. If the number of expected substrings is
761    small, the wrapper function uses space on the stack, because this is    small, the wrapper function uses space on the stack, because this is
762    faster than using malloc() for each call. The threshold above which    faster than using malloc() for each call. The threshold above which
763    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.])  
764    
765  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [
766    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 351  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with Line 769  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with
769    limit. The limit exists in order to catch runaway regular    limit. The limit exists in order to catch runaway regular
770    expressions that take for ever to determine that they do not match.    expressions that take for ever to determine that they do not match.
771    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
772    legitimate cases. On systems that support it, "configure" can be    legitimate cases.])
   used to override this default default.])  
773    
774  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [
775    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 363  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSIO Line 780  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSIO
780    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
781    have any useful effect, it must be less than the value of    have any useful effect, it must be less than the value of
782    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.
783    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.])  
784    
785  AC_DEFINE([MAX_NAME_SIZE], [32], [  AC_DEFINE([MAX_NAME_SIZE], [32], [
786    This limit is parameterized just in case anybody ever wants to    This limit is parameterized just in case anybody ever wants to
# Line 376  AC_DEFINE([MAX_NAME_COUNT], [10000], [ Line 792  AC_DEFINE([MAX_NAME_COUNT], [10000], [
792    change it. Care must be taken if it is increased, because it guards    change it. Care must be taken if it is increased, because it guards
793    against integer overflow caused by enormously large patterns.])    against integer overflow caused by enormously large patterns.])
794    
 AC_DEFINE([MAX_DUPLENGTH], [30000], [  
   This limit is parameterized just in case anybody ever wants to  
   change it. Care must be taken if it is increased, because it guards  
   against integer overflow caused by enormously large patterns.])  
   
795  AH_VERBATIM([PCRE_EXP_DEFN], [  AH_VERBATIM([PCRE_EXP_DEFN], [
796  /* 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
797     Win32, and it needs some magic to be inserted before the definition     Win32, and it needs some magic to be inserted before the definition
798     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
799     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
800     defaults to "extern" for a C compiler and "extern C" for a C++      __declspec value is used for Windows systems; in other environments
801     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.
802     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
803     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"
804     which are internal to the library. */     in the C sense, but which are internal to the library. */
805  #undef PCRE_EXP_DEFN])  #undef PCRE_EXP_DEFN])
806    
807  if test "$enable_ebcdic" = "yes"; then  if test "$enable_ebcdic" = "yes"; then
808    AC_DEFINE_UNQUOTED([EBCDIC], [], [    AC_DEFINE_UNQUOTED([EBCDIC], [], [
809      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
810      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
811      "configure", this can be done via --enable-ebcdic.])      NEWLINE macro below to set a suitable EBCDIC newline, commonly 21 (0x15).
812        On systems that can use "configure" or CMake to set EBCDIC, NEWLINE is
813        automatically adjusted. When EBCDIC is set, PCRE assumes that all input
814        strings are in EBCDIC. If you do not define this macro, PCRE will assume
815        input strings are ASCII or UTF-8/16/32 Unicode. It is not possible to build
816        a version of PCRE that supports both EBCDIC and UTF-8/16/32.])
817    fi
818    
819    if test "$enable_ebcdic_nl25" = "yes"; then
820      AC_DEFINE_UNQUOTED([EBCDIC_NL25], [], [
821        In an EBCDIC environment, define this macro to any value to arrange for
822        the NL character to be 0x25 instead of the default 0x15. NL plays the role
823        that LF does in an ASCII/Unicode environment. The value must also be set in
824        the NEWLINE macro below. On systems that can use "configure" or CMake to
825        set EBCDIC_NL25, the adjustment of NEWLINE is automatic.])
826    fi
827    
828    if test "$enable_valgrind" = "yes"; then
829      AC_DEFINE_UNQUOTED([SUPPORT_VALGRIND], [], [
830         Valgrind support to find invalid memory reads.])
831  fi  fi
832    
833  # Platform specific issues  # Platform specific issues
# Line 415  esac Line 845  esac
845  # The extra LDFLAGS for each particular library  # The extra LDFLAGS for each particular library
846  # (Note: The libpcre*_version bits are m4 variables, assigned above)  # (Note: The libpcre*_version bits are m4 variables, assigned above)
847    
848  EXTRA_LIBPCRE_LDFLAGS="$NO_UNDEFINED -version-info libpcre_version"  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \
849                           $NO_UNDEFINED -version-info libpcre_version"
850    
851    EXTRA_LIBPCRE16_LDFLAGS="$EXTRA_LIBPCRE16_LDFLAGS \
852                           $NO_UNDEFINED -version-info libpcre16_version"
853    
854  EXTRA_LIBPCREPOSIX_LDFLAGS="$NO_UNDEFINED -version-info libpcreposix_version"  EXTRA_LIBPCRE32_LDFLAGS="$EXTRA_LIBPCRE32_LDFLAGS \
855                           $NO_UNDEFINED -version-info libpcre32_version"
856    
857  EXTRA_LIBPCRECPP_LDFLAGS="$NO_UNDEFINED $EXPORT_ALL_SYMBOLS -version-info libpcrecpp_version"  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \
858                                $NO_UNDEFINED -version-info libpcreposix_version"
859    
860    EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS \
861                              $NO_UNDEFINED -version-info libpcrecpp_version \
862                              $EXPORT_ALL_SYMBOLS"
863    
864  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
865    AC_SUBST(EXTRA_LIBPCRE16_LDFLAGS)
866    AC_SUBST(EXTRA_LIBPCRE32_LDFLAGS)
867  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
868  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
869    
870  # When we run 'make distcheck', use these arguments.  # When we run 'make distcheck', use these arguments. Turning off compiler
871  DISTCHECK_CONFIGURE_FLAGS="--enable-cpp --enable-unicode-properties"  # optimization makes it run faster.
872    DISTCHECK_CONFIGURE_FLAGS="CFLAGS='' CXXFLAGS='' --enable-pcre16 --enable-pcre32 --enable-jit --enable-cpp --enable-unicode-properties"
873  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
874    
875    # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
876    # specified, the relevant library is available.
877    
878    if test "$enable_pcregrep_libz" = "yes"; then
879      if test "$HAVE_ZLIB_H" != "1"; then
880        echo "** Cannot --enable-pcregrep-libz because zlib.h was not found"
881        exit 1
882      fi
883      if test "$HAVE_LIBZ" != "1"; then
884        echo "** Cannot --enable-pcregrep-libz because libz was not found"
885        exit 1
886      fi
887      LIBZ="-lz"
888    fi
889    AC_SUBST(LIBZ)
890    
891    if test "$enable_pcregrep_libbz2" = "yes"; then
892      if test "$HAVE_BZLIB_H" != "1"; then
893        echo "** Cannot --enable-pcregrep-libbz2 because bzlib.h was not found"
894        exit 1
895      fi
896      if test "$HAVE_LIBBZ2" != "1"; then
897        echo "** Cannot --enable-pcregrep-libbz2 because libbz2 was not found"
898        exit 1
899      fi
900      LIBBZ2="-lbz2"
901    fi
902    AC_SUBST(LIBBZ2)
903    
904    # Similarly for --enable-pcretest-readline
905    
906    if test "$enable_pcretest_libedit" = "yes"; then
907      if test "$enable_pcretest_libreadline" = "yes"; then
908        echo "** Cannot use both --enable-pcretest-libedit and --enable-pcretest-readline"
909        exit 1
910      fi
911      if test "$HAVE_EDITLINE_READLINE_H" != "1" -a \
912              "$HAVE_READLINE_READLINE_H" != "1"; then
913        echo "** Cannot --enable-pcretest-libedit because neither editline/readline.h"
914        echo "** nor readline/readline.h was found."
915        exit 1
916      fi
917      if test -z "$LIBEDIT"; then
918        echo "** Cannot --enable-pcretest-libedit because libedit library was not found."
919        exit 1
920      fi
921    fi
922    
923    if test "$enable_pcretest_libreadline" = "yes"; then
924      if test "$HAVE_READLINE_H" != "1"; then
925        echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found."
926        exit 1
927      fi
928      if test "$HAVE_HISTORY_H" != "1"; then
929        echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
930        exit 1
931      fi
932      if test -z "$LIBREADLINE"; then
933        echo "** Cannot --enable-pcretest-readline because readline library was not found."
934        exit 1
935      fi
936    fi
937    
938    # Check for valgrind
939    
940    if test "$enable_valgrind" = "yes"; then
941      m4_ifdef([PKG_CHECK_MODULES],
942               [PKG_CHECK_MODULES([VALGRIND],[valgrind])],
943               [AC_MSG_ERROR([pkg-config not supported])])
944    fi
945    
946    # test code coverage reporting
947    if test "$enable_coverage" = "yes"; then
948      if test "x$GCC" != "xyes"; then
949        AC_MSG_ERROR([Code coverage reports can only be generated when using GCC])
950      fi
951    
952      # ccache is incompatible with gcov
953      AC_PATH_PROG([SHTOOL],[shtool],[false])
954      case `$SHTOOL path $CC` in
955        *ccache*) cc_ccache=yes;;
956        *) cc_ccache=no;;
957      esac
958    
959      if test "$cc_ccache" = "yes"; then
960        if test -z "$CCACHE_DISABLE" -o "$CCACHE_DISABLE" != "1"; then
961          AC_MSG_ERROR([must export CCACHE_DISABLE=1 to disable ccache for code coverage])
962        fi
963      fi
964    
965      AC_ARG_VAR([LCOV],[the ltp lcov program])
966      AC_PATH_PROG([LCOV],[lcov],[false])
967      if test "x$LCOV" = "xfalse"; then
968        AC_MSG_ERROR([lcov not found])
969      fi
970    
971      AC_ARG_VAR([GENHTML],[the ltp genhtml program])
972      AC_PATH_PROG([GENHTML],[genhtml],[false])
973      if test "x$GENHTML" = "xfalse"; then
974        AC_MSG_ERROR([genhtml not found])
975      fi
976    
977      AC_DEFINE([SUPPORT_GCOV],[1], [
978        Define to allow pcretest and pcregrep to be linked with gcov, so that they
979        are able to generate code coverage reports.])
980    
981      # And add flags needed for gcov
982      GCOV_CFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
983      GCOV_CXXFLAGS="-O0 -ggdb3 -fprofile-arcs -ftest-coverage"
984      GCOV_LIBS="-lgcov"
985      AC_SUBST([GCOV_CFLAGS])
986      AC_SUBST([GCOV_CXXFLAGS])
987      AC_SUBST([GCOV_LIBS])
988    fi # enable_coverage
989    
990    AM_CONDITIONAL([WITH_GCOV],[test "x$enable_coverage" = "xyes"])
991    
992  # Produce these files, in addition to config.h.  # Produce these files, in addition to config.h.
993  AC_CONFIG_FILES(  AC_CONFIG_FILES(
994          Makefile          Makefile
995          libpcre.pc          libpcre.pc
996            libpcre16.pc
997            libpcre32.pc
998            libpcreposix.pc
999          libpcrecpp.pc          libpcrecpp.pc
1000          pcre-config          pcre-config
1001          pcre.h          pcre.h
# Line 449  AC_CONFIG_COMMANDS([delete-old-chartable Line 1012  AC_CONFIG_COMMANDS([delete-old-chartable
1012    
1013  AC_OUTPUT  AC_OUTPUT
1014    
1015  # Print out a nice little message after configure is run displaying your  # Print out a nice little message after configure is run displaying the
1016  # chosen options.  # chosen options.
1017  #  
1018    ebcdic_nl_code=n/a
1019    if test "$enable_ebcdic_nl25" = "yes"; then
1020      ebcdic_nl_code=0x25
1021    elif test "$enable_ebcdic" = "yes"; then
1022      ebcdic_nl_code=0x15
1023    fi
1024    
1025  cat <<EOF  cat <<EOF
1026    
1027  $PACKAGE-$VERSION configuration summary:  $PACKAGE-$VERSION configuration summary:
1028    
1029      Install prefix ......... : ${prefix}      Install prefix .................. : ${prefix}
1030      C preprocessor ......... : ${CPP}      C preprocessor .................. : ${CPP}
1031      C compiler ............. : ${CC}      C compiler ...................... : ${CC}
1032      C++ preprocessor ....... : ${CXXCPP}      C++ preprocessor ................ : ${CXXCPP}
1033      C++ compiler ........... : ${CXX}      C++ compiler .................... : ${CXX}
1034      Linker ................. : ${LD}      Linker .......................... : ${LD}
1035      C preprocessor flags ... : ${CPPFLAGS}      C preprocessor flags ............ : ${CPPFLAGS}
1036      C compiler flags ....... : ${CFLAGS}      C compiler flags ................ : ${CFLAGS}
1037      C++ compiler flags ..... : ${CXXFLAGS}      C++ compiler flags .............. : ${CXXFLAGS}
1038      Linker flags ........... : ${LDFLAGS}      Linker flags .................... : ${LDFLAGS}
1039      Extra libraries ........ : ${LIBS}      Extra libraries ................. : ${LIBS}
1040    
1041      Build C++ library ...... : ${enable_cpp}      Build 8 bit pcre library ........ : ${enable_pcre8}
1042      Enable UTF-8 support ... : ${enable_utf8}      Build 16 bit pcre library ....... : ${enable_pcre16}
1043      Unicode properties ..... : ${enable_unicode_properties}      Build 32 bit pcre library ....... : ${enable_pcre32}
1044      Newline char/sequence .. : ${enable_newline}      Build C++ library ............... : ${enable_cpp}
1045      EBCDIC coding .......... : ${enable_ebcdic}      Enable JIT compiling support .... : ${enable_jit}
1046      Rebuild char tables .... : ${enable_rebuild_chartables}      Enable UTF-8/16/32 support ...... : ${enable_utf}
1047      Use stack recursion .... : ${enable_stack_for_recursion}      Unicode properties .............. : ${enable_unicode_properties}
1048      POSIX mem threshold .... : ${with_posix_malloc_threshold}      Newline char/sequence ........... : ${enable_newline}
1049      Internal link size ..... : ${with_link_size}      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
1050      Match limit ............ : ${with_match_limit}      EBCDIC coding ................... : ${enable_ebcdic}
1051      Match limit recursion .. : ${with_match_limit_recursion}      EBCDIC code for NL .............. : ${ebcdic_nl_code}
1052      Build shared libs ...... : ${enable_shared}      Rebuild char tables ............. : ${enable_rebuild_chartables}
1053      Build static libs ...... : ${enable_static}      Use stack recursion ............. : ${enable_stack_for_recursion}
1054        POSIX mem threshold ............. : ${with_posix_malloc_threshold}
1055        Internal link size .............. : ${with_link_size}
1056        Match limit ..................... : ${with_match_limit}
1057        Match limit recursion ........... : ${with_match_limit_recursion}
1058        Build shared libs ............... : ${enable_shared}
1059        Build static libs ............... : ${enable_static}
1060        Use JIT in pcregrep ............. : ${enable_pcregrep_jit}
1061        Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}
1062        Link pcregrep with libz ......... : ${enable_pcregrep_libz}
1063        Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
1064        Link pcretest with libedit ...... : ${enable_pcretest_libedit}
1065        Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
1066        Valgrind support ................ : ${enable_valgrind}
1067        Code coverage ................... : ${enable_coverage}
1068    
1069  EOF  EOF
1070    

Legend:
Removed from v.172  
changed lines
  Added in v.1163

  ViewVC Help
Powered by ViewVC 1.1.5