/[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 367 by ph10, Sun Aug 24 11:25:07 2008 UTC revision 1151 by chpe, Sun Oct 21 16:53:46 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.
 dnl empty.  
7    
8  m4_define(pcre_major, [7])  dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might
9  m4_define(pcre_minor, [8])  dnl be defined as -RC2, for example. For real releases, it should be empty.
10    
11    m4_define(pcre_major, [8])
12    m4_define(pcre_minor, [32])
13  m4_define(pcre_prerelease, [-RC1])  m4_define(pcre_prerelease, [-RC1])
14  m4_define(pcre_date, [2008-08-25])  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 63  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
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 76  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 87  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 102  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 150  AC_ARG_ENABLE(bsr-anycrlf, Line 209  AC_ARG_ENABLE(bsr-anycrlf,
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; use this 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]),
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],
# Line 171  AC_ARG_ENABLE(pcregrep-libbz2, Line 236  AC_ARG_ENABLE(pcregrep-libbz2,
236                               [link pcregrep with libbz2 to handle .bz2 files]),                               [link pcregrep with libbz2 to handle .bz2 files]),
237                , enable_pcregrep_libbz2=no)                , 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  # Handle --enable-pcretest-libreadline
252  AC_ARG_ENABLE(pcretest-libreadline,  AC_ARG_ENABLE(pcretest-libreadline,
253                AS_HELP_STRING([--enable-pcretest-libreadline],                AS_HELP_STRING([--enable-pcretest-libreadline],
# Line 208  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    # Copy enable_utf8 value to enable_utf for compatibility reasons
295    if test "x$enable_utf8" != "xunset"
296    then
297      if test "x$enable_utf" != "xunset"
298      then
299        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.])
300      fi
301      enable_utf=$enable_utf8
302    fi
303    
304    # Set the default value for pcre8
305    if test "x$enable_pcre8" = "xunset"
306    then
307      enable_pcre8=yes
308    fi
309    
310    # Set the default value for pcre16
311    if test "x$enable_pcre16" = "xunset"
312    then
313      enable_pcre16=no
314    fi
315    
316    # Set the default value for pcre32
317    if test "x$enable_pcre32" = "xunset"
318    then
319      enable_pcre32=no
320    fi
321    
322    # Make sure enable_pcre8 or enable_pcre16 was set
323    if test "x$enable_pcre8$enable_pcre16$enable_pcre32" = "xnonono"
324    then
325      AC_MSG_ERROR([At least one of 8, 16 or 32 bit pcre library must be enabled])
326    fi
327    
328    # Make sure that if enable_unicode_properties was set, that UTF support is enabled.
329  if test "x$enable_unicode_properties" = "xyes"  if test "x$enable_unicode_properties" = "xyes"
330  then  then
331    if test "x$enable_utf8" = "xno"    if test "x$enable_utf" = "xno"
332    then    then
333      AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])      AC_MSG_ERROR([support for Unicode properties requires UTF-8/16/32 support])
334    fi    fi
335    enable_utf8=yes    enable_utf=yes
336  fi  fi
337    
338  if test "x$enable_utf8" = "xunset"  # enable_utf is disabled by default.
339    if test "x$enable_utf" = "xunset"
340  then  then
341    enable_utf8=no    enable_utf=no
342  fi  fi
343    
344  # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.  # enable_cpp copies the value of enable_pcre8 by default
345  #  if test "x$enable_cpp" = "xunset"
 if test "x$enable_ebcdic" = "xyes"  
