--- code/trunk/configure.in 2007/02/24 21:39:17 41 +++ code/trunk/configure.in 2007/02/24 21:39:50 57 @@ -5,36 +5,91 @@ AC_INIT(dftables.c) +dnl Arrange to build config.h from config.in. Note that pcre.h is +dnl built differently, as it is just a "substitution" file. +dnl Manual says this macro should come right after AC_INIT. +AC_CONFIG_HEADER(config.h:config.in) + +dnl Provide the current PCRE version information. Do not use numbers +dnl with leading zeros for the minor version, as they end up in a C +dnl macro, and may be treated as octal constants. Stick to single +dnl digits for minor numbers less than 10. There are unlikely to be +dnl that many releases anyway. + +PCRE_MAJOR=3 +PCRE_MINOR=7 +PCRE_DATE=29-Oct-2001 +PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} + +dnl Provide versioning information for libtool shared libraries that +dnl are built by default on Unix systems. + +PCRE_LIB_VERSION=0:1:0 +PCRE_POSIXLIB_VERSION=0:0:0 + dnl Checks for programs. + AC_PROG_CC +AC_PROG_INSTALL AC_PROG_RANLIB dnl Checks for header files. + AC_HEADER_STDC AC_CHECK_HEADERS(limits.h) dnl Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST AC_TYPE_SIZE_T dnl Checks for library functions. -AC_CHECK_FUNCS(memmove strerror) -dnl Arrange to build config.h from config.in -AC_CONFIG_HEADER(config.h:config.in) +AC_CHECK_FUNCS(bcopy memmove strerror) + +dnl Handle --enable-utf8 + +AC_ARG_ENABLE(utf8, +[ --enable-utf8 enable UTF8 support (incomplete)], +if test "$enableval" = "yes"; then + UTF8=-DSUPPORT_UTF8 +fi +) + +dnl Handle --enable-newline-is-cr + +AC_ARG_ENABLE(newline-is-cr, +[ --enable-newline-is-cr use CR as the newline character], +if test "$enableval" = "yes"; then + NEWLINE=-DNEWLINE=13 +fi +) + +dnl Handle --enable-newline-is-lf -dnl Handle --enable-shared-libraries -LIBTOOL= -LIBSUFFIX=a -AC_ARG_ENABLE(shared, -[ --enable-shared build PCRE as a shared library (using libtool)], +AC_ARG_ENABLE(newline-is-lf, +[ --enable-newline-is-lf use LF as the newline character], if test "$enableval" = "yes"; then - LIBTOOL=libtool - LIBSUFFIX=la + NEWLINE=-DNEWLINE=10 fi ) -AC_SUBST(LIBTOOL) -AC_SUBST(LIBSUFFIX) -dnl This must be last; it determines what files are written -AC_OUTPUT(Makefile) +dnl Now arrange to build libtool + +AC_PROG_LIBTOOL + +dnl "Export" these variables + +AC_SUBST(HAVE_MEMMOVE) +AC_SUBST(HAVE_STRERROR) +AC_SUBST(NEWLINE) +AC_SUBST(UTF8) +AC_SUBST(PCRE_MAJOR) +AC_SUBST(PCRE_MINOR) +AC_SUBST(PCRE_DATE) +AC_SUBST(PCRE_VERSION) +AC_SUBST(PCRE_LIB_VERSION) +AC_SUBST(PCRE_POSIXLIB_VERSION) + +dnl This must be last; it determines what files are written as well as config.h +AC_OUTPUT(Makefile pcre.h:pcre.in pcre-config:pcre-config.in RunTest:RunTest.in,[chmod a+x RunTest pcre-config])