blob: da38a8cfd7f7787292fb4be951073fd77dc9f645 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 419181e242892ded050f5a375a709b9588fb581d 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
6Upstream-Status: Pending
7
8Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
9
10---
11 configure.in | 27 +++++----------------------
12 1 file changed, 5 insertions(+), 22 deletions(-)
13
14diff --git a/configure.in b/configure.in
15index be7bd25..54dfd0d 100644
16--- a/configure.in
17+++ b/configure.in
18@@ -215,28 +215,11 @@ fi
19 AC_ARG_WITH(pcre,
20 APACHE_HELP_STRING(--with-pcre=PATH,Use external PCRE library))
21
22-AC_PATH_PROG(PCRE_CONFIG, pcre-config, false)
23-if test -d "$with_pcre" && test -x "$with_pcre/bin/pcre-config"; then
24- PCRE_CONFIG=$with_pcre/bin/pcre-config
25-elif test -x "$with_pcre"; then
26- PCRE_CONFIG=$with_pcre
27-fi
28-
29-if test "$PCRE_CONFIG" != "false"; then
30- if $PCRE_CONFIG --version >/dev/null 2>&1; then :; else
31- AC_MSG_ERROR([Did not find pcre-config script at $PCRE_CONFIG])
32- fi
33- case `$PCRE_CONFIG --version` in
34- [[1-5].*])
35- AC_MSG_ERROR([Need at least pcre version 6.0])
36- ;;
37- esac
38- AC_MSG_NOTICE([Using external PCRE library from $PCRE_CONFIG])
39- APR_ADDTO(PCRE_INCLUDES, [`$PCRE_CONFIG --cflags`])
40- APR_ADDTO(PCRE_LIBS, [`$PCRE_CONFIG --libs`])
41-else
42- AC_MSG_ERROR([pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/])
43-fi
44+PKG_CHECK_MODULES([PCRE], [libpcre], [
45+ AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
46+], [
47+ AC_MSG_ERROR([$PCRE_PKG_ERRORS])
48+])
49 APACHE_SUBST(PCRE_LIBS)
50
51 AC_MSG_NOTICE([])