346  then  then
347    enable_rebuild_chartables=yes    enable_cpp=$enable_pcre8
348    fi
349    
350    # Make sure that if enable_cpp was set, that enable_pcre8 support is enabled
351    if test "x$enable_cpp" = "xyes"
352    then
353      if test "x$enable_pcre8" = "xno"
354      then
355        AC_MSG_ERROR([C++ library requires pcre library with 8 bit characters])
356      fi
357  fi  fi
358    
359  # Convert the newline identifier into the appropriate integer value.  # Convert the newline identifier into the appropriate integer value. The first
360    # three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they
361    # are changed below.
362    
363  case "$enable_newline" in  case "$enable_newline" in
364    lf)      ac_pcre_newline_value=10   ;;    lf)      ac_pcre_newline_value=10   ;;
365    cr)      ac_pcre_newline_value=13   ;;    cr)      ac_pcre_newline_value=13   ;;
# Line 244  case "$enable_newline" in Line 371  case "$enable_newline" in
371    ;;    ;;
372  esac  esac
373    
374    # --enable-ebcdic-nl25 implies --enable-ebcdic
375    if test "x$enable_ebcdic_nl25" = "xyes"; then
376      enable_ebcdic=yes
377    fi
378    
379    # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled,
380    # and the newline value is adjusted appropriately (CR is still 13, but LF is
381    # 21 or 37). Also check that UTF support is not requested, because PCRE cannot
382    # handle EBCDIC and UTF in the same build. To do so it would need to use
383    # different character constants depending on the mode.
384    #
385    if test "x$enable_ebcdic" = "xyes"; then
386      enable_rebuild_chartables=yes
387    
388      if test "x$enable_utf" = "xyes"; then
389        AC_MSG_ERROR([support for EBCDIC and UTF-8/16/32 cannot be enabled at the same time])
390      fi
391    
392      if test "x$enable_ebcdic_nl25" = "xno"; then
393        case "$ac_pcre_newline_value" in
394          10)   ac_pcre_newline_value=21 ;;
395          3338) ac_pcre_newline_value=3349 ;;
396        esac
397      else
398        case "$ac_pcre_newline_value" in
399          10)   ac_pcre_newline_value=37 ;;
400          3338) ac_pcre_newline_value=3365 ;;
401        esac
402      fi
403    fi
404    
405  # Check argument to --with-link-size  # Check argument to --with-link-size
406  case "$with_link_size" in  case "$with_link_size" in
407    2|3|4) ;;    2|3|4) ;;
# Line 253  case "$with_link_size" in Line 411  case "$with_link_size" in
411  esac  esac
412    
413  AH_TOP([  AH_TOP([
414  /* 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
415  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"
416  Standard C, but there are a few non-standard things it can cope with, allowing  systems.
417  it to run on SunOS4 and other "close to standard" systems.  
418    In environments that support the facilities, config.h.in is converted by
419  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
420  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
421  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
422  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
423  every source.  -DHAVE_CONFIG_H to all of your compile commands, so that config.h is included
424    at the start of every source.
425    
426  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
427  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 294  for flag in "-alias,__ZN7pcrecpp2RE6no_a Line 453  for flag in "-alias,__ZN7pcrecpp2RE6no_a
453    LDFLAGS="$OLD_LDFLAGS -Wl,$flag"    LDFLAGS="$OLD_LDFLAGS -Wl,$flag"
454    # 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,
455    # we give up and remove the new flag from LDFLAGS.    # we give up and remove the new flag from LDFLAGS.
456    AC_LINK_IFELSE(AC_LANG_PROGRAM([namespace pcrecpp {    AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace pcrecpp {
457                                      class RE { static int no_arg; };                                      class RE { static int no_arg; };
458                                      int RE::no_arg;                                      int RE::no_arg;
459                                    }],                                    }],
460                                   []),                                   [])],
461                   [AC_MSG_RESULT([yes]);                   [AC_MSG_RESULT([yes]);
462                    EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";                    EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";
463                    break;],                    break;],
# Line 316  AC_CHECK_HEADERS(bits/type_traits.h, [pc Line 475  AC_CHECK_HEADERS(bits/type_traits.h, [pc
475  AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],  AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],
476                                  [pcre_have_type_traits="0"])                                  [pcre_have_type_traits="0"])
477    
478    # (This isn't c++-specific, but is only used in pcrecpp.cc, so try this
479    # in a c++ context.  This matters becuase strtoimax is C99 and may not
480    # be supported by the C++ compiler.)
481    # Figure out how to create a longlong from a string: strtoll and
482    # equiv.  It's not enough to call AC_CHECK_FUNCS: hpux has a
483    # strtoll, for instance, but it only takes 2 args instead of 3!
484    # We have to call AH_TEMPLATE since AC_DEFINE_UNQUOTED below is complex.
485    AH_TEMPLATE(HAVE_STRTOQ, [Define to 1 if you have `strtoq'.])
486    AH_TEMPLATE(HAVE_STRTOLL, [Define to 1 if you have `strtoll'.])
487    AH_TEMPLATE(HAVE__STRTOI64, [Define to 1 if you have `_strtoi64'.])
488    AH_TEMPLATE(HAVE_STRTOIMAX, [Define to 1 if you have `strtoimax'.])
489    have_strto_fn=0
490    for fn in strtoq strtoll _strtoi64 strtoimax; do
491      AC_MSG_CHECKING([for $fn])
492      if test "$fn" = strtoimax; then
493        include=stdint.h
494      else
495        include=stdlib.h
496      fi
497      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$include>],
498                                        [char* e; return $fn("100", &e, 10)])],
499                        [AC_MSG_RESULT(yes)
500                         AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1,
501                                            [Define to 1 if you have `$fn'.])
502                         have_strto_fn=1
503                         break],
504                        [AC_MSG_RESULT(no)])
505    done
506    
507    if test "$have_strto_fn" = 1; then
508      AC_CHECK_TYPES([long long],
509                     [pcre_have_long_long="1"],
510                     [pcre_have_long_long="0"])
511      AC_CHECK_TYPES([unsigned long long],
512                     [pcre_have_ulong_long="1"],
513                     [pcre_have_ulong_long="0"])
514    else
515      pcre_have_long_long="0"
516      pcre_have_ulong_long="0"
517    fi
518    AC_SUBST(pcre_have_long_long)
519    AC_SUBST(pcre_have_ulong_long)
520    
521  AC_LANG_POP  AC_LANG_POP
522  fi  fi
523  # 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 323  AC_SUBST(pcre_have_type_traits) Line 525  AC_SUBST(pcre_have_type_traits)
525  AC_SUBST(pcre_have_bits_type_traits)  AC_SUBST(pcre_have_bits_type_traits)
526    
527  # Conditional compilation  # Conditional compilation
528    AM_CONDITIONAL(WITH_PCRE8, test "x$enable_pcre8" = "xyes")
529    AM_CONDITIONAL(WITH_PCRE16, test "x$enable_pcre16" = "xyes")
530    AM_CONDITIONAL(WITH_PCRE32, test "x$enable_pcre32" = "xyes")
531  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")  AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
532  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")  AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
533    AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes")
534    AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes")
535    AM_CONDITIONAL(WITH_VALGRIND, test "x$enable_valgrind" = "xyes")
536    
537  # Checks for typedefs, structures, and compiler characteristics.  # Checks for typedefs, structures, and compiler characteristics.
538    
539  AC_C_CONST  AC_C_CONST
540  AC_TYPE_SIZE_T  AC_TYPE_SIZE_T
541    
 pcre_have_strotolonglong=0  
 AC_CHECK_FUNCS(strtoq strtoll _strtoi64, [pcre_have_strotolonglong="1"; break])  
 # If we can't convert a string to a long long, pretend we don't even  
 # have a long long.  
 if test $pcre_have_strotolonglong = "0"; then  
    pcre_have_long_long="0"  
    pcre_have_ulong_long="0"  
 else  
   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"])  
 fi  
 AC_SUBST(pcre_have_long_long)  
 AC_SUBST(pcre_have_ulong_long)  
   
542  # Checks for library functions.  # Checks for library functions.
543    
544  AC_CHECK_FUNCS(bcopy memmove strerror)  AC_CHECK_FUNCS(bcopy memmove strerror)
# Line 358  AC_CHECK_FUNCS(bcopy memmove strerror) Line 548  AC_CHECK_FUNCS(bcopy memmove strerror)
548  AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1])  AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1])
549  AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1])  AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1])
550    
551  # Check for the availability of libbz2  # Check for the availability of libbz2. Originally we just used AC_CHECK_LIB,
552    # as for libz. However, this had the following problem, diagnosed and fixed by
553    # a user:
554    #
555    #   - libbz2 uses the Pascal calling convention (WINAPI) for the functions
556    #     under Win32.
557    #   - The standard autoconf AC_CHECK_LIB fails to include "bzlib.h",
558    #     therefore missing the function definition.
559    #   - The compiler thus generates a "C" signature for the test function.
560    #   - The linker fails to find the "C" function.
561    #   - PCRE fails to configure if asked to do so against libbz2.
562    #
563    # Solution:
564    #
565    #   - Replace the AC_CHECK_LIB test with a custom test.
566    
567  AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1])  AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1])
568  AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1])  # Original test
569    # AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1])
570    #
571    # Custom test follows
572    
573    AC_MSG_CHECKING([for libbz2])
574    OLD_LIBS="$LIBS"
575    LIBS="$LIBS -lbz2"
576    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
577    #ifdef HAVE_BZLIB_H
578    #include <bzlib.h>
579    #endif]],
580    [[return (int)BZ2_bzopen("conftest", "rb");]])],
581    [AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;],
582    AC_MSG_RESULT([no]))
583    LIBS="$OLD_LIBS"
584    
585  # Check for the availabiity of libreadline  # Check for the availabiity of libreadline
586    
587  AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])  if test "$enable_pcretest_libreadline" = "yes"; then
588  AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])   AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
589  AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1])   AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
590     AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"],
591       [unset ac_cv_lib_readline_readline;
592        AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"],
593         [unset ac_cv_lib_readline_readline;
594          AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"],
595           [unset ac_cv_lib_readline_readline;
596            AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"],
597             [unset ac_cv_lib_readline_readline;
598              AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"],
599               [unset ac_cv_lib_readline_readline;
600                AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"],
601                 [LIBREADLINE=""],
602                 [-ltermcap])],
603               [-lncursesw])],
604             [-lncurses])],
605           [-lcurses])],
606         [-ltinfo])])
607     AC_SUBST(LIBREADLINE)
608     if test -n "$LIBREADLINE"; then
609       if test "$LIBREADLINE" != "-lreadline"; then
610         echo "-lreadline needs $LIBREADLINE"
611         LIBREADLINE="-lreadline $LIBREADLINE"
612       fi
613     fi
614    fi
615    
616    
617    # Check for the availability of libedit. Different distributions put its
618    # headers in different places. Try to cover the most common ones.
619    
620    if test "$enable_pcretest_libedit" = "yes"; then
621      AC_CHECK_HEADERS([editline/readline.h], [HAVE_EDITLINE_READLINE_H=1],
622        [AC_CHECK_HEADERS([edit/readline/readline.h], [HAVE_READLINE_READLINE_H=1],
623          [AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_READLINE_H=1])])])
624      AC_CHECK_LIB([edit], [readline], [LIBEDIT="-ledit"])
625    fi
626    
627  # This facilitates -ansi builds under Linux  # This facilitates -ansi builds under Linux
628  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])  dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
629    
630    PCRE_STATIC_CFLAG=""
631  if test "x$enable_shared" = "xno" ; then  if test "x$enable_shared" = "xno" ; then
632    AC_DEFINE([PCRE_STATIC], [1], [    AC_DEFINE([PCRE_STATIC], [1], [
633      Define if linking statically (TODO: make nice with Libtool)])      Define to any value if linking statically (TODO: make nice with Libtool)])
634      PCRE_STATIC_CFLAG="-DPCRE_STATIC"
635  fi  fi
636    AC_SUBST(PCRE_STATIC_CFLAG)
637    
638  # Here is where pcre specific defines are handled  # Here is where pcre specific defines are handled
639    
640  if test "$enable_utf8" = "yes"; then  if test "$enable_pcre8" = "yes"; then
641    AC_DEFINE([SUPPORT_UTF8], [], [    AC_DEFINE([SUPPORT_PCRE8], [], [
642      Define to enable support for the UTF-8 Unicode encoding.])      Define to any value to enable the 8 bit PCRE library.])
643    fi
644    
645    if test "$enable_pcre16" = "yes"; then
646      AC_DEFINE([SUPPORT_PCRE16], [], [
647        Define to any value to enable the 16 bit PCRE library.])
648    fi
649    
650    if test "$enable_pcre32" = "yes"; then
651      AC_DEFINE([SUPPORT_PCRE32], [], [
652        Define to any value to enable the 32 bit PCRE library.])
653    fi
654    
655    if test "$enable_jit" = "yes"; then
656      AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])])
657      CC="$PTHREAD_CC"
658      CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
659      LIBS="$PTHREAD_LIBS $LIBS"
660      AC_DEFINE([SUPPORT_JIT], [], [
661        Define to any value to enable support for Just-In-Time compiling.])
662    else
663      enable_pcregrep_jit="no"
664    fi
665    
666    if test "$enable_pcregrep_jit" = "yes"; then
667      AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [
668        Define to any value to enable JIT support in pcregrep.])
669    fi
670    
671    if test "$enable_utf" = "yes"; then
672      AC_DEFINE([SUPPORT_UTF], [], [
673        Define to any value to enable support for the UTF-8/16/32 Unicode encoding.
674        This will work even in an EBCDIC environment, but it is incompatible
675        with the EBCDIC macro. That is, PCRE can support *either* EBCDIC
676        code *or* ASCII/UTF-8/16/32, but not both at once.])
677  fi  fi
678    
679  if test "$enable_unicode_properties" = "yes"; then  if test "$enable_unicode_properties" = "yes"; then
680    AC_DEFINE([SUPPORT_UCP], [], [    AC_DEFINE([SUPPORT_UCP], [], [
681      Define to enable support for Unicode properties])      Define to any value to enable support for Unicode properties.])
682  fi  fi
683    
684  if test "$enable_stack_for_recursion" = "no"; then  if test "$enable_stack_for_recursion" = "no"; then
685    AC_DEFINE([NO_RECURSE], [], [    AC_DEFINE([NO_RECURSE], [], [
686      PCRE uses recursive function calls to handle backtracking while      PCRE uses recursive function calls to handle backtracking while
687      matching. This can sometimes be a problem on systems that have      matching. This can sometimes be a problem on systems that have
688      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
689      doesn't use recursion in the match() function; instead it creates      version that doesn't use recursion in the match() function; instead
690      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
691      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
692      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).])  
693  fi  fi
694    
695  if test "$enable_pcregrep_libz" = "yes"; then  if test "$enable_pcregrep_libz" = "yes"; then
696    AC_DEFINE([SUPPORT_LIBZ], [], [    AC_DEFINE([SUPPORT_LIBZ], [], [
697      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
698      able to handle .gz files.])      able to handle .gz files.])
699  fi  fi
700    
701  if test "$enable_pcregrep_libbz2" = "yes"; then  if test "$enable_pcregrep_libbz2" = "yes"; then
702    AC_DEFINE([SUPPORT_LIBBZ2], [], [    AC_DEFINE([SUPPORT_LIBBZ2], [], [
703      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
704      able to handle .bz2 files.])      is able to handle .bz2 files.])
705  fi  fi
706    
707  if test "$enable_pcretest_libreadline" = "yes"; then  if test $with_pcregrep_bufsize -lt 8192 ; then
708      with_pcregrep_bufsize="8192"
709    fi
710    
711    AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [
712      The value of PCREGREP_BUFSIZE determines the size of buffer used by pcregrep
713      to hold parts of the file it is searching. This is also the minimum value.
714      The actual amount of memory used by pcregrep is three times this number,
715      because it allows for the buffering of "before" and "after" lines.])
716    
717    if test "$enable_pcretest_libedit" = "yes"; then
718      AC_DEFINE([SUPPORT_LIBEDIT], [], [
719        Define to any value to allow pcretest to be linked with libedit.])
720      LIBREADLINE="$LIBEDIT"
721    elif test "$enable_pcretest_libreadline" = "yes"; then
722    AC_DEFINE([SUPPORT_LIBREADLINE], [], [    AC_DEFINE([SUPPORT_LIBREADLINE], [], [
723      Define to allow pcretest to be linked with libreadline.])      Define to any value to allow pcretest to be linked with libreadline.])
724  fi  fi
725    
726  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [  AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
727    The value of NEWLINE determines the newline character sequence. On    The value of NEWLINE determines the default newline character sequence. PCRE
728    systems that support it, "configure" can be used to override the    client programs can override this by selecting other values at run time. In
729    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
730    3338 (CRLF), -1 (ANY), or -2 (ANYCRLF).])    EBCDIC environments the value can be 21 or 37 (LF), 13 (CR), or 3349 or 3365
731      (CRLF) because there are two alternative codepoints (0x15 and 0x25) that are
732      used as the NL line terminator that is equivalent to ASCII LF. In both ASCII
733      and EBCDIC environments the value can also be -1 (ANY), or -2 (ANYCRLF).])
734    
735  if test "$enable_bsr_anycrlf" = "yes"; then  if test "$enable_bsr_anycrlf" = "yes"; then
736    AC_DEFINE([BSR_ANYCRLF], [], [    AC_DEFINE([BSR_ANYCRLF], [], [
737      By default, the \R escape sequence matches any Unicode line ending      By default, the \R escape sequence matches any Unicode line ending
738      character or sequence of characters. If BSR_ANYCRLF is defined, this is      character or sequence of characters. If BSR_ANYCRLF is defined (to any
739      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.
740      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.])  
741  fi  fi
742    
743  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [
# Line 440  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_l Line 745  AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_l
745    links as offsets within the compiled regex. The default is 2, which    links as offsets within the compiled regex. The default is 2, which
746    allows for compiled patterns up to 64K long. This covers the vast    allows for compiled patterns up to 64K long. This covers the vast
747    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
748    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.])  
749    
750  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [
751    When calling PCRE via the POSIX interface, additional working storage    When calling PCRE via the POSIX interface, additional working storage
# Line 450  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHO Line 754  AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHO
754    interface provides only two. If the number of expected substrings is    interface provides only two. If the number of expected substrings is
755    small, the wrapper function uses space on the stack, because this is    small, the wrapper function uses space on the stack, because this is
756    faster than using malloc() for each call. The threshold above which    faster than using malloc() for each call. The threshold above which
757    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.])  
758    
759  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [
760    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 461  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with Line 763  AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with
763    limit. The limit exists in order to catch runaway regular    limit. The limit exists in order to catch runaway regular
764    expressions that take for ever to determine that they do not match.    expressions that take for ever to determine that they do not match.
765    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
766    legitimate cases. On systems that support it, "configure" can be    legitimate cases.])
   used to override this default default.])  
767    
768  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [
769    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 473  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSIO Line 774  AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSIO
774    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To    MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
775    have any useful effect, it must be less than the value of    have any useful effect, it must be less than the value of
776    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.
777    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.])  
778    
779  AC_DEFINE([MAX_NAME_SIZE], [32], [  AC_DEFINE([MAX_NAME_SIZE], [32], [
780    This limit is parameterized just in case anybody ever wants to    This limit is parameterized just in case anybody ever wants to
# Line 490  AH_VERBATIM([PCRE_EXP_DEFN], [ Line 790  AH_VERBATIM([PCRE_EXP_DEFN], [
790  /* 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
791     Win32, and it needs some magic to be inserted before the definition     Win32, and it needs some magic to be inserted before the definition
792     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
793     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
794     defaults to "extern" for a C compiler and "extern C" for a C++      __declspec value is used for Windows systems; in other environments
795     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.
796     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
797     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"
798     which are internal to the library. */     in the C sense, but which are internal to the library. */
799  #undef PCRE_EXP_DEFN])  #undef PCRE_EXP_DEFN])
800    
801  if test "$enable_ebcdic" = "yes"; then  if test "$enable_ebcdic" = "yes"; then
802    AC_DEFINE_UNQUOTED([EBCDIC], [], [    AC_DEFINE_UNQUOTED([EBCDIC], [], [
803      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
804      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
805      "configure", this can be done via --enable-ebcdic.])      NEWLINE macro below to set a suitable EBCDIC newline, commonly 21 (0x15).
806        On systems that can use "configure" or CMake to set EBCDIC, NEWLINE is
807        automatically adjusted. When EBCDIC is set, PCRE assumes that all input
808        strings are in EBCDIC. If you do not define this macro, PCRE will assume
809        input strings are ASCII or UTF-8/16/32 Unicode. It is not possible to build
810        a version of PCRE that supports both EBCDIC and UTF-8/16/32.])
811    fi
812    
813    if test "$enable_ebcdic_nl25" = "yes"; then
814      AC_DEFINE_UNQUOTED([EBCDIC_NL25], [], [
815        In an EBCDIC environment, define this macro to any value to arrange for
816        the NL character to be 0x25 instead of the default 0x15. NL plays the role
817        that LF does in an ASCII/Unicode environment. The value must also be set in
818        the NEWLINE macro below. On systems that can use "configure" or CMake to
819        set EBCDIC_NL25, the adjustment of NEWLINE is automatic.])
820    fi
821    
822    if test "$enable_valgrind" = "yes"; then
823      AC_DEFINE_UNQUOTED([SUPPORT_VALGRIND], [], [
824         Valgrind support to find invalid memory reads.])
825  fi  fi
826    
827  # Platform specific issues  # Platform specific issues
# Line 523  esac Line 842  esac
842  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \  EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \
843                         $NO_UNDEFINED -version-info libpcre_version"                         $NO_UNDEFINED -version-info libpcre_version"
844    
845    EXTRA_LIBPCRE16_LDFLAGS="$EXTRA_LIBPCRE16_LDFLAGS \
846                           $NO_UNDEFINED -version-info libpcre16_version"
847    
848    EXTRA_LIBPCRE32_LDFLAGS="$EXTRA_LIBPCRE32_LDFLAGS \
849                           $NO_UNDEFINED -version-info libpcre32_version"
850    
851  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \  EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \
852                              $NO_UNDEFINED -version-info libpcreposix_version"                              $NO_UNDEFINED -version-info libpcreposix_version"
853    
# Line 531  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE Line 856  EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRE
856                            $EXPORT_ALL_SYMBOLS"                            $EXPORT_ALL_SYMBOLS"
857    
858  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
859    AC_SUBST(EXTRA_LIBPCRE16_LDFLAGS)
860    AC_SUBST(EXTRA_LIBPCRE32_LDFLAGS)
861  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)  AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
862  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)  AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
863    
864  # When we run 'make distcheck', use these arguments.  # When we run 'make distcheck', use these arguments. Turning off compiler
865  DISTCHECK_CONFIGURE_FLAGS="--enable-cpp --enable-unicode-properties"  # optimization makes it run faster.
866    DISTCHECK_CONFIGURE_FLAGS="CFLAGS='' CXXFLAGS='' --enable-pcre16 --enable-pcre32 --enable-jit --enable-cpp --enable-unicode-properties"
867  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)  AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
868    
869  # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is  # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
870  # specified, the relevant library is available. If so, add it to LIBS.  # specified, the relevant library is available.
871    
872  if test "$enable_pcregrep_libz" = "yes"; then  if test "$enable_pcregrep_libz" = "yes"; then
873    if test "$HAVE_ZLIB_H" != "1"; then    if test "$HAVE_ZLIB_H" != "1"; then
# Line 550  if test "$enable_pcregrep_libz" = "yes"; Line 878  if test "$enable_pcregrep_libz" = "yes";
878      echo "** Cannot --enable-pcregrep-libz because libz was not found"      echo "** Cannot --enable-pcregrep-libz because libz was not found"
879      exit 1      exit 1
880    fi    fi
881    if test "$LIBS" = ""; then LIBS=-lz; else LIBS="$LIBS -lz"; fi    LIBZ="-lz"
882  fi  fi
883    AC_SUBST(LIBZ)
884    
885  if test "$enable_pcregrep_libbz2" = "yes"; then  if test "$enable_pcregrep_libbz2" = "yes"; then
886    if test "$HAVE_BZLIB_H" != "1"; then    if test "$HAVE_BZLIB_H" != "1"; then
# Line 562  if test "$enable_pcregrep_libbz2" = "yes Line 891  if test "$enable_pcregrep_libbz2" = "yes
891      echo "** Cannot --enable-pcregrep-libbz2 because libbz2 was not found"      echo "** Cannot --enable-pcregrep-libbz2 because libbz2 was not found"
892      exit 1      exit 1
893    fi    fi
894    if test "$LIBS" = ""; then LIBS=-lbz2; else LIBS="$LIBS -lbz2"; fi    LIBBZ2="-lbz2"
895  fi  fi
896    AC_SUBST(LIBBZ2)
897    
898  # Similarly for --enable-pcretest-readline  # Similarly for --enable-pcretest-readline
899    
900    if test "$enable_pcretest_libedit" = "yes"; then
901      if test "$enable_pcretest_libreadline" = "yes"; then
902        echo "** Cannot use both --enable-pcretest-libedit and --enable-pcretest-readline"
903        exit 1
904      fi
905      if test "$HAVE_EDITLINE_READLINE_H" != "1" -a \
906              "$HAVE_READLINE_READLINE_H" != "1"; then
907        echo "** Cannot --enable-pcretest-libedit because neither editline/readline.h"
908        echo "** nor readline/readline.h was found."
909        exit 1
910      fi
911      if test -z "$LIBEDIT"; then
912        echo "** Cannot --enable-pcretest-libedit because libedit library was not found."
913        exit 1
914      fi
915    fi
916    
917  if test "$enable_pcretest_libreadline" = "yes"; then  if test "$enable_pcretest_libreadline" = "yes"; then
918    if test "$HAVE_READLINE_H" != "1"; then    if test "$HAVE_READLINE_H" != "1"; then
919      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 576  if test "$enable_pcretest_libreadline" = Line 923  if test "$enable_pcretest_libreadline" =
923      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."      echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
924      exit 1      exit 1
925    fi    fi
926    if test "$LIBS" = ""; then LIBS=-lreadline; else LIBS="$LIBS -lreadline"; fi    if test -z "$LIBREADLINE"; then
927        echo "** Cannot --enable-pcretest-readline because readline library was not found."
928        exit 1
929      fi
930    fi
931    
932    # Check for valgrind
933    
934    if test "$enable_valgrind" = "yes"; then
935      m4_ifdef([PKG_CHECK_MODULES],
936               [PKG_CHECK_MODULES([VALGRIND],[valgrind])],
937               [AC_MSG_ERROR([pkg-config not supported])])
938  fi  fi
939    
940  # Produce these files, in addition to config.h.  # Produce these files, in addition to config.h.
941  AC_CONFIG_FILES(  AC_CONFIG_FILES(
942          Makefile          Makefile
943          libpcre.pc          libpcre.pc
944            libpcre16.pc
945            libpcre32.pc
946            libpcreposix.pc
947          libpcrecpp.pc          libpcrecpp.pc
948          pcre-config          pcre-config
949          pcre.h          pcre.h
# Line 599  AC_CONFIG_COMMANDS([delete-old-chartable Line 960  AC_CONFIG_COMMANDS([delete-old-chartable
960    
961  AC_OUTPUT  AC_OUTPUT
962    
963  # Print out a nice little message after configure is run displaying your  # Print out a nice little message after configure is run displaying the
964  # chosen options.  # chosen options.
965    
966    ebcdic_nl_code=n/a
967    if test "$enable_ebcdic_nl25" = "yes"; then
968      ebcdic_nl_code=0x25
969    elif test "$enable_ebcdic" = "yes"; then
970      ebcdic_nl_code=0x15
971    fi
972    
973  cat <<EOF  cat <<EOF
974    
975  $PACKAGE-$VERSION configuration summary:  $PACKAGE-$VERSION configuration summary:
# Line 618  $PACKAGE-$VERSION configuration summary: Line 986  $PACKAGE-$VERSION configuration summary:
986      Linker flags .................... : ${LDFLAGS}      Linker flags .................... : ${LDFLAGS}
987      Extra libraries ................. : ${LIBS}      Extra libraries ................. : ${LIBS}
988    
989        Build 8 bit pcre library ........ : ${enable_pcre8}
990        Build 16 bit pcre library ....... : ${enable_pcre16}
991        Build 32 bit pcre library ....... : ${enable_pcre32}
992      Build C++ library ............... : ${enable_cpp}      Build C++ library ............... : ${enable_cpp}
993      Enable UTF-8 support ............ : ${enable_utf8}      Enable JIT compiling support .... : ${enable_jit}
994        Enable UTF-8/16/32 support ...... : ${enable_utf}
995      Unicode properties .............. : ${enable_unicode_properties}      Unicode properties .............. : ${enable_unicode_properties}
996      Newline char/sequence ........... : ${enable_newline}      Newline char/sequence ........... : ${enable_newline}
997      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}      \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
998      EBCDIC coding ................... : ${enable_ebcdic}      EBCDIC coding ................... : ${enable_ebcdic}
999        EBCDIC code for NL .............. : ${ebcdic_nl_code}
1000      Rebuild char tables ............. : ${enable_rebuild_chartables}      Rebuild char tables ............. : ${enable_rebuild_chartables}
1001      Use stack recursion ............. : ${enable_stack_for_recursion}      Use stack recursion ............. : ${enable_stack_for_recursion}
1002      POSIX mem threshold ............. : ${with_posix_malloc_threshold}      POSIX mem threshold ............. : ${with_posix_malloc_threshold}
# Line 632  $PACKAGE-$VERSION configuration summary: Line 1005  $PACKAGE-$VERSION configuration summary:
1005      Match limit recursion ........... : ${with_match_limit_recursion}      Match limit recursion ........... : ${with_match_limit_recursion}
1006      Build shared libs ............... : ${enable_shared}      Build shared libs ............... : ${enable_shared}
1007      Build static libs ............... : ${enable_static}      Build static libs ............... : ${enable_static}
1008        Use JIT in pcregrep ............. : ${enable_pcregrep_jit}
1009        Buffer size for pcregrep ........ : ${with_pcregrep_bufsize}
1010      Link pcregrep with libz ......... : ${enable_pcregrep_libz}      Link pcregrep with libz ......... : ${enable_pcregrep_libz}
1011      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}      Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
1012        Link pcretest with libedit ...... : ${enable_pcretest_libedit}
1013      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}      Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
1014        Valgrind support ................ : ${enable_valgrind}
1015    
1016  EOF  EOF
1017    

Legend:
Removed from v.367  
changed lines
  Added in v.1151

  ViewVC Help
Powered by ViewVC 1.1.5