# LIBPCRE_CHECK_CONFIG ([DEFAULT-ACTION])
# ----------------------------------------------------------
# This macro #defines HAVE_PCRE_H if required header files are
# found, and sets @LIBPCRE_LDFLAGS@ and @LIBPCRE_CFLAGS@ to the necessary
# This macro is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
AC_DEFUN([LIBPCRE_TRY_LINK],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
const char* error = NULL;
pcre *regexp = pcre_compile("test", PCRE_UTF8, &error, &error_offset, NULL);
]])],[found_libpcre="yes"],[])
AC_DEFUN([LIBPCRE_CHECK_CONFIG],
If you want to specify libpcre installation directories:
AS_HELP_STRING([--with-libpcre@<:@=DIR@:>@], [use libpcre from given base install directory (DIR), default is to search through a number of common places for the libpcre files.])],
if test "$withval" != "no"; then
if test "$withval" != "yes"; then
AC_ARG_WITH([libpcre-include], AS_HELP_STRING([--with-libpcre-include@<:@=DIR@:>@], [use libpcre include headers from given path.]), [
libpcre_include_dir="$withval"
if ! test -d "$libpcre_include_dir"; then
AC_MSG_ERROR([cannot find $libpcre_include_dir directory])
if ! test -f "$libpcre_include_dir/pcre.h"; then
AC_MSG_ERROR([cannot find $libpcre_include_dir/pcre.h])
AC_ARG_WITH([libpcre-lib], AS_HELP_STRING([--with-libpcre-lib@<:@=DIR@:>@], [use libpcre libraries from given path.]), [
libpcre_lib_dir="$withval"