| 1 |
dnl Process this file with autoconf to produce a configure script.
|
| 2 |
|
| 3 |
dnl This is required at the start; the name is the name of a file
|
| 4 |
dnl it should be seeing, to verify it is in the same directory.
|
| 5 |
|
| 6 |
AC_INIT(dftables.c)
|
| 7 |
|
| 8 |
dnl Arrange to build config.h from config.in. Note that pcre.h is
|
| 9 |
dnl built differently, as it is just a "substitution" file.
|
| 10 |
dnl Manual says this macro should come right after AC_INIT.
|
| 11 |
AC_CONFIG_HEADER(config.h:config.in)
|
| 12 |
|
| 13 |
dnl Provide the current PCRE version information. Do not use numbers
|
| 14 |
dnl with leading zeros for the minor version, as they end up in a C
|
| 15 |
dnl macro, and may be treated as octal constants. Stick to single
|
| 16 |
dnl digits for minor numbers less than 10. There are unlikely to be
|
| 17 |
dnl that many releases anyway.
|
| 18 |
|
| 19 |
PCRE_MAJOR=4
|
| 20 |
PCRE_MINOR=1
|
| 21 |
PCRE_DATE=12-Mar-2003
|
| 22 |
PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR}
|
| 23 |
|
| 24 |
dnl Default values for miscellaneous macros
|
| 25 |
|
| 26 |
POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10
|
| 27 |
|
| 28 |
dnl Provide versioning information for libtool shared libraries that
|
| 29 |
dnl are built by default on Unix systems.
|
| 30 |
|
| 31 |
PCRE_LIB_VERSION=0:1:0
|
| 32 |
PCRE_POSIXLIB_VERSION=0:0:0
|
| 33 |
|
| 34 |
dnl Checks for programs.
|
| 35 |
|
| 36 |
AC_PROG_CC
|
| 37 |
AC_PROG_INSTALL
|
| 38 |
AC_LIBTOOL_WIN32_DLL
|
| 39 |
AC_PROG_LIBTOOL
|
| 40 |
|
| 41 |
dnl This is the compiler for compiling a program to run on the local host
|
| 42 |
dnl while building. It needs to be different from CC when cross-compiling.
|
| 43 |
dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for
|
| 44 |
dnl figuring this out automatically, but I could not get it to work and I
|
| 45 |
dnl ran out of time. Therefore, these values will have to be set manually
|
| 46 |
dnl by people who are cross-compiling.
|
| 47 |
|
| 48 |
CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'}
|
| 49 |
CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'}
|
| 50 |
|
| 51 |
dnl Checks for header files.
|
| 52 |
|
| 53 |
AC_HEADER_STDC
|
| 54 |
AC_CHECK_HEADERS(limits.h)
|
| 55 |
|
| 56 |
dnl Checks for typedefs, structures, and compiler characteristics.
|
| 57 |
|
| 58 |
AC_C_CONST
|
| 59 |
AC_TYPE_SIZE_T
|
| 60 |
|
| 61 |
dnl Checks for library functions.
|
| 62 |
|
| 63 |
AC_CHECK_FUNCS(bcopy memmove strerror)
|
| 64 |
|
| 65 |
dnl Handle --enable-utf8
|
| 66 |
|
| 67 |
AC_ARG_ENABLE(utf8,
|
| 68 |
[ --enable-utf8 enable UTF8 support],
|
| 69 |
if test "$enableval" = "yes"; then
|
| 70 |
UTF8=-DSUPPORT_UTF8
|
| 71 |
fi
|
| 72 |
)
|
| 73 |
|
| 74 |
dnl Handle --enable-newline-is-cr
|
| 75 |
|
| 76 |
AC_ARG_ENABLE(newline-is-cr,
|
| 77 |
[ --enable-newline-is-cr use CR as the newline character],
|
| 78 |
if test "$enableval" = "yes"; then
|
| 79 |
NEWLINE=-DNEWLINE=13
|
| 80 |
fi
|
| 81 |
)
|
| 82 |
|
| 83 |
dnl Handle --enable-newline-is-lf
|
| 84 |
|
| 85 |
AC_ARG_ENABLE(newline-is-lf,
|
| 86 |
[ --enable-newline-is-lf use LF as the newline character],
|
| 87 |
if test "$enableval" = "yes"; then
|
| 88 |
NEWLINE=-DNEWLINE=10
|
| 89 |
fi
|
| 90 |
)
|
| 91 |
|
| 92 |
dnl There doesn't seem to be a straightforward way of having parameters
|
| 93 |
dnl that set values, other than fudging the --with thing. So that's what
|
| 94 |
dnl I've done.
|
| 95 |
|
| 96 |
dnl Handle --with-posix-malloc-threshold=n
|
| 97 |
|
| 98 |
AC_ARG_WITH(posix-malloc-threshold,
|
| 99 |
[ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage],
|
| 100 |
POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval
|
| 101 |
)
|
| 102 |
|
| 103 |
dnl Handle --with-link-size=n
|
| 104 |
|
| 105 |
AC_ARG_WITH(link-size,
|
| 106 |
[ --with-link-size=2 internal link size (2, 3, or 4 allowed)],
|
| 107 |
LINK_SIZE=-DLINK_SIZE=$withval
|
| 108 |
)
|
| 109 |
|
| 110 |
dnl Handle --with-match_limit=n
|
| 111 |
|
| 112 |
AC_ARG_WITH(match-limit,
|
| 113 |
[ --with-match-limit=10000000 default limit on internal looping)],
|
| 114 |
MATCH_LIMIT=-DMATCH_LIMIT=$withval
|
| 115 |
)
|
| 116 |
|
| 117 |
dnl Now arrange to build libtool
|
| 118 |
|
| 119 |
AC_PROG_LIBTOOL
|
| 120 |
|
| 121 |
dnl "Export" these variables
|
| 122 |
|
| 123 |
AC_SUBST(CC_FOR_BUILD)
|
| 124 |
AC_SUBST(CFLAGS_FOR_BUILD)
|
| 125 |
AC_SUBST(HAVE_MEMMOVE)
|
| 126 |
AC_SUBST(HAVE_STRERROR)
|
| 127 |
AC_SUBST(LINK_SIZE)
|
| 128 |
AC_SUBST(MATCH_LIMIT)
|
| 129 |
AC_SUBST(NEWLINE)
|
| 130 |
AC_SUBST(PCRE_MAJOR)
|
| 131 |
AC_SUBST(PCRE_MINOR)
|
| 132 |
AC_SUBST(PCRE_DATE)
|
| 133 |
AC_SUBST(PCRE_VERSION)
|
| 134 |
AC_SUBST(PCRE_LIB_VERSION)
|
| 135 |
AC_SUBST(PCRE_POSIXLIB_VERSION)
|
| 136 |
AC_SUBST(POSIX_MALLOC_THRESHOLD)
|
| 137 |
AC_SUBST(UTF8)
|
| 138 |
|
| 139 |
dnl Stuff to make Win32 work better
|
| 140 |
|
| 141 |
case $host_os in
|
| 142 |
mingw* )
|
| 143 |
POSIX_OBJ=pcreposix.o
|
| 144 |
POSIX_LOBJ=pcreposix.lo
|
| 145 |
POSIX_LIB=
|
| 146 |
;;
|
| 147 |
* )
|
| 148 |
POSIX_OBJ=
|
| 149 |
POSIX_LOBJ=
|
| 150 |
POSIX_LIB=libpcreposix.la
|
| 151 |
;;
|
| 152 |
esac
|
| 153 |
AC_SUBST(POSIX_OBJ)
|
| 154 |
AC_SUBST(POSIX_LOBJ)
|
| 155 |
AC_SUBST(POSIX_LIB)
|
| 156 |
|
| 157 |
if test "x$enable_shared" = "xno" ; then
|
| 158 |
AC_DEFINE(PCRE_STATIC,1)
|
| 159 |
fi
|
| 160 |
|
| 161 |
dnl This must be last; it determines what files are written as well as config.h
|
| 162 |
AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config:pcre-config.in RunTest:RunTest.in,[chmod a+x RunTest pcre-config])
|