| 1 |
dnl Process this file with autoconf to produce a configure script. |
dnl Process this file with autoconf to produce a configure script. |
| 2 |
|
|
| 3 |
dnl NOTE FOR MAINTAINERS: Do not use major or minor version numbers with |
dnl NOTE FOR MAINTAINERS: Do not use minor version numbers 08 or 09 because |
| 4 |
dnl leading zeros, because they may be treated as octal constants. The |
dnl the leading zeros may cause them to be treated as invalid octal constants |
| 5 |
dnl PCRE_PRERELEASE feature is for identifying release candidates. It might |
dnl if a PCRE user writes code that uses PCRE_MINOR as a number. There is now |
| 6 |
dnl be defined as -RC2, for example. For real releases, it should be defined |
dnl a check further down that throws an error if 08 or 09 are used. |
| 7 |
dnl empty. |
|
| 8 |
|
dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might |
| 9 |
|
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, [00]) |
m4_define(pcre_minor, [01]) |
| 13 |
m4_define(pcre_prerelease, [-RC1]) |
m4_define(pcre_prerelease, [-RC1]) |
| 14 |
m4_define(pcre_date, [2009-04-23]) |
m4_define(pcre_date, [2010-01-02]) |
| 15 |
|
|
| 16 |
# Libtool shared library interface versions (current:revision:age) |
# Libtool shared library interface versions (current:revision:age) |
| 17 |
m4_define(libpcre_version, [0:1:0]) |
m4_define(libpcre_version, [0:1:0]) |
| 24 |
AM_INIT_AUTOMAKE([dist-bzip2 dist-zip]) |
AM_INIT_AUTOMAKE([dist-bzip2 dist-zip]) |
| 25 |
AC_CONFIG_HEADERS(config.h) |
AC_CONFIG_HEADERS(config.h) |
| 26 |
|
|
| 27 |
|
# This was added at the suggestion of libtoolize (03-Jan-10) |
| 28 |
|
AC_CONFIG_MACRO_DIR([m4]) |
| 29 |
|
|
| 30 |
# The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just |
# The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just |
| 31 |
# "-g" for any other compiler. There doesn't seem to be a standard way of |
# "-g" for any other compiler. There doesn't seem to be a standard way of |
| 32 |
# getting rid of the -g (which I don't think is needed for a production |
# getting rid of the -g (which I don't think is needed for a production |
| 71 |
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[]),, CXX=""; CXXCP=""; CXXFLAGS="") |
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[]),, CXX=""; CXXCP=""; CXXFLAGS="") |
| 72 |
AC_LANG_POP |
AC_LANG_POP |
| 73 |
|
|
| 74 |
|
# Check for a 64-bit integer type |
| 75 |
|
AC_TYPE_INT64_T |
| 76 |
|
|
| 77 |
AC_PROG_INSTALL |
AC_PROG_INSTALL |
| 78 |
AC_LIBTOOL_WIN32_DLL |
AC_LIBTOOL_WIN32_DLL |
| 79 |
AC_PROG_LIBTOOL |
AC_PROG_LIBTOOL |
| 84 |
PCRE_PRERELEASE="pcre_prerelease" |
PCRE_PRERELEASE="pcre_prerelease" |
| 85 |
PCRE_DATE="pcre_date" |
PCRE_DATE="pcre_date" |
| 86 |
|
|
| 87 |
|
if test "$PCRE_MINOR" = "08" -o "$PCRE_MINOR" = "09" |
| 88 |
|
then |
| 89 |
|
echo "***" |
| 90 |
|
echo "*** Minor version number $PCRE_MINOR must not be used. ***" |
| 91 |
|
echo "*** Use only 01 to 07 or 10 onwards, to avoid octal issues. ***" |
| 92 |
|
echo "***" |
| 93 |
|
exit 1 |
| 94 |
|
fi |
| 95 |
|
|
| 96 |
AC_SUBST(PCRE_MAJOR) |
AC_SUBST(PCRE_MAJOR) |
| 97 |
AC_SUBST(PCRE_MINOR) |
AC_SUBST(PCRE_MINOR) |
| 98 |
AC_SUBST(PCRE_PRERELEASE) |
AC_SUBST(PCRE_PRERELEASE) |
| 382 |
AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1]) |
AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1]) |
| 383 |
AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1]) |
AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1]) |
| 384 |
|
|
| 385 |
# Check for the availability of libbz2 |
# Check for the availability of libbz2. Originally we just used AC_CHECK_LIB, |
| 386 |
|
# as for libz. However, this had the following problem, diagnosed and fixed by |
| 387 |
|
# a user: |
| 388 |
|
# |
| 389 |
|
# - libbz2 uses the Pascal calling convention (WINAPI) for the functions |
| 390 |
|
# under Win32. |
| 391 |
|
# - The standard autoconf AC_CHECK_LIB fails to include "bzlib.h", |
| 392 |
|
# therefore missing the function definition. |
| 393 |
|
# - The compiler thus generates a "C" signature for the test function. |
| 394 |
|
# - The linker fails to find the "C" function. |
| 395 |
|
# - PCRE fails to configure if asked to do so against libbz2. |
| 396 |
|
# |
| 397 |
|
# Solution: |
| 398 |
|
# |
| 399 |
|
# - Replace the AC_CHECK_LIB test with a custom test. |
| 400 |
|
|
| 401 |
AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1]) |
AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1]) |
| 402 |
AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1]) |
# Original test |
| 403 |
|
# AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1]) |
| 404 |
|
# |
| 405 |
|
# Custom test follows |
| 406 |
|
|
| 407 |
|
AC_MSG_CHECKING([for libbz2]) |
| 408 |
|
OLD_LIBS="$LIBS" |
| 409 |
|
LIBS="$LIBS -lbz2" |
| 410 |
|
AC_LINK_IFELSE( AC_LANG_PROGRAM([[ |
| 411 |
|
#ifdef HAVE_BZLIB_H |
| 412 |
|
#include <bzlib.h> |
| 413 |
|
#endif]], |
| 414 |
|
[[return (int)BZ2_bzopen("conftest", "rb");]]), |
| 415 |
|
[AC_MSG_RESULT([yes]);HAVE_LIBBZ2=1; break;], |
| 416 |
|
AC_MSG_RESULT([no])) |
| 417 |
|
LIBS="$OLD_LIBS" |
| 418 |
|
|
| 419 |
# Check for the availabiity of libreadline |
# Check for the availabiity of libreadline |
| 420 |
|
|
| 425 |
# This facilitates -ansi builds under Linux |
# This facilitates -ansi builds under Linux |
| 426 |
dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc]) |
dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc]) |
| 427 |
|
|
| 428 |
|
PCRE_STATIC_CFLAG="" |
| 429 |
if test "x$enable_shared" = "xno" ; then |
if test "x$enable_shared" = "xno" ; then |
| 430 |
AC_DEFINE([PCRE_STATIC], [1], [ |
AC_DEFINE([PCRE_STATIC], [1], [ |
| 431 |
Define if linking statically (TODO: make nice with Libtool)]) |
Define if linking statically (TODO: make nice with Libtool)]) |
| 432 |
|
PCRE_STATIC_CFLAG="-DPCRE_STATIC" |
| 433 |
fi |
fi |
| 434 |
|
AC_SUBST(PCRE_STATIC_CFLAG) |
| 435 |
|
|
| 436 |
# Here is where pcre specific defines are handled |
# Here is where pcre specific defines are handled |
| 437 |
|
|
| 649 |
AC_CONFIG_FILES( |
AC_CONFIG_FILES( |
| 650 |
Makefile |
Makefile |
| 651 |
libpcre.pc |
libpcre.pc |
| 652 |
|
libpcreposix.pc |
| 653 |
libpcrecpp.pc |
libpcrecpp.pc |
| 654 |
pcre-config |
pcre-config |
| 655 |
pcre.h |
pcre.h |