All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] libpcre: recipe cleanup
@ 2019-02-27 18:33 Ross Burton
  2019-02-27 18:33 ` [PATCH 2/2] libpcre: enable JIT Ross Burton
  0 siblings, 1 reply; 2+ messages in thread
From: Ross Burton @ 2019-02-27 18:33 UTC (permalink / raw)
  To: openembedded-core

The following options are the defaults, so remove them:
--enable-newline-is-lf
--with-match-size=2
--with-match-limit=10000000

We don't appear to need to pass -D_REENTRANT anymore (added with no explanation
to oe-classic in 2006).

Explicitly adding -lstdc++ doesn't appear to be required anymore (added for
PowerPC in 2008).

This recipe has always rebuilt the character tables but back in PCRE 4.4 (first
added to OE) a copy of the tables wasn't distributed with the tarball so this
was required.  Since 2007 the tarball includes the tables for ASCII and
regeneration is only required if we wish to use EBCDIC, which we do not. Drop
the patch adding CC_FOR_BUILD support and remove --enable-rebuild-chartables

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 .../libpcre/libpcre/pcre-cross.patch               | 48 ----------------------
 meta/recipes-support/libpcre/libpcre_8.43.bb       | 17 +-------
 2 files changed, 1 insertion(+), 64 deletions(-)
 delete mode 100644 meta/recipes-support/libpcre/libpcre/pcre-cross.patch

diff --git a/meta/recipes-support/libpcre/libpcre/pcre-cross.patch b/meta/recipes-support/libpcre/libpcre/pcre-cross.patch
deleted file mode 100644
index 83880f70983..00000000000
--- a/meta/recipes-support/libpcre/libpcre/pcre-cross.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-Upstream-Status: Pending
-
---- pcre-8.32.orig/Makefile.am
-+++ pcre-8.32/Makefile.am
-@@ -197,8 +197,18 @@ bin_SCRIPTS = pcre-config
- 
-+CC_FOR_BUILD = @CC_FOR_BUILD@
-+CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
-+CCLD_FOR_BUILD = @CCLD_FOR_BUILD@
-+LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
-+
- if WITH_REBUILD_CHARTABLES
- 
- noinst_PROGRAMS += dftables
- dftables_SOURCES = dftables.c
-+dftables_LINK = $(CCLD_FOR_BUILD) -o $@
-+dftables_LDFLAGS = $(LDFLAGS_FOR_BUILD)
-+
-+dftables.o: $(srcdir)/dftables.c
-+	$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/dftables.c
- 
- pcre_chartables.c: dftables$(EXEEXT)
- 	./dftables$(EXEEXT) $@
---- pcre-8.32.orig/configure.ac
-+++ pcre-8.32/configure.ac
-@@ -72,6 +72,22 @@ then
-   fi
- fi
- 
-+if test x"$cross_compiling" = xyes; then
-+    CC_FOR_BUILD="${CC_FOR_BUILD-gcc}"
-+    CCLD_FOR_BUILD="${CCLD_FOR_BUILD-gcc}"
-+    CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD}"
-+    LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD}"
-+else
-+    CC_FOR_BUILD="${CC_FOR_BUILD-\$(CC)}"
-+    CCLD_FOR_BUILD="${CCLD_FOR_BUILD-\$(CCLD)}"
-+    CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD-\$(CFLAGS)}"
-+    LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD-\$(LDFLAGS)}"
-+fi
-+AC_ARG_VAR(CC_FOR_BUILD, [build system C compiler])
-+AC_ARG_VAR(CCLD_FOR_BUILD, [build system C linker frontend])
-+AC_ARG_VAR(CFLAGS_FOR_BUILD, [build system C compiler arguments])
-+AC_ARG_VAR(LDFLAGS_FOR_BUILD, [build system C linker frontend arguments])
-+
- # AC_PROG_CXX will return "g++" even if no c++ compiler is installed.
- # Check for that case, and just disable c++ code if g++ doesn't run.
- AC_LANG_PUSH(C++)
diff --git a/meta/recipes-support/libpcre/libpcre_8.43.bb b/meta/recipes-support/libpcre/libpcre_8.43.bb
index d54b3941976..e28615a8ba7 100644
--- a/meta/recipes-support/libpcre/libpcre_8.43.bb
+++ b/meta/recipes-support/libpcre/libpcre_8.43.bb
@@ -8,7 +8,6 @@ SECTION = "devel"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENCE;md5=91bee59d1b327eb1599b4c673e2fb3d1"
 SRC_URI = "https://ftp.pcre.org/pub/pcre/pcre-${PV}.tar.bz2 \
-           file://pcre-cross.patch \
            file://fix-pcre-name-collision.patch \
            file://run-ptest \
            file://Makefile \
@@ -36,21 +35,7 @@ BINCONFIG = "${bindir}/pcre-config"
 
 inherit autotools binconfig-disabled ptest
 
-EXTRA_OECONF = "\
-    --enable-newline-is-lf \
-    --enable-rebuild-chartables \
-    --enable-utf \
-    --with-link-size=2 \
-    --with-match-limit=10000000 \
-"
-
-# Set LINK_SIZE in BUILD_CFLAGS given that the autotools bbclass use it to
-# set CFLAGS_FOR_BUILD, required for the libpcre build.
-BUILD_CFLAGS =+ "-DLINK_SIZE=2 -I${B}"
-CFLAGS += "-D_REENTRANT"
-CXXFLAGS_append_powerpc = " -lstdc++"
-
-export CCLD_FOR_BUILD ="${BUILD_CCLD}"
+EXTRA_OECONF = "--enable-utf"
 
 PACKAGES =+ "libpcrecpp libpcreposix pcregrep pcregrep-doc pcretest pcretest-doc"
 
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] libpcre: enable JIT
  2019-02-27 18:33 [PATCH 1/2] libpcre: recipe cleanup Ross Burton
@ 2019-02-27 18:33 ` Ross Burton
  0 siblings, 0 replies; 2+ messages in thread
