Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 1 | From ffb785ed8d3cac3c28e014b1238d93e2bc1f0c01 Mon Sep 17 00:00:00 2001 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 2 | From: Koen Kooi <koen.kooi@linaro.org> |
| 3 | Date: Tue, 17 Jun 2014 08:18:17 +0200 |
| 4 | Subject: [PATCH] configure: use pkg-config for pcre detection |
| 5 | |
| 6 | Signed-off-by: Koen Kooi <koen.kooi@linaro.org> |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 7 | Upstream-Status: Pending |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 9 | --- |
| 10 | configure.ac | 39 +++++++-------------------------------- |
| 11 | 1 file changed, 7 insertions(+), 32 deletions(-) |
| 12 | |
| 13 | diff --git a/configure.ac b/configure.ac |
| 14 | index f88004a..3a2b47c 100644 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 15 | --- a/configure.ac |
| 16 | +++ b/configure.ac |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 17 | @@ -57,39 +57,14 @@ AC_MSG_RESULT([$with_pcre]) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | |
| 19 | dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script |
| 20 | if test x"${with_pcre}" = xyes ; then |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 21 | - AC_MSG_CHECKING([whether to use local PCRE2]) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 22 | - local_pcre_config=no |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 23 | - if test -z "$PCRE2_CONFIG"; then |
| 24 | - if test -f `pwd`/pcre/pcre-swig-install/bin/pcre2-config; then |
| 25 | - PCRE2_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre2-config |
| 26 | - local_pcre_config=$PCRE2_CONFIG |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 27 | - fi |
| 28 | - fi |
| 29 | - AC_MSG_RESULT([$local_pcre_config]) |
| 30 | -fi |
| 31 | -AS_IF([test "x$with_pcre" != xno], |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 32 | - [AX_PATH_GENERIC([pcre2], |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | - [], dnl Minimal version of PCRE we need -- accept any |
| 34 | - [], dnl custom sed script for version parsing is not needed |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 35 | - [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE2 library]) |
| 36 | - LIBS="$LIBS $PCRE2_LIBS" |
| 37 | - CPPFLAGS="$CPPFLAGS $PCRE2_CFLAGS" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | - ], |
| 39 | - [AC_MSG_FAILURE([ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 40 | - Cannot find pcre2-config script from PCRE2 (Perl Compatible Regular Expressions) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | - library package. This dependency is needed for configure to complete, |
| 42 | - Either: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 43 | - - Install the PCRE2 developer package on your system (preferred approach). |
| 44 | - - Download the PCRE2 source tarball, build and install on your system |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | - as you would for any package built from source distribution. |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 46 | - - Use the Tools/pcre-build.sh script to build PCRE2 just for SWIG to statically |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | - link against. Run 'Tools/pcre-build.sh --help' for instructions. |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 48 | - (quite easy and does not require privileges to install PCRE2 on your system) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | - - Use configure --without-pcre to disable regular expressions support in SWIG |
| 50 | - (not recommended).]) |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 51 | - ], |
| 52 | - [],[],[--libs8]) |
| 53 | + PKG_CHECK_MODULES([PCRE], [libpcre2], [ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | + AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library]) |
| 55 | + LIBS="$LIBS $PCRE_LIBS" |
| 56 | + CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" |
| 57 | + ], [ |
| 58 | + AC_MSG_WARN([$PCRE_PKG_ERRORS]) |
| 59 | ]) |
| 60 | +fi |
| 61 | |
| 62 | |
| 63 | dnl CCache |