blob: 50775be533a23cc306e1248968b15631cd5886c1 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001From ba9015386cbc044e111d7c266f13e2be045e4bf1 Mon Sep 17 00:00:00 2001
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08002From: 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
Andrew Geissler9aee5002022-03-30 16:27:02 +00006Upstream-Status: Inappropriate [embedded specific]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08007
8Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08009---
Andrew Geissler9aee5002022-03-30 16:27:02 +000010 configure.in | 26 +++++---------------------
11 1 file changed, 5 insertions(+), 21 deletions(-)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012
13diff --git a/configure.in b/configure.in
Andrew Geissler9aee5002022-03-30 16:27:02 +000014index 38c1d0a..c799aec 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015--- a/configure.in
16+++ b/configure.in
Andrew Geissler9aee5002022-03-30 16:27:02 +000017@@ -221,27 +221,11 @@ else if which $with_pcre 2>/dev/null; then :; else
18 fi
19 fi
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080020
Andrew Geissler9aee5002022-03-30 16:27:02 +000021-AC_CHECK_TARGET_TOOLS(PCRE_CONFIG, [pcre2-config pcre-config],
22- [`which $with_pcre 2>/dev/null`], $with_pcre)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080023-
Andrew Geissler9aee5002022-03-30 16:27:02 +000024-if test "x$PCRE_CONFIG" != "x"; then
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025- if $PCRE_CONFIG --version >/dev/null 2>&1; then :; else
Andrew Geissler9aee5002022-03-30 16:27:02 +000026- AC_MSG_ERROR([Did not find working script at $PCRE_CONFIG])
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027- fi
28- case `$PCRE_CONFIG --version` in
Andrew Geissler9aee5002022-03-30 16:27:02 +000029- [1[0-9].*])
30- AC_DEFINE(HAVE_PCRE2, 1, [Detected PCRE2])
31- ;;
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032- [[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`])
Andrew Geissler9aee5002022-03-30 16:27:02 +000038- APR_ADDTO(PCRE_LIBS, [`$PCRE_CONFIG --libs8 2>/dev/null || $PCRE_CONFIG --libs`])
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039-else
Andrew Geissler9aee5002022-03-30 16:27:02 +000040- AC_MSG_ERROR([pcre(2)-config for libpcre not found. PCRE is required and available from http://pcre.org/])
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041-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([])
Brad Bishopc342db32019-05-15 21:57:59 -040050--
Andrew Geissler9aee5002022-03-30 16:27:02 +0000512.25.1
Brad Bishopc342db32019-05-15 21:57:59 -040052