9 |
dnl be defined as -RC2, for example. For real releases, it should be empty. |
dnl be defined as -RC2, for example. For real releases, it should be empty. |
10 |
|
|
11 |
m4_define(pcre_major, [8]) |
m4_define(pcre_major, [8]) |
12 |
m4_define(pcre_minor, [10]) |
m4_define(pcre_minor, [34]) |
13 |
m4_define(pcre_prerelease, [-RC2]) |
m4_define(pcre_prerelease, [-RC]) |
14 |
m4_define(pcre_date, [2010-06-11]) |
m4_define(pcre_date, [2013-06-14]) |
15 |
|
|
16 |
|
# NOTE: The CMakeLists.txt file searches for the above variables in the first |
17 |
|
# 50 lines of this file. Please update that if the variables above are moved. |
18 |
|
|
19 |
# Libtool shared library interface versions (current:revision:age) |
# Libtool shared library interface versions (current:revision:age) |
20 |
m4_define(libpcre_version, [0:1:0]) |
m4_define(libpcre_version, [3:1:2]) |
21 |
m4_define(libpcreposix_version, [0:0:0]) |
m4_define(libpcre16_version, [2:1:2]) |
22 |
|
m4_define(libpcre32_version, [0:1:0]) |
23 |
|
m4_define(libpcreposix_version, [0:2:0]) |
24 |
m4_define(libpcrecpp_version, [0:0:0]) |
m4_define(libpcrecpp_version, [0:0:0]) |
25 |
|
|
26 |
AC_PREREQ(2.57) |
AC_PREREQ(2.57) |
27 |
AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre) |
AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre) |
28 |
AC_CONFIG_SRCDIR([pcre.h.in]) |
AC_CONFIG_SRCDIR([pcre.h.in]) |
29 |
AM_INIT_AUTOMAKE([dist-bzip2 dist-zip]) |
AM_INIT_AUTOMAKE([dist-bzip2 dist-zip]) |
30 |
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
31 |
AC_CONFIG_HEADERS(config.h) |
AC_CONFIG_HEADERS(config.h) |
32 |
|
|
33 |
|
# This is a new thing required to stop a warning from automake 1.12 |
34 |
|
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
35 |
|
|
36 |
# This was added at the suggestion of libtoolize (03-Jan-10) |
# This was added at the suggestion of libtoolize (03-Jan-10) |
37 |
AC_CONFIG_MACRO_DIR([m4]) |
AC_CONFIG_MACRO_DIR([m4]) |
38 |
|
|
51 |
|
|
52 |
AC_PROG_CC |
AC_PROG_CC |
53 |
AC_PROG_CXX |
AC_PROG_CXX |
54 |
|
AM_PROG_CC_C_O |
55 |
|
|
56 |
if test "x$remember_set_CFLAGS" = "x" |
if test "x$remember_set_CFLAGS" = "x" |
57 |
then |
then |
78 |
# AC_PROG_CXX will return "g++" even if no c++ compiler is installed. |
# AC_PROG_CXX will return "g++" even if no c++ compiler is installed. |
79 |
# Check for that case, and just disable c++ code if g++ doesn't run. |
# Check for that case, and just disable c++ code if g++ doesn't run. |
80 |
AC_LANG_PUSH(C++) |
AC_LANG_PUSH(C++) |
81 |
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[]),, CXX=""; CXXCP=""; CXXFLAGS="") |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],, CXX=""; CXXCP=""; CXXFLAGS="") |
82 |
AC_LANG_POP |
AC_LANG_POP |
83 |
|
|
84 |
# Check for a 64-bit integer type |
# Check for a 64-bit integer type |
86 |
|
|
87 |
AC_PROG_INSTALL |
AC_PROG_INSTALL |
88 |
AC_LIBTOOL_WIN32_DLL |
AC_LIBTOOL_WIN32_DLL |
89 |
AC_PROG_LIBTOOL |
LT_INIT |
90 |
AC_PROG_LN_S |
AC_PROG_LN_S |
91 |
|
|
92 |
|
# Check for GCC visibility feature |
93 |
|
|
94 |
|
PCRE_VISIBILITY |
95 |
|
|
96 |
|
# Versioning |
97 |
|
|
98 |
PCRE_MAJOR="pcre_major" |
PCRE_MAJOR="pcre_major" |
99 |
PCRE_MINOR="pcre_minor" |
PCRE_MINOR="pcre_minor" |
100 |
PCRE_PRERELEASE="pcre_prerelease" |
PCRE_PRERELEASE="pcre_prerelease" |
120 |
htmldir='${docdir}/html' |
htmldir='${docdir}/html' |
121 |
fi |
fi |
122 |
|
|
123 |
|
# Handle --disable-pcre8 (enabled by default) |
124 |
|
AC_ARG_ENABLE(pcre8, |
125 |
|
AS_HELP_STRING([--disable-pcre8], |
126 |
|
[disable 8 bit character support]), |
127 |
|
, enable_pcre8=unset) |
128 |
|
AC_SUBST(enable_pcre8) |
129 |
|
|
130 |
|
# Handle --enable-pcre16 (disabled by default) |
131 |
|
AC_ARG_ENABLE(pcre16, |
132 |
|
AS_HELP_STRING([--enable-pcre16], |
133 |
|
[enable 16 bit character support]), |
134 |
|
, enable_pcre16=unset) |
135 |
|
AC_SUBST(enable_pcre16) |
136 |
|
|
137 |
|
# Handle --enable-pcre32 (disabled by default) |
138 |
|
AC_ARG_ENABLE(pcre32, |
139 |
|
AS_HELP_STRING([--enable-pcre32], |
140 |
|
[enable 32 bit character support]), |
141 |
|
, enable_pcre32=unset) |
142 |
|
AC_SUBST(enable_pcre32) |
143 |
|
|
144 |
# Handle --disable-cpp. The substitution of enable_cpp is needed for use in |
# Handle --disable-cpp. The substitution of enable_cpp is needed for use in |
145 |
# pcre-config. |
# pcre-config. |
146 |
AC_ARG_ENABLE(cpp, |
AC_ARG_ENABLE(cpp, |
147 |
AS_HELP_STRING([--disable-cpp], |
AS_HELP_STRING([--disable-cpp], |
148 |
[disable C++ support]), |
[disable C++ support]), |
149 |
, enable_cpp=yes) |
, enable_cpp=unset) |
150 |
AC_SUBST(enable_cpp) |
AC_SUBST(enable_cpp) |
151 |
|
|
152 |
|
# Handle --enable-jit (disabled by default) |
153 |
|
AC_ARG_ENABLE(jit, |
154 |
|
AS_HELP_STRING([--enable-jit], |
155 |
|
[enable Just-In-Time compiling support]), |
156 |
|
, enable_jit=no) |
157 |
|
|
158 |
|
# Handle --disable-pcregrep-jit (enabled by default) |
159 |
|
AC_ARG_ENABLE(pcregrep-jit, |
160 |
|
AS_HELP_STRING([--disable-pcregrep-jit], |
161 |
|
[disable JIT support in pcregrep]), |
162 |
|
, enable_pcregrep_jit=yes) |
163 |
|
|
164 |
# Handle --enable-rebuild-chartables |
# Handle --enable-rebuild-chartables |
165 |
AC_ARG_ENABLE(rebuild-chartables, |
AC_ARG_ENABLE(rebuild-chartables, |
166 |
AS_HELP_STRING([--enable-rebuild-chartables], |
AS_HELP_STRING([--enable-rebuild-chartables], |
170 |
# Handle --enable-utf8 (disabled by default) |
# Handle --enable-utf8 (disabled by default) |
171 |
AC_ARG_ENABLE(utf8, |
AC_ARG_ENABLE(utf8, |
172 |
AS_HELP_STRING([--enable-utf8], |
AS_HELP_STRING([--enable-utf8], |
173 |
[enable UTF-8 support (incompatible with --enable-ebcdic)]), |
[another name for --enable-utf. Kept only for compatibility reasons]), |
174 |
, enable_utf8=unset) |
, enable_utf8=unset) |
175 |
|
|
176 |
|
# Handle --enable-utf (disabled by default) |
177 |
|
AC_ARG_ENABLE(utf, |
178 |
|
AS_HELP_STRING([--enable-utf], |
179 |
|
[enable UTF-8/16/32 support (incompatible with --enable-ebcdic)]), |
180 |
|
, enable_utf=unset) |
181 |
|
|
182 |
# Handle --enable-unicode-properties |
# Handle --enable-unicode-properties |
183 |
AC_ARG_ENABLE(unicode-properties, |
AC_ARG_ENABLE(unicode-properties, |
184 |
AS_HELP_STRING([--enable-unicode-properties], |
AS_HELP_STRING([--enable-unicode-properties], |
185 |
[enable Unicode properties support (implies --enable-utf8)]), |
[enable Unicode properties support (implies --enable-utf)]), |
186 |
, enable_unicode_properties=no) |
, enable_unicode_properties=no) |
187 |
|
|
188 |
# Handle --enable-newline=NL |
# Handle newline options |
|
dnl AC_ARG_ENABLE(newline, |
|
|
dnl AS_HELP_STRING([--enable-newline=NL], |
|
|
dnl [use NL as newline (lf, cr, crlf, anycrlf, any; default=lf)]), |
|
|
dnl , enable_newline=lf) |
|
|
|
|
|
# Separate newline options |
|
189 |
ac_pcre_newline=lf |
ac_pcre_newline=lf |
190 |
AC_ARG_ENABLE(newline-is-cr, |
AC_ARG_ENABLE(newline-is-cr, |
191 |
AS_HELP_STRING([--enable-newline-is-cr], |
AS_HELP_STRING([--enable-newline-is-cr], |
218 |
# Handle --enable-ebcdic |
# Handle --enable-ebcdic |
219 |
AC_ARG_ENABLE(ebcdic, |
AC_ARG_ENABLE(ebcdic, |
220 |
AS_HELP_STRING([--enable-ebcdic], |
AS_HELP_STRING([--enable-ebcdic], |
221 |
[assume EBCDIC coding rather than ASCII; incompatible with --enable-utf8; use only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]), |
[assume EBCDIC coding rather than ASCII; incompatible with --enable-utf; use only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]), |
222 |
, enable_ebcdic=no) |
, enable_ebcdic=no) |
223 |
|
|
224 |
|
# Handle --enable-ebcdic-nl25 |
225 |
|
AC_ARG_ENABLE(ebcdic-nl25, |
226 |
|
AS_HELP_STRING([--enable-ebcdic-nl25], |
227 |
|
[set EBCDIC code for NL to 0x25 instead of 0x15; it implies --enable-ebcdic]), |
228 |
|
, enable_ebcdic_nl25=no) |
229 |
|
|
230 |
# Handle --disable-stack-for-recursion |
# Handle --disable-stack-for-recursion |
231 |
AC_ARG_ENABLE(stack-for-recursion, |
AC_ARG_ENABLE(stack-for-recursion, |
232 |
AS_HELP_STRING([--disable-stack-for-recursion], |
AS_HELP_STRING([--disable-stack-for-recursion], |
245 |
[link pcregrep with libbz2 to handle .bz2 files]), |
[link pcregrep with libbz2 to handle .bz2 files]), |
246 |
, enable_pcregrep_libbz2=no) |
, enable_pcregrep_libbz2=no) |
247 |
|
|
248 |
|
# Handle --with-pcregrep-bufsize=N |
249 |
|
AC_ARG_WITH(pcregrep-bufsize, |
250 |
|
AS_HELP_STRING([--with-pcregrep-bufsize=N], |
251 |
|
[pcregrep buffer size (default=20480)]), |
252 |
|
, with_pcregrep_bufsize=20480) |
253 |
|
|
254 |
|
# Handle --enable-pcretest-libedit |
255 |
|
AC_ARG_ENABLE(pcretest-libedit, |
256 |
|
AS_HELP_STRING([--enable-pcretest-libedit], |
257 |
|
[link pcretest with libedit]), |
258 |
|
, enable_pcretest_libedit=no) |
259 |
|
|
260 |
# Handle --enable-pcretest-libreadline |
# Handle --enable-pcretest-libreadline |
261 |
AC_ARG_ENABLE(pcretest-libreadline, |
AC_ARG_ENABLE(pcretest-libreadline, |
262 |
AS_HELP_STRING([--enable-pcretest-libreadline], |
AS_HELP_STRING([--enable-pcretest-libreadline], |
294 |
[default limit on internal recursion (default=MATCH_LIMIT)]), |
[default limit on internal recursion (default=MATCH_LIMIT)]), |
295 |
, with_match_limit_recursion=MATCH_LIMIT) |
, with_match_limit_recursion=MATCH_LIMIT) |
296 |
|
|
297 |
# Make sure that if enable_unicode_properties was set, that UTF-8 support |
# Handle --enable-valgrind |
298 |
# is enabled. |
AC_ARG_ENABLE(valgrind, |
299 |
# |
AS_HELP_STRING([--enable-valgrind], |
300 |
|
[valgrind support]), |
301 |
|
, enable_valgrind=no) |
302 |
|
|
303 |
|
# 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 |
|
# 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 |
|
# Set the default value for pcre32 |
332 |
|
if test "x$enable_pcre32" = "xunset" |
333 |
|
then |
334 |
|
enable_pcre32=no |
335 |
|
fi |
336 |
|
|
337 |
|
# Make sure enable_pcre8 or enable_pcre16 was set |
338 |
|
if test "x$enable_pcre8$enable_pcre16$enable_pcre32" = "xnonono" |
339 |
|
then |
340 |
|
AC_MSG_ERROR([At least one of 8, 16 or 32 bit pcre library must be enabled]) |
341 |
|
fi |
342 |
|
|
343 |
|
# Make sure that if enable_unicode_properties was set, that UTF support is enabled. |
344 |
if test "x$enable_unicode_properties" = "xyes" |
if test "x$enable_unicode_properties" = "xyes" |
345 |
then |
then |
346 |
if test "x$enable_utf8" = "xno" |
if test "x$enable_utf" = "xno" |
347 |
then |
then |
348 |
AC_MSG_ERROR([support for Unicode properties requires UTF-8 support]) |
AC_MSG_ERROR([support for Unicode properties requires UTF-8/16/32 support]) |
349 |
fi |
fi |
350 |
enable_utf8=yes |
enable_utf=yes |
351 |
fi |
fi |
352 |
|
|
353 |
if test "x$enable_utf8" = "xunset" |
# enable_utf is disabled by default. |
354 |
|
if test "x$enable_utf" = "xunset" |
355 |
then |
then |
356 |
enable_utf8=no |
enable_utf=no |
357 |
fi |
fi |
358 |
|
|
359 |
# Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled. |
# enable_cpp copies the value of enable_pcre8 by default |
360 |
# Also check that UTF-8 support is not requested, because PCRE cannot handle |
if test "x$enable_cpp" = "xunset" |
|
# EBCDIC and UTF-8 in the same build. To do so it would need to use different |
|
|
# character constants depending on the mode. |
|
|
# |
|
|
if test "x$enable_ebcdic" = "xyes" |
|
361 |
then |
then |
362 |
enable_rebuild_chartables=yes |
enable_cpp=$enable_pcre8 |
363 |
if test "x$enable_utf8" = "xyes" |
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 |
then |
370 |
AC_MSG_ERROR([support for EBCDIC and UTF-8 cannot be enabled at the same time]) |
AC_MSG_ERROR([C++ library requires pcre library with 8 bit characters]) |
371 |
fi |
fi |
372 |
fi |
fi |
373 |
|
|
374 |
# Convert the newline identifier into the appropriate integer value. |
# Convert the newline identifier into the appropriate integer value. The first |
375 |
|
# three are ASCII values 0x0a, 0x0d, and 0x0d0a, but if EBCDIC is enabled, they |
376 |
|
# are changed below. |
377 |
|
|
378 |
case "$enable_newline" in |
case "$enable_newline" in |
379 |
lf) ac_pcre_newline_value=10 ;; |
lf) ac_pcre_newline_value=10 ;; |
380 |
cr) ac_pcre_newline_value=13 ;; |
cr) ac_pcre_newline_value=13 ;; |
386 |
;; |
;; |
387 |
esac |
esac |
388 |
|
|
389 |
|
# --enable-ebcdic-nl25 implies --enable-ebcdic |
390 |
|
if test "x$enable_ebcdic_nl25" = "xyes"; then |
391 |
|
enable_ebcdic=yes |
392 |
|
fi |
393 |
|
|
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 |
|
AC_MSG_ERROR([support for EBCDIC and UTF-8/16/32 cannot be enabled at the same time]) |
405 |
|
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 |
|
esac |
412 |
|
else |
413 |
|
case "$ac_pcre_newline_value" in |
414 |
|
10) ac_pcre_newline_value=37 ;; |
415 |
|
3338) ac_pcre_newline_value=3365 ;; |
416 |
|
esac |
417 |
|
fi |
418 |
|
fi |
419 |
|
|
420 |
# Check argument to --with-link-size |
# Check argument to --with-link-size |
421 |
case "$with_link_size" in |
case "$with_link_size" in |
422 |
2|3|4) ;; |
2|3|4) ;; |
426 |
esac |
esac |
427 |
|
|
428 |
AH_TOP([ |
AH_TOP([ |
429 |
/* 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 |
430 |
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" |
431 |
Standard C, but there are a few non-standard things it can cope with, allowing |
systems. |
432 |
it to run on SunOS4 and other "close to standard" systems. |
|
433 |
|
In environments that support the GNU autotools, config.h.in is converted into |
434 |
If you are going to build PCRE "by hand" on a system without "configure" you |
config.h by the "configure" script. In environments that use CMake, |
435 |
should copy the distributed config.h.generic to config.h, and then set up the |
config-cmake.in is converted into config.h. If you are going to build PCRE "by |
436 |
macro definitions the way you need them. You must then add -DHAVE_CONFIG_H to |
hand" without using "configure" or CMake, you should copy the distributed |
437 |
all of your compile commands, so that config.h is included at the start of |
config.h.generic to config.h, and edit the macro definitions to be the way you |
438 |
every source. |
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 |
|
|
441 |
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 |
442 |
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, |
443 |
|
but if you do, default values will be taken from config.h for non-boolean |
444 |
PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if |
macros that are not defined on the command line. |
445 |
HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set |
|
446 |
them both to 0; an emulation function will be used. */]) |
Boolean macros such as HAVE_STDLIB_H and SUPPORT_PCRE8 should either be defined |
447 |
|
(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 |
|
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 |
|
|
452 |
|
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 |
# Checks for header files. |
# Checks for header files. |
457 |
AC_HEADER_STDC |
AC_HEADER_STDC |
460 |
# The files below are C++ header files. |
# The files below are C++ header files. |
461 |
pcre_have_type_traits="0" |
pcre_have_type_traits="0" |
462 |
pcre_have_bits_type_traits="0" |
pcre_have_bits_type_traits="0" |
463 |
|
|
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 |
if test "x$enable_cpp" = "xyes" -a -n "$CXX" |
if test "x$enable_cpp" = "xyes" -a -n "$CXX" |
469 |
then |
then |
470 |
AC_LANG_PUSH(C++) |
AC_LANG_PUSH(C++) |
481 |
LDFLAGS="$OLD_LDFLAGS -Wl,$flag" |
LDFLAGS="$OLD_LDFLAGS -Wl,$flag" |
482 |
# 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, |
483 |
# we give up and remove the new flag from LDFLAGS. |
# we give up and remove the new flag from LDFLAGS. |
484 |
AC_LINK_IFELSE(AC_LANG_PROGRAM([namespace pcrecpp { |
AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace pcrecpp { |
485 |
class RE { static int no_arg; }; |
class RE { static int no_arg; }; |
486 |
int RE::no_arg; |
int RE::no_arg; |
487 |
}], |
}], |
488 |
[]), |
[])], |
489 |
[AC_MSG_RESULT([yes]); |
[AC_MSG_RESULT([yes]); |
490 |
EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag"; |
EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag"; |
491 |
break;], |
break;], |
522 |
else |
else |
523 |
include=stdlib.h |
include=stdlib.h |
524 |
fi |
fi |
525 |
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <$include>], |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$include>], |
526 |
[char* e; return $fn("100", &e, 10)]), |
[char* e; return $fn("100", &e, 10)])], |
527 |
[AC_MSG_RESULT(yes) |
[AC_MSG_RESULT(yes) |
528 |
AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1, |
AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1, |
529 |
[Define to 1 if you have `$fn'.]) |
[Define to 1 if you have `$fn'.]) |
553 |
AC_SUBST(pcre_have_bits_type_traits) |
AC_SUBST(pcre_have_bits_type_traits) |
554 |
|
|
555 |
# Conditional compilation |
# Conditional compilation |
556 |
|
AM_CONDITIONAL(WITH_PCRE8, test "x$enable_pcre8" = "xyes") |
557 |
|
AM_CONDITIONAL(WITH_PCRE16, test "x$enable_pcre16" = "xyes") |
558 |
|
AM_CONDITIONAL(WITH_PCRE32, test "x$enable_pcre32" = "xyes") |
559 |
AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes") |
AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes") |
560 |
AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes") |
AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes") |
561 |
|
AM_CONDITIONAL(WITH_JIT, test "x$enable_jit" = "xyes") |
562 |
|
AM_CONDITIONAL(WITH_UTF, test "x$enable_utf" = "xyes") |
563 |
|
AM_CONDITIONAL(WITH_VALGRIND, test "x$enable_valgrind" = "xyes") |
564 |
|
|
565 |
# Checks for typedefs, structures, and compiler characteristics. |
# Checks for typedefs, structures, and compiler characteristics. |
566 |
|
|
601 |
AC_MSG_CHECKING([for libbz2]) |
AC_MSG_CHECKING([for libbz2]) |
602 |
OLD_LIBS="$LIBS" |
OLD_LIBS="$LIBS" |
603 |
LIBS="$LIBS -lbz2" |
LIBS="$LIBS -lbz2" |
604 |
AC_LINK_IFELSE( AC_LANG_PROGRAM([[ |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
605 |
#ifdef HAVE_BZLIB_H |
#ifdef HAVE_BZLIB_H |
606 |
#include <bzlib.h> |
#include <bzlib.h> |
607 |
#endif]], |
#endif]], |
608 |
[[return (int)BZ2_bzopen("conftest", "rb");]]), |
[[return (int)BZ2_bzopen("conftest", "rb");]])], |
609 |
[AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;], |
[AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;], |
610 |
AC_MSG_RESULT([no])) |
AC_MSG_RESULT([no])) |
611 |
LIBS="$OLD_LIBS" |
LIBS="$OLD_LIBS" |
612 |
|
|
613 |
# Check for the availabiity of libreadline |
# Check for the availabiity of libreadline |
614 |
|
|
615 |
AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1]) |
if test "$enable_pcretest_libreadline" = "yes"; then |
616 |
AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1]) |
AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1]) |
617 |
AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1]) |
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 |
|
fi |
643 |
|
|
644 |
|
|
645 |
|
# Check for the availability of libedit. Different distributions put its |
646 |
|
# headers in different places. Try to cover the most common ones. |
647 |
|
|
648 |
|
if test "$enable_pcretest_libedit" = "yes"; then |
649 |
|
AC_CHECK_HEADERS([editline/readline.h], [HAVE_EDITLINE_READLINE_H=1], |
650 |
|
[AC_CHECK_HEADERS([edit/readline/readline.h], [HAVE_READLINE_READLINE_H=1], |
651 |
|
[AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_READLINE_H=1])])]) |
652 |
|
AC_CHECK_LIB([edit], [readline], [LIBEDIT="-ledit"]) |
653 |
|
fi |
654 |
|
|
655 |
# This facilitates -ansi builds under Linux |
# This facilitates -ansi builds under Linux |
656 |
dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc]) |
dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc]) |
658 |
PCRE_STATIC_CFLAG="" |
PCRE_STATIC_CFLAG="" |
659 |
if test "x$enable_shared" = "xno" ; then |
if test "x$enable_shared" = "xno" ; then |
660 |
AC_DEFINE([PCRE_STATIC], [1], [ |
AC_DEFINE([PCRE_STATIC], [1], [ |
661 |
Define if linking statically (TODO: make nice with Libtool)]) |
Define to any value if linking statically (TODO: make nice with Libtool)]) |
662 |
PCRE_STATIC_CFLAG="-DPCRE_STATIC" |
PCRE_STATIC_CFLAG="-DPCRE_STATIC" |
663 |
fi |
fi |
664 |
AC_SUBST(PCRE_STATIC_CFLAG) |
AC_SUBST(PCRE_STATIC_CFLAG) |
665 |
|
|
666 |
# Here is where pcre specific defines are handled |
# Here is where pcre specific defines are handled |
667 |
|
|
668 |
if test "$enable_utf8" = "yes"; then |
if test "$enable_pcre8" = "yes"; then |
669 |
AC_DEFINE([SUPPORT_UTF8], [], [ |
AC_DEFINE([SUPPORT_PCRE8], [], [ |
670 |
Define to enable support for the UTF-8 Unicode encoding. This will |
Define to any value to enable the 8 bit PCRE library.]) |
671 |
work even in an EBCDIC environment, but it is incompatible with |
fi |
672 |
the EBCDIC macro. That is, PCRE can support *either* EBCDIC code |
|
673 |
*or* ASCII/UTF-8, but not both at once.]) |
if test "$enable_pcre16" = "yes"; then |
674 |
|
AC_DEFINE([SUPPORT_PCRE16], [], [ |
675 |
|
Define to any value to enable the 16 bit PCRE library.]) |
676 |
|
fi |
677 |
|
|
678 |
|
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 |
|
if test "$enable_jit" = "yes"; then |
684 |
|
AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])]) |
685 |
|
CC="$PTHREAD_CC" |
686 |
|
CFLAGS="$PTHREAD_CFLAGS $CFLAGS" |
687 |
|
LIBS="$PTHREAD_LIBS $LIBS" |
688 |
|
AC_DEFINE([SUPPORT_JIT], [], [ |
689 |
|
Define to any value to enable support for Just-In-Time compiling.]) |
690 |
|
else |
691 |
|
enable_pcregrep_jit="no" |
692 |
|
fi |
693 |
|
|
694 |
|
if test "$enable_pcregrep_jit" = "yes"; then |
695 |
|
AC_DEFINE([SUPPORT_PCREGREP_JIT], [], [ |
696 |
|
Define to any value to enable JIT support in pcregrep.]) |
697 |
|
fi |
698 |
|
|
699 |
|
if test "$enable_utf" = "yes"; then |
700 |
|
AC_DEFINE([SUPPORT_UTF], [], [ |
701 |
|
Define to any value to enable support for the UTF-8/16/32 Unicode encoding. |
702 |
|
This will work even in an EBCDIC environment, but it is incompatible |
703 |
|
with the EBCDIC macro. That is, PCRE can support *either* EBCDIC |
704 |
|
code *or* ASCII/UTF-8/16/32, but not both at once.]) |
705 |
fi |
fi |
706 |
|
|
707 |
if test "$enable_unicode_properties" = "yes"; then |
if test "$enable_unicode_properties" = "yes"; then |
708 |
AC_DEFINE([SUPPORT_UCP], [], [ |
AC_DEFINE([SUPPORT_UCP], [], [ |
709 |
Define to enable support for Unicode properties]) |
Define to any value to enable support for Unicode properties.]) |
710 |
fi |
fi |
711 |
|
|
712 |
if test "$enable_stack_for_recursion" = "no"; then |
if test "$enable_stack_for_recursion" = "no"; then |
713 |
AC_DEFINE([NO_RECURSE], [], [ |
AC_DEFINE([NO_RECURSE], [], [ |
714 |
PCRE uses recursive function calls to handle backtracking while |
PCRE uses recursive function calls to handle backtracking while |
715 |
matching. This can sometimes be a problem on systems that have |
matching. This can sometimes be a problem on systems that have |
716 |
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 |
717 |
doesn't use recursion in the match() function; instead it creates |
version that doesn't use recursion in the match() function; instead |
718 |
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 |
719 |
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 |
720 |
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).]) |
|
721 |
fi |
fi |
722 |
|
|
723 |
if test "$enable_pcregrep_libz" = "yes"; then |
if test "$enable_pcregrep_libz" = "yes"; then |
724 |
AC_DEFINE([SUPPORT_LIBZ], [], [ |
AC_DEFINE([SUPPORT_LIBZ], [], [ |
725 |
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 |
726 |
able to handle .gz files.]) |
able to handle .gz files.]) |
727 |
fi |
fi |
728 |
|
|
729 |
if test "$enable_pcregrep_libbz2" = "yes"; then |
if test "$enable_pcregrep_libbz2" = "yes"; then |
730 |
AC_DEFINE([SUPPORT_LIBBZ2], [], [ |
AC_DEFINE([SUPPORT_LIBBZ2], [], [ |
731 |
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 |
732 |
able to handle .bz2 files.]) |
is able to handle .bz2 files.]) |
733 |
fi |
fi |
734 |
|
|
735 |
if test "$enable_pcretest_libreadline" = "yes"; then |
if test $with_pcregrep_bufsize -lt 8192 ; then |
736 |
|
with_pcregrep_bufsize="8192" |
737 |
|
fi |
738 |
|
|
739 |
|
AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [ |
740 |
|
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 |
|
|
745 |
|
if test "$enable_pcretest_libedit" = "yes"; then |
746 |
|
AC_DEFINE([SUPPORT_LIBEDIT], [], [ |
747 |
|
Define to any value to allow pcretest to be linked with libedit.]) |
748 |
|
LIBREADLINE="$LIBEDIT" |
749 |
|
elif test "$enable_pcretest_libreadline" = "yes"; then |
750 |
AC_DEFINE([SUPPORT_LIBREADLINE], [], [ |
AC_DEFINE([SUPPORT_LIBREADLINE], [], [ |
751 |
Define to allow pcretest to be linked with libreadline.]) |
Define to any value to allow pcretest to be linked with libreadline.]) |
752 |
fi |
fi |
753 |
|
|
754 |
AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [ |
AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [ |
755 |
The value of NEWLINE determines the newline character sequence. On |
The value of NEWLINE determines the default newline character sequence. PCRE |
756 |
systems that support it, "configure" can be used to override the |
client programs can override this by selecting other values at run time. In |
757 |
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 |
758 |
3338 (CRLF), -1 (ANY), or -2 (ANYCRLF).]) |
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 |
|
|
763 |
if test "$enable_bsr_anycrlf" = "yes"; then |
if test "$enable_bsr_anycrlf" = "yes"; then |
764 |
AC_DEFINE([BSR_ANYCRLF], [], [ |
AC_DEFINE([BSR_ANYCRLF], [], [ |
765 |
By default, the \R escape sequence matches any Unicode line ending |
By default, the \R escape sequence matches any Unicode line ending |
766 |
character or sequence of characters. If BSR_ANYCRLF is defined, this is |
character or sequence of characters. If BSR_ANYCRLF is defined (to any |
767 |
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. |
768 |
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.]) |
|
769 |
fi |
fi |
770 |
|
|
771 |
AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [ |
AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [ |
773 |
links as offsets within the compiled regex. The default is 2, which |
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 |
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 |
majority of cases. However, PCRE can also be compiled to use 3 or 4 |
776 |
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.]) |
|
777 |
|
|
778 |
AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [ |
AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [ |
779 |
When calling PCRE via the POSIX interface, additional working storage |
When calling PCRE via the POSIX interface, additional working storage |
782 |
interface provides only two. If the number of expected substrings is |
interface provides only two. If the number of expected substrings is |
783 |
small, the wrapper function uses space on the stack, because this is |
small, the wrapper function uses space on the stack, because this is |
784 |
faster than using malloc() for each call. The threshold above which |
faster than using malloc() for each call. The threshold above which |
785 |
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.]) |
|
786 |
|
|
787 |
AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [ |
AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [ |
788 |
The value of MATCH_LIMIT determines the default number of times the |
The value of MATCH_LIMIT determines the default number of times the |
791 |
limit. The limit exists in order to catch runaway regular |
limit. The limit exists in order to catch runaway regular |
792 |
expressions that take for ever to determine that they do not match. |
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 |
The default is set very large so that it does not accidentally catch |
794 |
legitimate cases. On systems that support it, "configure" can be |
legitimate cases.]) |
|
used to override this default default.]) |
|
795 |
|
|
796 |
AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [ |
AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [ |
797 |
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 |
802 |
MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To |
MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To |
803 |
have any useful effect, it must be less than the value of |
have any useful effect, it must be less than the value of |
804 |
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. |
805 |
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.]) |
|
806 |
|
|
807 |
AC_DEFINE([MAX_NAME_SIZE], [32], [ |
AC_DEFINE([MAX_NAME_SIZE], [32], [ |
808 |
This limit is parameterized just in case anybody ever wants to |
This limit is parameterized just in case anybody ever wants to |
818 |
/* 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 |
819 |
Win32, and it needs some magic to be inserted before the definition |
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 |
of a function that is exported by the library, define this macro to |
821 |
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 |
822 |
defaults to "extern" for a C compiler and "extern C" for a C++ |
__declspec value is used for Windows systems; in other environments |
823 |
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. |
824 |
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 |
825 |
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" |
826 |
which are internal to the library. */ |
in the C sense, but which are internal to the library. */ |
827 |
#undef PCRE_EXP_DEFN]) |
#undef PCRE_EXP_DEFN]) |
828 |
|
|
829 |
if test "$enable_ebcdic" = "yes"; then |
if test "$enable_ebcdic" = "yes"; then |
830 |
AC_DEFINE_UNQUOTED([EBCDIC], [], [ |
AC_DEFINE_UNQUOTED([EBCDIC], [], [ |
831 |
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 |
832 |
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 |
833 |
"configure", this can be done via --enable-ebcdic. PCRE will then |
NEWLINE macro below to set a suitable EBCDIC newline, commonly 21 (0x15). |
834 |
assume that all input strings are in EBCDIC. If you do not define |
On systems that can use "configure" or CMake to set EBCDIC, NEWLINE is |
835 |
this macro, PCRE will assume input strings are ASCII or UTF-8 Unicode. |
automatically adjusted. When EBCDIC is set, PCRE assumes that all input |
836 |
It is not possible to build a version of PCRE that supports both |
strings are in EBCDIC. If you do not define this macro, PCRE will assume |
837 |
EBCDIC and UTF-8.]) |
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 |
|
fi |
840 |
|
|
841 |
|
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 |
|
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 |
|
fi |
849 |
|
|
850 |
|
if test "$enable_valgrind" = "yes"; then |
851 |
|
AC_DEFINE_UNQUOTED([SUPPORT_VALGRIND], [], [ |
852 |
|
Define to any value for valgrind support to find invalid memory reads.]) |
853 |
fi |
fi |
854 |
|
|
855 |
# Platform specific issues |
# Platform specific issues |
870 |
EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \ |
EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \ |
871 |
$NO_UNDEFINED -version-info libpcre_version" |
$NO_UNDEFINED -version-info libpcre_version" |
872 |
|
|
873 |
|
EXTRA_LIBPCRE16_LDFLAGS="$EXTRA_LIBPCRE16_LDFLAGS \ |
874 |
|
$NO_UNDEFINED -version-info libpcre16_version" |
875 |
|
|
876 |
|
EXTRA_LIBPCRE32_LDFLAGS="$EXTRA_LIBPCRE32_LDFLAGS \ |
877 |
|
$NO_UNDEFINED -version-info libpcre32_version" |
878 |
|
|
879 |
EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \ |
EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \ |
880 |
$NO_UNDEFINED -version-info libpcreposix_version" |
$NO_UNDEFINED -version-info libpcreposix_version" |
881 |
|
|
884 |
$EXPORT_ALL_SYMBOLS" |
$EXPORT_ALL_SYMBOLS" |
885 |
|
|
886 |
AC_SUBST(EXTRA_LIBPCRE_LDFLAGS) |
AC_SUBST(EXTRA_LIBPCRE_LDFLAGS) |
887 |
|
AC_SUBST(EXTRA_LIBPCRE16_LDFLAGS) |
888 |
|
AC_SUBST(EXTRA_LIBPCRE32_LDFLAGS) |
889 |
AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS) |
AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS) |
890 |
AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS) |
AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS) |
891 |
|
|
892 |
# When we run 'make distcheck', use these arguments. |
# When we run 'make distcheck', use these arguments. Turning off compiler |
893 |
DISTCHECK_CONFIGURE_FLAGS="--enable-cpp --enable-unicode-properties" |
# optimization makes it run faster. |
894 |
|
DISTCHECK_CONFIGURE_FLAGS="CFLAGS='' CXXFLAGS='' --enable-pcre16 --enable-pcre32 --enable-jit --enable-cpp --enable-unicode-properties" |
895 |
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) |
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS) |
896 |
|
|
897 |
# Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is |
# Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is |
925 |
|
|
926 |
# Similarly for --enable-pcretest-readline |
# Similarly for --enable-pcretest-readline |
927 |
|
|
928 |
|
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 |
if test "$enable_pcretest_libreadline" = "yes"; then |
if test "$enable_pcretest_libreadline" = "yes"; then |
946 |
if test "$HAVE_READLINE_H" != "1"; then |
if test "$HAVE_READLINE_H" != "1"; then |
947 |
echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found." |
echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found." |
951 |
echo "** Cannot --enable-pcretest-readline because readline/history.h was not found." |
echo "** Cannot --enable-pcretest-readline because readline/history.h was not found." |
952 |
exit 1 |
exit 1 |
953 |
fi |
fi |
954 |
LIBREADLINE="-lreadline" |
if test -z "$LIBREADLINE"; then |
955 |
|
echo "** Cannot --enable-pcretest-readline because readline library was not found." |
956 |
|
exit 1 |
957 |
|
fi |
958 |
|
fi |
959 |
|
|
960 |
|
# 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 |
fi |
967 |
AC_SUBST(LIBREADLINE) |
|
968 |
|
# 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 |
|
Define to allow pcretest and pcregrep to be linked with gcov, so that they |
1001 |
|
are able to generate code coverage reports.]) |
1002 |
|
|
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 |
# Produce these files, in addition to config.h. |
# Produce these files, in addition to config.h. |
1015 |
AC_CONFIG_FILES( |
AC_CONFIG_FILES( |
1016 |
Makefile |
Makefile |
1017 |
libpcre.pc |
libpcre.pc |
1018 |
libpcreposix.pc |
libpcre16.pc |
1019 |
|
libpcre32.pc |
1020 |
|
libpcreposix.pc |
1021 |
libpcrecpp.pc |
libpcrecpp.pc |
1022 |
pcre-config |
pcre-config |
1023 |
pcre.h |
pcre.h |
1034 |
|
|
1035 |
AC_OUTPUT |
AC_OUTPUT |
1036 |
|
|
1037 |
# Print out a nice little message after configure is run displaying your |
# Print out a nice little message after configure is run displaying the |
1038 |
# chosen options. |
# chosen options. |
1039 |
|
|
1040 |
|
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 |
|
fi |
1046 |
|
|
1047 |
cat <<EOF |
cat <<EOF |
1048 |
|
|
1049 |
$PACKAGE-$VERSION configuration summary: |
$PACKAGE-$VERSION configuration summary: |
1055 |
C++ compiler .................... : ${CXX} |
C++ compiler .................... : ${CXX} |
1056 |
Linker .......................... : ${LD} |
Linker .......................... : ${LD} |
1057 |
C preprocessor flags ............ : ${CPPFLAGS} |
C preprocessor flags ............ : ${CPPFLAGS} |
1058 |
C compiler flags ................ : ${CFLAGS} |
C compiler flags ................ : ${CFLAGS} ${VISIBILITY_CFLAGS} |
1059 |
C++ compiler flags .............. : ${CXXFLAGS} |
C++ compiler flags .............. : ${CXXFLAGS} ${VISIBILITY_CXXFLAGS} |
1060 |
Linker flags .................... : ${LDFLAGS} |
Linker flags .................... : ${LDFLAGS} |
1061 |
Extra libraries ................. : ${LIBS} |
Extra libraries ................. : ${LIBS} |
1062 |
|
|
1063 |
|
Build 8 bit pcre library ........ : ${enable_pcre8} |
1064 |
|
Build 16 bit pcre library ....... : ${enable_pcre16} |
1065 |
|
Build 32 bit pcre library ....... : ${enable_pcre32} |
1066 |
Build C++ library ............... : ${enable_cpp} |
Build C++ library ............... : ${enable_cpp} |
1067 |
Enable UTF-8 support ............ : ${enable_utf8} |
Enable JIT compiling support .... : ${enable_jit} |
1068 |
|
Enable UTF-8/16/32 support ...... : ${enable_utf} |
1069 |
Unicode properties .............. : ${enable_unicode_properties} |
Unicode properties .............. : ${enable_unicode_properties} |
1070 |
Newline char/sequence ........... : ${enable_newline} |
Newline char/sequence ........... : ${enable_newline} |
1071 |
\R matches only ANYCRLF ......... : ${enable_bsr_anycrlf} |
\R matches only ANYCRLF ......... : ${enable_bsr_anycrlf} |
1072 |
EBCDIC coding ................... : ${enable_ebcdic} |
EBCDIC coding ................... : ${enable_ebcdic} |
1073 |
|
EBCDIC code for NL .............. : ${ebcdic_nl_code} |
1074 |
Rebuild char tables ............. : ${enable_rebuild_chartables} |
Rebuild char tables ............. : ${enable_rebuild_chartables} |
1075 |
Use stack recursion ............. : ${enable_stack_for_recursion} |
Use stack recursion ............. : ${enable_stack_for_recursion} |
1076 |
POSIX mem threshold ............. : ${with_posix_malloc_threshold} |
POSIX mem threshold ............. : ${with_posix_malloc_threshold} |
1079 |
Match limit recursion ........... : ${with_match_limit_recursion} |
Match limit recursion ........... : ${with_match_limit_recursion} |
1080 |
Build shared libs ............... : ${enable_shared} |
Build shared libs ............... : ${enable_shared} |
1081 |
Build static libs ............... : ${enable_static} |
Build static libs ............... : ${enable_static} |
1082 |
|
Use JIT in pcregrep ............. : ${enable_pcregrep_jit} |
1083 |
|
Buffer size for pcregrep ........ : ${with_pcregrep_bufsize} |
1084 |
Link pcregrep with libz ......... : ${enable_pcregrep_libz} |
Link pcregrep with libz ......... : ${enable_pcregrep_libz} |
1085 |
Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2} |
Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2} |
1086 |
|
Link pcretest with libedit ...... : ${enable_pcretest_libedit} |
1087 |
Link pcretest with libreadline .. : ${enable_pcretest_libreadline} |
Link pcretest with libreadline .. : ${enable_pcretest_libreadline} |
1088 |
|
Valgrind support ................ : ${enable_valgrind} |
1089 |
|
Code coverage ................... : ${enable_coverage} |
1090 |
|
|
1091 |
EOF |
EOF |
1092 |
|
|