Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 1 | From ba9015386cbc044e111d7c266f13e2be045e4bf1 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 2 | From: Koen Kooi <koen.kooi@linaro.org> |
| 3 | Date: Tue, 17 Jun 2014 09:10:57 +0200 |
| 4 | Subject: [PATCH] configure: use pkg-config for PCRE detection |
| 5 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 6 | Upstream-Status: Inappropriate [embedded specific] |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 7 | |
| 8 | Signed-off-by: Koen Kooi <koen.kooi@linaro.org> |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 9 | --- |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 10 | configure.in | 26 +++++--------------------- |
| 11 | 1 file changed, 5 insertions(+), 21 deletions(-) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 12 | |
| 13 | diff --git a/configure.in b/configure.in |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 14 | index 38c1d0a..c799aec 100644 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 15 | --- a/configure.in |
| 16 | +++ b/configure.in |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 17 | @@ -221,27 +221,11 @@ else if which $with_pcre 2>/dev/null; then :; else |
| 18 | fi |
| 19 | fi |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 20 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 21 | -AC_CHECK_TARGET_TOOLS(PCRE_CONFIG, [pcre2-config pcre-config], |
| 22 | - [`which $with_pcre 2>/dev/null`], $with_pcre) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 23 | - |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 24 | -if test "x$PCRE_CONFIG" != "x"; then |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 25 | - if $PCRE_CONFIG --version >/dev/null 2>&1; then :; else |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 26 | - AC_MSG_ERROR([Did not find working script at $PCRE_CONFIG]) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 27 | - fi |
| 28 | - case `$PCRE_CONFIG --version` in |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 29 | - [1[0-9].*]) |
| 30 | - AC_DEFINE(HAVE_PCRE2, 1, [Detected PCRE2]) |
| 31 | - ;; |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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`]) |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 38 | - APR_ADDTO(PCRE_LIBS, [`$PCRE_CONFIG --libs8 2>/dev/null || $PCRE_CONFIG --libs`]) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 39 | -else |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 40 | - AC_MSG_ERROR([pcre(2)-config for libpcre not found. PCRE is required and available from http://pcre.org/]) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 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([]) |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 50 | -- |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 51 | 2.25.1 |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 52 | |