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