>From 5b0cf3b1aa930537312a71e77960f5481b3b79e4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 6 Apr 2015 16:09:39 -0700 Subject: [PATCH] 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. --- NEWS | 5 +++++ README-prereq | 23 ++++++++++++----------- m4/pcre.m4 | 12 ++++++------ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/NEWS b/NEWS index 071caab..ae8f38f 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,11 @@ GNU grep NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Improvements + + When building grep, 'configure' now uses PCRE's pkg-config module for + configuration information, rather than attempting to guess it by hand. + ** Bug fixes grep no longer reads from uninitialized memory or from beyond the end diff --git a/README-prereq b/README-prereq index 056f42d..0422aa6 100644 --- a/README-prereq +++ b/README-prereq @@ -1,17 +1,18 @@ This gives some notes on obtaining the tools required for development. I.E. the tools checked for by the bootstrap script and include: -- Autoconf -- Automake -- Bison -- Gettext -- Git -- Gperf -- Gzip -- Perl -- Rsync -- Tar -- Texinfo +- Autoconf +- Automake +- Bison +- Gettext +- Git +- Gperf +- Gzip +- Perl +- Pkg-config +- Rsync +- Tar +- Texinfo Note please try to install/build official packages for your system. If these programs are not available use the following instructions diff --git a/m4/pcre.m4 b/m4/pcre.m4 index 37de4c5..0effc53 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 -- 2.1.0