--- code/trunk/configure.in 2007/02/24 21:39:54 59 +++ code/trunk/configure.in 2007/02/24 21:40:08 65 @@ -16,11 +16,15 @@ dnl digits for minor numbers less than 10. There are unlikely to be dnl that many releases anyway. -PCRE_MAJOR=3 -PCRE_MINOR=8 -PCRE_DATE=18-Dec-2001 +PCRE_MAJOR=4 +PCRE_MINOR=1 +PCRE_DATE=12-Mar-2003 PCRE_VERSION=${PCRE_MAJOR}.${PCRE_MINOR} +dnl Default values for miscellaneous macros + +POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=10 + dnl Provide versioning information for libtool shared libraries that dnl are built by default on Unix systems. @@ -31,7 +35,18 @@ AC_PROG_CC AC_PROG_INSTALL -AC_PROG_RANLIB +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL + +dnl This is the compiler for compiling a program to run on the local host +dnl while building. It needs to be different from CC when cross-compiling. +dnl There is a macro called AC_PROG_CC_FOR_BUILD in the GNU archive for +dnl figuring this out automatically, but I could not get it to work and I +dnl ran out of time. Therefore, these values will have to be set manually +dnl by people who are cross-compiling. + +CC_FOR_BUILD=${CC_FOR_BUILD:-'$(CC)'} +CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-'$(CFLAGS)'} dnl Checks for header files. @@ -50,7 +65,7 @@ dnl Handle --enable-utf8 AC_ARG_ENABLE(utf8, -[ --enable-utf8 enable UTF8 support (incomplete)], +[ --enable-utf8 enable UTF8 support], if test "$enableval" = "yes"; then UTF8=-DSUPPORT_UTF8 fi @@ -74,22 +89,74 @@ fi ) +dnl There doesn't seem to be a straightforward way of having parameters +dnl that set values, other than fudging the --with thing. So that's what +dnl I've done. + +dnl Handle --with-posix-malloc-threshold=n + +AC_ARG_WITH(posix-malloc-threshold, +[ --with-posix-malloc-threshold=5 threshold for POSIX malloc usage], + POSIX_MALLOC_THRESHOLD=-DPOSIX_MALLOC_THRESHOLD=$withval +) + +dnl Handle --with-link-size=n + +AC_ARG_WITH(link-size, +[ --with-link-size=2 internal link size (2, 3, or 4 allowed)], + LINK_SIZE=-DLINK_SIZE=$withval +) + +dnl Handle --with-match_limit=n + +AC_ARG_WITH(match-limit, +[ --with-match-limit=10000000 default limit on internal looping)], + MATCH_LIMIT=-DMATCH_LIMIT=$withval +) + dnl Now arrange to build libtool AC_PROG_LIBTOOL dnl "Export" these variables +AC_SUBST(CC_FOR_BUILD) +AC_SUBST(CFLAGS_FOR_BUILD) AC_SUBST(HAVE_MEMMOVE) AC_SUBST(HAVE_STRERROR) +AC_SUBST(LINK_SIZE) +AC_SUBST(MATCH_LIMIT) 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) +AC_SUBST(POSIX_MALLOC_THRESHOLD) +AC_SUBST(UTF8) + +dnl Stuff to make Win32 work better + +case $host_os in +mingw* ) + POSIX_OBJ=pcreposix.o + POSIX_LOBJ=pcreposix.lo + POSIX_LIB= + ;; +* ) + POSIX_OBJ= + POSIX_LOBJ= + POSIX_LIB=libpcreposix.la + ;; +esac +AC_SUBST(POSIX_OBJ) +AC_SUBST(POSIX_LOBJ) +AC_SUBST(POSIX_LIB) + +if test "x$enable_shared" = "xno" ; then + AC_DEFINE(PCRE_STATIC,1) +fi 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])