diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-04-06 15:49:50 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-04-06 16:10:56 -0700 |
commit | 936ae4a5e6c8fd27d86c2f9e0f46c61c8c15c4ff (patch) | |
tree | 750e53c043e96311d6baf496401c269c714e2fe5 /bootstrap.conf | |
parent | ff38f097a41ddf908e3036524319de5a3aa6188e (diff) | |
download | grep-936ae4a5e6c8fd27d86c2f9e0f46c61c8c15c4ff.tar.gz |
build: use pkg-config (if available) to configure libpcre
Problem reported by Mike Frysinger in: http://bugs.gnu.org/16757
* bootstrap.conf (bootstrap_post_import_hook):
Copy pkg-config's pkg.m4.
* configure.ac: Invoke PKG_PROG_PKG_CONFIG.
* m4/pcre.m4 (gl_FUNC_PCRE): Rewrite to use pkg-config if
available, and to test that pcre_compile can be linked to.
* src/Makefile.am (AM_CFLAGS): Add PCRE_CFLAGS.
(grep_LDADD): Add PCRE_LIBS.
* src/pcresearch.c: Simply include <pcre.h> if HAVE_LIBPCRE,
since 'configure' arranges for the appropriate -I option now.
Diffstat (limited to 'bootstrap.conf')
-rw-r--r-- | bootstrap.conf | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bootstrap.conf b/bootstrap.conf index f19ae752..7842928c 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -134,6 +134,21 @@ bootstrap_post_import_hook () { # Automake requires that ChangeLog exist. touch ChangeLog || return 1 + + # Copy pkg-config's pkg.m4 so that our downstream users don't need to. + oIFS=$IFS + IFS=: + for dir in \ + $ACLOCAL_PATH $(aclocal --print-ac-dir) /usr/share/aclocal '' + do + IFS=$oIFS + if test -n "$dir" && test -r "$dir/pkg.m4"; then + cp "$dir/pkg.m4" m4/pkg.m4 + return + fi + done + IFS=$oIFS + die 'Cannot find pkg.m4; perhaps you need to install pkg-config' } bootstrap_epilogue() |