1dnl Process this file with autoconf to produce a configure script. 2 3dnl This is required at the start; the name is the name of a file 4dnl it should be seeing, to verify it is in the same directory. 5 6AC_INIT(dftables.c) 7 8dnl A safety precaution 9 10AC_PREREQ(2.57) 11 12dnl Arrange to build config.h from config.in. Note that pcre.h is 13dnl built differently, as it is just a "substitution" file. 14dnl Manual says this macro should come right after AC_INIT. 15AC_CONFIG_HEADER(config.h:config.in) 16 17dnl Provide the current PCRE version information. Do not use numbers 18dnl with leading zeros for the minor version, as they end up in a C 19dnl macro, and may be treated as octal constants. Stick to single 20dnl digits for minor numbers less than 10. There are unlikely to be 21dnl that many releases anyway. 22 23PCRE_MAJOR=5 24PCRE_MINOR=0 25PCRE_DATE=13-Sep-2004 26PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} 27 28dnl Default values for miscellaneous macros 29 30POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10 31 32dnl Provide versioning information for libtool shared libraries that 33dnl are built by default on Unix systems. 34 35PCRE_LIB_VERSION=0:1:0 36PCRE_POSIXLIB_VERSION=0:0:0 37 38dnl Checks for programs. 39 40AC_PROG_CC 41 42dnl Checks for header files. 43 44AC_HEADER_STDC 45AC_CHECK_HEADERS(limits.h) 46 47dnl Checks for typedefs, structures, and compiler characteristics. 48 49AC_C_CONST 50AC_TYPE_SIZE_T 51 52dnl Checks for library functions. 53 54AC_CHECK_FUNCS(bcopy memmove strerror) 55 56dnl Handle --enable-shared-libraries 57 58LIBTOOL=./libtool 59LIBSUFFIX=la 60AC_ARG_ENABLE(shared, 61[ --disable-shared build PCRE as a static library], 62if test "$enableval" = "no"; then 63 LIBTOOL= 64 LIBSUFFIX=a 65fi 66) 67 68dnl Handle --enable-utf8 69 70AC_ARG_ENABLE(utf8, 71[ --enable-utf8 enable UTF8 support], 72if test "$enableval" = "yes"; then 73 UTF8=-DSUPPORT_UTF8 74fi 75) 76 77dnl Handle --enable-unicode-properties 78 79AC_ARG_ENABLE(unicode-properties, 80[ --enable-unicode-properties enable Unicode properties support], 81if test "$enableval" = "yes"; then 82 UCP=-DSUPPORT_UCP 83fi 84) 85 86dnl Handle --enable-newline-is-cr 87 88AC_ARG_ENABLE(newline-is-cr, 89[ --enable-newline-is-cr use CR as the newline character], 90if test "$enableval" = "yes"; then 91 NEWLINE=-DNEWLINE=13 92fi 93) 94 95dnl Handle --enable-newline-is-lf 96 97AC_ARG_ENABLE(newline-is-lf, 98[ --enable-newline-is-lf use LF as the newline character], 99if test "$enableval" = "yes"; then 100 NEWLINE=-DNEWLINE=10 101fi 102) 103 104dnl Handle --enable-ebcdic 105 106AC_ARG_ENABLE(ebcdic, 107[ --enable-ebcdic assume EBCDIC coding rather than ASCII], 108if test "$enableval" == "yes"; then 109 EBCDIC=-DEBCDIC=1 110fi 111) 112 113dnl Handle --disable-stack-for-recursion 114 115AC_ARG_ENABLE(stack-for-recursion, 116[ --disable-stack-for-recursion disable use of stack recursion when matching], 117if test "$enableval" = "no"; then 118 NO_RECURSE=-DNO_RECURSE 119fi 120) 121 122dnl There doesn't seem to be a straightforward way of having parameters 123dnl that set values, other than fudging the --with thing. So that's what 124dnl I've done. 125 126dnl Handle --with-posix-malloc-threshold=n 127 128AC_ARG_WITH(posix-malloc-threshold, 129[ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage], 130 POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval 131) 132 133dnl Handle --with-link-size=n 134 135AC_ARG_WITH(link-size, 136[ --with-link-size=2 internal link size (2, 3, or 4 allowed)], 137 LINK_SIZE=-DLINK_SIZE=$withval 138) 139 140dnl Handle --with-match_limit=n 141 142AC_ARG_WITH(match-limit, 143[ --with-match-limit=10000000 default limit on internal looping)], 144 MATCH_LIMIT=-DMATCH_LIMIT=$withval 145) 146 147dnl Unicode character property support implies UTF-8 support 148 149if test "$UCP" != "" ; then 150 UTF8=-DSUPPORT_UTF8 151fi 152 153dnl "Export" these variables 154 155AC_SUBST(BUILD_EXEEXT) 156AC_SUBST(BUILD_OBJEXT) 157AC_SUBST(CC_FOR_BUILD) 158AC_SUBST(CFLAGS_FOR_BUILD) 159AC_SUBST(EBCDIC) 160AC_SUBST(HAVE_MEMMOVE) 161AC_SUBST(HAVE_STRERROR) 162AC_SUBST(LIBTOOL) 163AC_SUBST(LIBSUFFIX) 164AC_SUBST(LINK_SIZE) 165AC_SUBST(MATCH_LIMIT) 166AC_SUBST(NEWLINE) 167AC_SUBST(NO_RECURSE) 168AC_SUBST(PCRE_MAJOR) 169AC_SUBST(PCRE_MINOR) 170AC_SUBST(PCRE_DATE) 171AC_SUBST(PCRE_VERSION) 172AC_SUBST(PCRE_LIB_VERSION) 173AC_SUBST(PCRE_POSIXLIB_VERSION) 174AC_SUBST(POSIX_MALLOC_THRESHOLD) 175AC_SUBST(UCP) 176AC_SUBST(UTF8) 177 178 179if test "x$enable_shared" = "xno" ; then 180 AC_DEFINE([PCRE_STATIC],[1],[to link statically]) 181fi 182 183dnl This must be last; it determines what files are written as well as config.h 184AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config,[chmod a+x pcre-config]) 185 186