| 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 |
77 |
PCRE_MAJOR=6 |
| 24 |
nigel |
81 |
PCRE_MINOR=2 |
| 25 |
|
|
PCRE_DATE=01-Aug-2005 |
| 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 |
nigel |
77 |
PCRE_CPPLIB_VERSION=0:0:0 |
| 38 |
nigel |
43 |
|
| 39 |
nigel |
41 |
dnl Checks for programs. |
| 40 |
nigel |
43 |
|
| 41 |
nigel |
41 |
AC_PROG_CC |
| 42 |
nigel |
75 |
|
| 43 |
nigel |
77 |
dnl For the C++ wrapper libpcrecpp. |
| 44 |
|
|
|
| 45 |
|
|
AC_PROG_CXX |
| 46 |
|
|
|
| 47 |
nigel |
75 |
dnl The icc compiler has the same options as gcc, so let the rest of the |
| 48 |
|
|
dnl configure script think it has gcc when setting up dnl options etc. |
| 49 |
|
|
dnl This is a nasty hack which no longer seems necessary with the update |
| 50 |
|
|
dnl to the latest libtool files, so I have commented it out. |
| 51 |
|
|
dnl |
| 52 |
|
|
dnl if test "$CC" = "icc" ; then GCC=yes ; fi |
| 53 |
|
|
|
| 54 |
nigel |
53 |
AC_PROG_INSTALL |
| 55 |
nigel |
63 |
AC_LIBTOOL_WIN32_DLL |
| 56 |
|
|
AC_PROG_LIBTOOL |
| 57 |
nigel |
41 |
|
| 58 |
nigel |
67 |
dnl We need to find a compiler for compiling a program to run on the local host |
| 59 |
nigel |
65 |
dnl while building. It needs to be different from CC when cross-compiling. |
| 60 |
|
|
dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for |
| 61 |
nigel |
67 |
dnl figuring this out automatically. Unfortunately, it does not work with the |
| 62 |
|
|
dnl latest versions of autoconf. So for the moment, we just default to the |
| 63 |
|
|
dnl same values as the "main" compiler. People who are corss-compiling will |
| 64 |
|
|
dnl just have to adjust the Makefile by hand or set these values when they |
| 65 |
|
|
dnl run "configure". |
| 66 |
nigel |
65 |
|
| 67 |
|
|
CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'} |
| 68 |
nigel |
77 |
CXX_FOR_BUILD=${CXX_FOR_BUILD:-'$(CXX)'} |
| 69 |
nigel |
65 |
CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'} |
| 70 |
nigel |
77 |
CPPFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CPPFLAGS)'} |
| 71 |
|
|
CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD:-'$(CXXFLAGS)'} |
| 72 |
nigel |
67 |
BUILD_EXEEXT=${BUILD_EXEEXT:-'$(EXEEXT)'} |
| 73 |
|
|
BUILD_OBJEXT=${BUILD_OBJEXT:-'$(OBJEXT)'} |
| 74 |
nigel |
65 |
|
| 75 |
nigel |
41 |
dnl Checks for header files. |
| 76 |
nigel |
43 |
|
| 77 |
nigel |
41 |
AC_HEADER_STDC |
| 78 |
|
|
AC_CHECK_HEADERS(limits.h) |
| 79 |
|
|
|
| 80 |
nigel |
77 |
dnl These are C++ header files |
| 81 |
|
|
|
| 82 |
|
|
AC_LANG_SAVE |
| 83 |
|
|
AC_LANG_CPLUSPLUS |
| 84 |
|
|
dnl I could be more clever here, given I'm doing AC_SUBST with this |
| 85 |
|
|
dnl (eg set a var to be the name of the include file I want). But I'm not |
| 86 |
|
|
dnl so it's easy to change back to 'regular' autoconf vars if we needed to. |
| 87 |
nigel |
79 |
AC_CHECK_HEADERS(string, [pcre_has_cpp_headers="1"], |
| 88 |
|
|
[pcre_has_cpp_headers="0"]) |
| 89 |
nigel |
77 |
AC_CHECK_HEADERS(bits/type_traits.h, [pcre_has_bits_type_traits="1"], |
| 90 |
|
|
[pcre_has_bits_type_traits="0"]) |
| 91 |
|
|
AC_CHECK_HEADERS(type_traits.h, [pcre_has_type_traits="1"], |
| 92 |
|
|
[pcre_has_type_traits="0"]) |
| 93 |
|
|
dnl Using AC_SUBST eliminates the need to include config.h in a public .h file |
| 94 |
|
|
AC_SUBST(pcre_has_bits_type_traits) |
| 95 |
|
|
AC_SUBST(pcre_has_type_traits) |
| 96 |
|
|
AC_LANG_RESTORE |
| 97 |
|
|
|
| 98 |
nigel |
79 |
dnl From the above, we now have enough info to know if C++ is fully installed |
| 99 |
|
|
if test -n "$ac_cv_prog_ac_ct_CXX" -a "$pcre_has_cpp_headers" = 1; then |
| 100 |
|
|
MAYBE_CPP_TARGETS='$(CPP_TARGETS)' |
| 101 |
|
|
fi |
| 102 |
|
|
AC_SUBST(MAYBE_CPP_TARGETS) |
| 103 |
|
|
|
| 104 |
|
|
|
| 105 |
nigel |
41 |
dnl Checks for typedefs, structures, and compiler characteristics. |
| 106 |
nigel |
43 |
|
| 107 |
nigel |
41 |
AC_C_CONST |
| 108 |
|
|
AC_TYPE_SIZE_T |
| 109 |
|
|
|
| 110 |
nigel |
77 |
AC_CHECK_TYPES([long long], [pcre_has_long_long="1"], [pcre_has_long_long="0"]) |
| 111 |
|
|
AC_CHECK_TYPES([unsigned long long], [pcre_has_ulong_long="1"], [pcre_has_ulong_long="0"]) |
| 112 |
|
|
AC_SUBST(pcre_has_long_long) |
| 113 |
|
|
AC_SUBST(pcre_has_ulong_long) |
| 114 |
|
|
|
| 115 |
nigel |
41 |
dnl Checks for library functions. |
| 116 |
nigel |
43 |
|
| 117 |
nigel |
77 |
AC_CHECK_FUNCS(bcopy memmove strerror strtoq strtoll) |
| 118 |
nigel |
41 |
|
| 119 |
nigel |
49 |
dnl Handle --enable-utf8 |
| 120 |
|
|
|
| 121 |
|
|
AC_ARG_ENABLE(utf8, |
| 122 |
nigel |
63 |
[ --enable-utf8 enable UTF8 support], |
| 123 |
nigel |
49 |
if test "$enableval" = "yes"; then |
| 124 |
|
|
UTF8=-DSUPPORT_UTF8 |
| 125 |
|
|
fi |
| 126 |
|
|
) |
| 127 |
|
|
|
| 128 |
nigel |
75 |
dnl Handle --enable-unicode-properties |
| 129 |
|
|
|
| 130 |
|
|
AC_ARG_ENABLE(unicode-properties, |
| 131 |
|
|
[ --enable-unicode-properties enable Unicode properties support], |
| 132 |
|
|
if test "$enableval" = "yes"; then |
| 133 |
|
|
UCP=-DSUPPORT_UCP |
| 134 |
|
|
fi |
| 135 |
|
|
) |
| 136 |
|
|
|
| 137 |
nigel |
53 |
dnl Handle --enable-newline-is-cr |
| 138 |
|
|
|
| 139 |
|
|
AC_ARG_ENABLE(newline-is-cr, |
| 140 |
|
|
[ --enable-newline-is-cr use CR as the newline character], |
| 141 |
|
|
if test "$enableval" = "yes"; then |
| 142 |
|
|
NEWLINE=-DNEWLINE=13 |
| 143 |
|
|
fi |
| 144 |
|
|
) |
| 145 |
|
|
|
| 146 |
|
|
dnl Handle --enable-newline-is-lf |
| 147 |
|
|
|
| 148 |
|
|
AC_ARG_ENABLE(newline-is-lf, |
| 149 |
|
|
[ --enable-newline-is-lf use LF as the newline character], |
| 150 |
|
|
if test "$enableval" = "yes"; then |
| 151 |
|
|
NEWLINE=-DNEWLINE=10 |
| 152 |
|
|
fi |
| 153 |
|
|
) |
| 154 |
|
|
|
| 155 |
nigel |
73 |
dnl Handle --enable-ebcdic |
| 156 |
|
|
|
| 157 |
|
|
AC_ARG_ENABLE(ebcdic, |
| 158 |
|
|
[ --enable-ebcdic assume EBCDIC coding rather than ASCII], |
| 159 |
|
|
if test "$enableval" == "yes"; then |
| 160 |
|
|
EBCDIC=-DEBCDIC=1 |
| 161 |
|
|
fi |
| 162 |
|
|
) |
| 163 |
|
|
|
| 164 |
|
|
dnl Handle --disable-stack-for-recursion |
| 165 |
nigel |
75 |
|
| 166 |
|
|
AC_ARG_ENABLE(stack-for-recursion, |
| 167 |
nigel |
73 |
[ --disable-stack-for-recursion disable use of stack recursion when matching], |
| 168 |
|
|
if test "$enableval" = "no"; then |
| 169 |
|
|
NO_RECURSE=-DNO_RECURSE |
| 170 |
|
|
fi |
| 171 |
|
|
) |
| 172 |
|
|
|
| 173 |
nigel |
63 |
dnl There doesn't seem to be a straightforward way of having parameters |
| 174 |
|
|
dnl that set values, other than fudging the --with thing. So that's what |
| 175 |
|
|
dnl I've done. |
| 176 |
|
|
|
| 177 |
|
|
dnl Handle --with-posix-malloc-threshold=n |
| 178 |
|
|
|
| 179 |
|
|
AC_ARG_WITH(posix-malloc-threshold, |
| 180 |
|
|
[ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage], |
| 181 |
|
|
POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval |
| 182 |
|
|
) |
| 183 |
|
|
|
| 184 |
|
|
dnl Handle --with-link-size=n |
| 185 |
|
|
|
| 186 |
|
|
AC_ARG_WITH(link-size, |
| 187 |
|
|
[ --with-link-size=2 internal link size (2, 3, or 4 allowed)], |
| 188 |
|
|
LINK_SIZE=-DLINK_SIZE=$withval |
| 189 |
|
|
) |
| 190 |
|
|
|
| 191 |
|
|
dnl Handle --with-match_limit=n |
| 192 |
|
|
|
| 193 |
|
|
AC_ARG_WITH(match-limit, |
| 194 |
|
|
[ --with-match-limit=10000000 default limit on internal looping)], |
| 195 |
|
|
MATCH_LIMIT=-DMATCH_LIMIT=$withval |
| 196 |
|
|
) |
| 197 |
|
|
|
| 198 |
nigel |
75 |
dnl Unicode character property support implies UTF-8 support |
| 199 |
|
|
|
| 200 |
|
|
if test "$UCP" != "" ; then |
| 201 |
|
|
UTF8=-DSUPPORT_UTF8 |
| 202 |
|
|
fi |
| 203 |
|
|
|
| 204 |
nigel |
43 |
dnl "Export" these variables |
| 205 |
|
|
|
| 206 |
nigel |
67 |
AC_SUBST(BUILD_EXEEXT) |
| 207 |
|
|
AC_SUBST(BUILD_OBJEXT) |
| 208 |
nigel |
65 |
AC_SUBST(CC_FOR_BUILD) |
| 209 |
nigel |
77 |
AC_SUBST(CXX_FOR_BUILD) |
| 210 |
nigel |
65 |
AC_SUBST(CFLAGS_FOR_BUILD) |
| 211 |
nigel |
77 |
AC_SUBST(CXXFLAGS_FOR_BUILD) |
| 212 |
nigel |
73 |
AC_SUBST(EBCDIC) |
| 213 |
nigel |
43 |
AC_SUBST(HAVE_MEMMOVE) |
| 214 |
|
|
AC_SUBST(HAVE_STRERROR) |
| 215 |
nigel |
63 |
AC_SUBST(LINK_SIZE) |
| 216 |
|
|
AC_SUBST(MATCH_LIMIT) |
| 217 |
nigel |
65 |
AC_SUBST(NEWLINE) |
| 218 |
nigel |
73 |
AC_SUBST(NO_RECURSE) |
| 219 |
nigel |
43 |
AC_SUBST(PCRE_MAJOR) |
| 220 |
|
|
AC_SUBST(PCRE_MINOR) |
| 221 |
|
|
AC_SUBST(PCRE_DATE) |
| 222 |
|
|
AC_SUBST(PCRE_VERSION) |
| 223 |
|
|
AC_SUBST(PCRE_LIB_VERSION) |
| 224 |
|
|
AC_SUBST(PCRE_POSIXLIB_VERSION) |
| 225 |
nigel |
77 |
AC_SUBST(PCRE_CPPLIB_VERSION) |
| 226 |
nigel |
63 |
AC_SUBST(POSIX_MALLOC_THRESHOLD) |
| 227 |
nigel |
75 |
AC_SUBST(UCP) |
| 228 |
nigel |
65 |
AC_SUBST(UTF8) |
| 229 |
nigel |
41 |
|
| 230 |
nigel |
71 |
dnl Stuff to make MinGW work better. Special treatment is no longer |
| 231 |
|
|
dnl needed for Cygwin. |
| 232 |
nigel |
63 |
|
| 233 |
|
|
case $host_os in |
| 234 |
|
|
mingw* ) |
| 235 |
|
|
POSIX_OBJ=pcreposix.o |
| 236 |
|
|
POSIX_LOBJ=pcreposix.lo |
| 237 |
|
|
POSIX_LIB= |
| 238 |
nigel |
67 |
ON_WINDOWS= |
| 239 |
|
|
NOT_ON_WINDOWS="#" |
| 240 |
|
|
WIN_PREFIX= |
| 241 |
nigel |
63 |
;; |
| 242 |
|
|
* ) |
| 243 |
nigel |
67 |
ON_WINDOWS="#" |
| 244 |
|
|
NOT_ON_WINDOWS= |
| 245 |
nigel |
63 |
POSIX_OBJ= |
| 246 |
|
|
POSIX_LOBJ= |
| 247 |
|
|
POSIX_LIB=libpcreposix.la |
| 248 |
nigel |
67 |
WIN_PREFIX= |
| 249 |
nigel |
63 |
;; |
| 250 |
|
|
esac |
| 251 |
nigel |
67 |
AC_SUBST(WIN_PREFIX) |
| 252 |
|
|
AC_SUBST(ON_WINDOWS) |
| 253 |
|
|
AC_SUBST(NOT_ON_WINDOWS) |
| 254 |
nigel |
63 |
AC_SUBST(POSIX_OBJ) |
| 255 |
|
|
AC_SUBST(POSIX_LOBJ) |
| 256 |
|
|
AC_SUBST(POSIX_LIB) |
| 257 |
|
|
|
| 258 |
|
|
if test "x$enable_shared" = "xno" ; then |
| 259 |
nigel |
71 |
AC_DEFINE([PCRE_STATIC],[1],[to link statically]) |
| 260 |
nigel |
63 |
fi |
| 261 |
|
|
|
| 262 |
nigel |
53 |
dnl This must be last; it determines what files are written as well as config.h |
| 263 |
nigel |
77 |
AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config:pcre-config.in libpcre.pc:libpcre.pc.in pcrecpp.h:pcrecpp.h.in pcre_stringpiece.h:pcre_stringpiece.h.in RunGrepTest:RunGrepTest.in RunTest:RunTest.in,[chmod a+x RunTest RunGrepTest pcre-config]) |