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

Contents of /code/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1320 - (hide annotations) (download)
Wed May 1 16:39:35 2013 UTC (2 weeks, 6 days ago) by ph10
File size: 40863 byte(s)
Source tidies (trails spaces, html updates) for 8.33-RC1.

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

Properties

Name Value
svn:eol-style native
svn:keywords "Author Date Id Revision Url"

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12