From 8ee53e2a2804a7cecda91a5e249aa29e6c18f65a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 6 Apr 2015 16:09:39 -0700 Subject: build: improve pkg-config doc and error handling Error-handling improvement suggested by Mike Frysinger in: http://bugs.gnu.org/16757#29 * NEWS: Document pkg-config changes. * README-prereq: pkg-config is now a prereq when building from repository. * m4/pcre.m4 (gl_FUNC_PCRE): Report an error if pcre is explicitly requested but not available. Defer to user-supplied PCRE_CFLAGS and PCRE_LIBS. --- m4/pcre.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'm4') diff --git a/m4/pcre.m4 b/m4/pcre.m4 index 37de4c53..0effc539 100644 --- a/m4/pcre.m4 +++ b/m4/pcre.m4 @@ -14,16 +14,14 @@ AC_DEFUN([gl_FUNC_PCRE], yes|no) test_pcre=$enableval;; *) AC_MSG_ERROR([invalid value $enableval for --disable-perl-regexp]);; esac], - [test_pcre=yes]) + [test_pcre=maybe]) - PCRE_CFLAGS= - PCRE_LIBS= AC_SUBST([PCRE_CFLAGS]) AC_SUBST([PCRE_LIBS]) use_pcre=no - if test $test_pcre = yes; then - PKG_CHECK_MODULES([PCRE], [libpcre], [], [PCRE_LIBS=-lpcre]) + if test $test_pcre != no; then + PKG_CHECK_MODULES([PCRE], [libpcre], [], [: ${PCRE_LIBS=-lpcre}]) AC_CACHE_CHECK([for pcre_compile], [pcre_cv_have_pcre_compile], [pcre_saved_CFLAGS=$CFLAGS @@ -42,8 +40,10 @@ AC_DEFUN([gl_FUNC_PCRE], if test "$pcre_cv_have_pcre_compile" = yes; then use_pcre=yes - else + elif test $test_pcre = maybe; then AC_MSG_WARN([AC_PACKAGE_NAME will be built without pcre support.]) + else + AC_MSG_ERROR([pcre support not available]) fi fi -- cgit v1.2.1