diff options
Diffstat (limited to 'm4/pcre.m4')
-rw-r--r-- | m4/pcre.m4 | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -1,4 +1,4 @@ -# pcre.m4 - check for libpcre support +# pcre.m4 - check for PCRE library support # Copyright (C) 2010-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_PCRE], [ AC_ARG_ENABLE([perl-regexp], AS_HELP_STRING([--disable-perl-regexp], - [disable perl-regexp (pcre) support]), + [disable perl-regexp (pcre2) support]), [case $enableval in yes|no) test_pcre=$enableval;; *) AC_MSG_ERROR([invalid value $enableval for --disable-perl-regexp]);; @@ -21,24 +21,25 @@ AC_DEFUN([gl_FUNC_PCRE], use_pcre=no if test $test_pcre != no; then - PKG_CHECK_MODULES([PCRE], [libpcre], [], [: ${PCRE_LIBS=-lpcre}]) + PKG_CHECK_MODULES([PCRE], [libpcre2-8], [], [: ${PCRE_LIBS=-lpcre2-8}]) - AC_CACHE_CHECK([for pcre_compile], [pcre_cv_have_pcre_compile], + AC_CACHE_CHECK([for pcre2_compile], [pcre_cv_have_pcre2_compile], [pcre_saved_CFLAGS=$CFLAGS pcre_saved_LIBS=$LIBS CFLAGS="$CFLAGS $PCRE_CFLAGS" LIBS="$PCRE_LIBS $LIBS" AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[#include <pcre.h> + [AC_LANG_PROGRAM([[#define PCRE2_CODE_UNIT_WIDTH 8 + #include <pcre2.h> ]], - [[pcre *p = pcre_compile (0, 0, 0, 0, 0); + [[pcre2_code *p = pcre2_compile (0, 0, 0, 0, 0, 0); return !p;]])], - [pcre_cv_have_pcre_compile=yes], - [pcre_cv_have_pcre_compile=no]) + [pcre_cv_have_pcre2_compile=yes], + [pcre_cv_have_pcre2_compile=no]) CFLAGS=$pcre_saved_CFLAGS LIBS=$pcre_saved_LIBS]) - if test "$pcre_cv_have_pcre_compile" = yes; then + if test "$pcre_cv_have_pcre2_compile" = yes; then use_pcre=yes elif test $test_pcre = maybe; then AC_MSG_WARN([AC_PACKAGE_NAME will be built without pcre support.]) @@ -50,7 +51,7 @@ AC_DEFUN([gl_FUNC_PCRE], if test $use_pcre = yes; then AC_DEFINE([HAVE_LIBPCRE], [1], [Define to 1 if you have the Perl Compatible Regular Expressions - library (-lpcre).]) + library (-lpcre2).]) else PCRE_CFLAGS= PCRE_LIBS= |