diff options
| author | Andrey Hristov <andrey@php.net> | 1999-05-26 21:47:57 +0000 |
|---|---|---|
| committer | Andrey Hristov <andrey@php.net> | 1999-05-26 21:47:57 +0000 |
| commit | 66f850e5b7f97bb8b07df7ca0d2a82acf4c239d4 (patch) | |
| tree | 534d993fe1afe902042082be0457acfcd10bd4f1 /ext/pcre/config.m4 | |
| parent | d73c63852645a0a4324f24b367dff43b54eada85 (diff) | |
| download | php-git-66f850e5b7f97bb8b07df7ca0d2a82acf4c239d4.tar.gz | |
-Added PCRE library source
-Updated configuration process
Diffstat (limited to 'ext/pcre/config.m4')
| -rw-r--r-- | ext/pcre/config.m4 | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/ext/pcre/config.m4 b/ext/pcre/config.m4 index f564884b9c..588c9f4881 100644 --- a/ext/pcre/config.m4 +++ b/ext/pcre/config.m4 @@ -1,18 +1,43 @@ dnl $Id$ dnl config.m4 for extension pcre -AC_MSG_CHECKING(for PCRE support) -AC_ARG_WITH(pcre, -[ --with-pcre Include Perl Compatible Regular Expressions support],[ - if test "$withval" = "yes"; then - PCRE_LIBS="-lpcre" - AC_DEFINE(HAVE_LIBPCRE, 1) - AC_MSG_RESULT(yes) - PHP_EXTENSION(pcre) - EXTRA_LIBS="$EXTRA_LIBS $PCRE_LIBS" - else - AC_MSG_RESULT(no) - fi +dnl By default we'll compile and link against the bundled PCRE library +dnl if DIR is supplied, we'll use that for linking + +AC_MSG_CHECKING(whether to use PCRE library) +AC_ARG_WITH(pcre-regex, +[ --with-pcre-regex[=DIR] Enable Perl Compatible Regular Expressions support],[ + case "$withval" in + no) + AC_MSG_RESULT(no) ;; + yes) + PCRE_LIB="-Lpcrelib -lpcre" + PCRE_INCLUDE="-Ipcrelib" + PCRE_SUBDIR="pcrelib" + AC_DEFINE(HAVE_LIBPCRE, 1) + AC_MSG_RESULT(yes) + PHP_EXTENSION(pcre) ;; + *) + test -f $withval/pcre.h && PCRE_INCLUDE="-I$withval" + test -f $withval/libpcre.a && PCRE_LIB="-L$withval -lpcre" + + if test -n "$PCRE_INCLUDE" && test -n "$PCRE_LIB" ; then + AC_DEFINE(HAVE_LIBPCRE, 1) + PCRE_SUBDIR= + AC_MSG_RESULT(yes) + PHP_EXTENSION(pcre) + else + AC_MSG_ERROR(Unable to find pcre.h and libpcre.a in $withval) + fi ;; + esac ],[ - AC_MSG_RESULT(no) + PCRE_LIB="-Lpcrelib -lpcre" + PCRE_INCLUDE="-Ipcrelib" + PCRE_SUBDIR="pcrelib" + AC_DEFINE(HAVE_LIBPCRE, 1) + AC_MSG_RESULT(yes) + PHP_EXTENSION(pcre) ]) +AC_SUBST(PCRE_LIB) +AC_SUBST(PCRE_INCLUDE) +AC_SUBST(PCRE_SUBDIR) |
