summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
blob: 9e16caecca1d22f4ff25e9f2af8e291314a6d588 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From 57a15651b46a0f1f84a4dd15d67d104fbfbe3f6e Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen.kooi@linaro.org>
Date: Tue, 17 Jun 2014 08:18:17 +0200
Subject: [PATCH] configure: use pkg-config for pcre detection

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Upstream-Status: Pending

---
 configure.ac | 39 +++++++--------------------------------
 1 file changed, 7 insertions(+), 32 deletions(-)

diff --git a/configure.ac b/configure.ac
index c060028..a330266 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,39 +49,14 @@ AC_MSG_RESULT([$with_pcre])
 
 dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script
 if test x"${with_pcre}" = xyes ; then
-  AC_MSG_CHECKING([whether to use local PCRE2])
-  local_pcre_config=no
-  if test -z "$PCRE2_CONFIG"; then
-    if test -f `pwd`/pcre/pcre-swig-install/bin/pcre2-config; then
-      PCRE2_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre2-config
-      local_pcre_config=$PCRE2_CONFIG
-    fi
-  fi
-  AC_MSG_RESULT([$local_pcre_config])
-fi
-AS_IF([test "x$with_pcre" != xno],
-  [AX_PATH_GENERIC([pcre2],
-    [], dnl Minimal version of PCRE we need -- accept any
-    [], dnl custom sed script for version parsing is not needed
-    [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE2 library])
-     LIBS="$LIBS $PCRE2_LIBS"
-     CPPFLAGS="$CPPFLAGS $PCRE2_CFLAGS"
-    ],
-    [AC_MSG_FAILURE([
-        Cannot find pcre2-config script from PCRE2 (Perl Compatible Regular Expressions)
-        library package. This dependency is needed for configure to complete,
-        Either:
-        - Install the PCRE2 developer package on your system (preferred approach).
-        - Download the PCRE2 source tarball, build and install on your system
-          as you would for any package built from source distribution.
-        - Use the Tools/pcre-build.sh script to build PCRE2 just for SWIG to statically
-          link against. Run 'Tools/pcre-build.sh --help' for instructions.
-          (quite easy and does not require privileges to install PCRE2 on your system)
-        - Use configure --without-pcre to disable regular expressions support in SWIG
-          (not recommended).])
-    ],
-    [],[],[--libs8])
+  PKG_CHECK_MODULES([PCRE], [libpcre2], [
+    AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
+    LIBS="$LIBS $PCRE_LIBS"
+    CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
+  ], [
+    AC_MSG_WARN([$PCRE_PKG_ERRORS])
   ])
+fi
 
 
 dnl CCache