From: Ross Burton @ 2019-02-27 18:33 UTC (permalink / raw)
  To: openembedded-core

PCRE has an optional JIT for performance.

Add a PACKAGECONFIG for this, enabled by default.

Also add a patch so that auto-detection of JIT availablity, which is required to
enable the JIT by default, works with out-of-tree builds.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 .../libpcre/libpcre/out-of-tree.patch              | 26 ++++++++++++++++++++++
 meta/recipes-support/libpcre/libpcre_8.43.bb       |  4 +++-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libpcre/libpcre/out-of-tree.patch

diff --git a/meta/recipes-support/libpcre/libpcre/out-of-tree.patch b/meta/recipes-support/libpcre/libpcre/out-of-tree.patch
new file mode 100644
index 00000000000..687dcc034da
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/out-of-tree.patch
@@ -0,0 +1,26 @@
+In out-of-tree builds the #include fails because $srcdir isn't in the include path.  Set CPPFLAGS so that it is.
+
+Upstream-Status: Submitted [https://bugs.exim.org/show_bug.cgi?id=2379]
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Index: configure.ac
+===================================================================
+--- a/configure.ac	(revision 1749)
++++ b/configure.ac	(working copy)
+@@ -159,6 +159,8 @@
+ 
+ if test "$enable_jit" = "auto"; then
+   AC_LANG(C)
++  SAVE_CPPFLAGS=$CPPFLAGS
++  CPPFLAGS=-I$srcdir
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+   #define SLJIT_CONFIG_AUTO 1
+   #include "sljit/sljitConfigInternal.h"
+@@ -165,6 +167,7 @@
+   #if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
+   #error unsupported
+   #endif]])], enable_jit=yes, enable_jit=no)
++  CPPFLAGS=$SAVE_CPPFLAGS
+ fi
+ 
+ # Handle --disable-pcregrep-jit (enabled by default)
diff --git a/meta/recipes-support/libpcre/libpcre_8.43.bb b/meta/recipes-support/libpcre/libpcre_8.43.bb
index e28615a8ba7..08314efb9e4 100644
--- a/meta/recipes-support/libpcre/libpcre_8.43.bb
+++ b/meta/recipes-support/libpcre/libpcre_8.43.bb
@@ -9,6 +9,7 @@ LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENCE;md5=91bee59d1b327eb1599b4c673e2fb3d1"
 SRC_URI = "https://ftp.pcre.org/pub/pcre/pcre-${PV}.tar.bz2 \
            file://fix-pcre-name-collision.patch \
+           file://out-of-tree.patch \
            file://run-ptest \
            file://Makefile \
 "
@@ -23,13 +24,14 @@ S = "${WORKDIR}/pcre-${PV}"
 PROVIDES += "pcre"
 DEPENDS += "bzip2 zlib"
 
-PACKAGECONFIG ??= "pcre8 unicode-properties"
+PACKAGECONFIG ??= "pcre8 unicode-properties jit"
 
 PACKAGECONFIG[pcre8] = "--enable-pcre8,--disable-pcre8"
 PACKAGECONFIG[pcre16] = "--enable-pcre16,--disable-pcre16"
 PACKAGECONFIG[pcre32] = "--enable-pcre32,--disable-pcre32"
 PACKAGECONFIG[pcretest-readline] = "--enable-pcretest-libreadline,--disable-pcretest-libreadline,readline,"
 PACKAGECONFIG[unicode-properties] = "--enable-unicode-properties,--disable-unicode-properties"
+PACKAGECONFIG[jit] = "--enable-jit=auto,--disable-jit"
 
 BINCONFIG = "${bindir}/pcre-config"
 
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-27 18:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-27 18:33 [PATCH 1/2] libpcre: recipe cleanup Ross Burton
2019-02-27 18:33 ` [PATCH 2/2] libpcre: enable JIT Ross Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.