blob: 63096db0a3e44c655f4d16a97c3c721070c78ea1 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From d8837756f2a48adcfe5d645c39cf163d96eac76c Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen.kooi@linaro.org>
3Date: Tue, 17 Jun 2014 09:10:57 +0200
4Subject: [PATCH] configure: use pkg-config for PCRE detection
5
6Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
7Upstream-Status: pending
8---
9 configure.in | 27 +++++----------------------
10 1 file changed, 5 insertions(+), 22 deletions(-)
11
12diff --git a/configure.in b/configure.in
13index 864d7c7..da4138e 100644
14--- a/configure.in
15+++ b/configure.in
16@@ -215,28 +215,11 @@ fi
17 AC_ARG_WITH(pcre,
18 APACHE_HELP_STRING(--with-pcre=PATH,Use external PCRE library))
19
20-AC_PATH_PROG(PCRE_CONFIG, pcre-config, false)
21-if test -d "$with_pcre" && test -x "$with_pcre/bin/pcre-config"; then
22- PCRE_CONFIG=$with_pcre/bin/pcre-config
23-elif test -x "$with_pcre"; then
24- PCRE_CONFIG=$with_pcre
25-fi
26-
27-if test "$PCRE_CONFIG" != "false"; then
28- if $PCRE_CONFIG --version >/dev/null 2>&1; then :; else
29- AC_MSG_ERROR([Did not find pcre-config script at $PCRE_CONFIG])
30- fi
31- case `$PCRE_CONFIG --version` in
32- [[1-5].*])
33- AC_MSG_ERROR([Need at least pcre version 6.0])
34- ;;
35- esac
36- AC_MSG_NOTICE([Using external PCRE library from $PCRE_CONFIG])
37- APR_ADDTO(PCRE_INCLUDES, [`$PCRE_CONFIG --cflags`])
38- APR_ADDTO(PCRE_LIBS, [`$PCRE_CONFIG --libs`])
39-else
40- AC_MSG_ERROR([pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/])
41-fi
42+PKG_CHECK_MODULES([PCRE], [libpcre], [
43+ AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
44+], [
45+ AC_MSG_ERROR([$PCRE_PKG_ERRORS])
46+])
47 APACHE_SUBST(PCRE_LIBS)
48
49 AC_MSG_NOTICE([])
50--
511.9.3
52