summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libpcre
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-support/libpcre
downloadpoky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-support/libpcre')
-rw-r--r--meta/recipes-support/libpcre/libpcre/Makefile183
-rw-r--r--meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch41
-rw-r--r--meta/recipes-support/libpcre/libpcre/pcre-cross.patch48
-rw-r--r--meta/recipes-support/libpcre/libpcre/run-ptest3
-rw-r--r--meta/recipes-support/libpcre/libpcre_8.35.bb75
5 files changed, 350 insertions, 0 deletions
diff --git a/meta/recipes-support/libpcre/libpcre/Makefile b/meta/recipes-support/libpcre/libpcre/Makefile
new file mode 100644
index 0000000000..5419d71f7f
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/Makefile
@@ -0,0 +1,183 @@
1TESTS = pcre_stringpiece_unittest RunTest RunGrepTest
2subdir = .
3am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
4am__vpath_adj = case $$p in \
5 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
6 *) f=$$p;; \
7 esac;
8am__tty_colors_dummy = \
9 mgn= red= grn= lgn= blu= brg= std=; \
10 am__color_tests=no
11am__tty_colors = { \
12 $(am__tty_colors_dummy); \
13 if test "X$(AM_COLOR_TESTS)" = Xno; then \
14 am__color_tests=no; \
15 elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
16 am__color_tests=yes; \
17 elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
18 am__color_tests=yes; \
19 fi; \
20 if test $$am__color_tests = yes; then \
21 red=''; \
22 grn=''; \
23 lgn=''; \
24 blu=''; \
25 mgn=''; \
26 brg=''; \
27 std=''; \
28 fi; \
29}
30am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
31am__sh_e_setup = case $$- in *e*) set +e;; esac
32am__common_driver_flags = \
33 --color-tests "$$am__color_tests" \
34 --enable-hard-errors "$$am__enable_hard_errors" \
35 --expect-failure "$$am__expect_failure"
36am__check_pre = \
37$(am__sh_e_setup); \
38$(am__vpath_adj_setup) $(am__vpath_adj) \
39$(am__tty_colors); \
40srcdir=$(srcdir); export srcdir; \
41case "$@" in \
42 */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
43 *) am__odir=.;; \
44esac; \
45test "x$$am__odir" = x"." || test -d "$$am__odir" \
46 || $(MKDIR_P) "$$am__odir" || exit $$?; \
47if test -f "./$$f"; then dir=./; \
48elif test -f "$$f"; then dir=; \
49else dir="$(srcdir)/"; fi; \
50tst=$$dir$$f; log='$@'; \
51if test -n '$(DISABLE_HARD_ERRORS)'; then \
52 am__enable_hard_errors=no; \
53else \
54 am__enable_hard_errors=yes; \
55fi;
56am__set_TESTS_bases = \
57 bases='$(TEST_LOGS)'; \
58 bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
59 bases=`echo $$bases`
60RECHECK_LOGS = $(TEST_LOGS)
61TEST_SUITE_LOG = test-suite.log
62TEST_EXTENSIONS = .test
63LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
64am__test_logs1 = $(TESTS:=.log)
65am__test_logs2 = $(am__test_logs1:.log=.log)
66TEST_LOGS = $(am__test_logs2:.test.log=.log)
67MKDIR_P = /bin/mkdir -p
68PACKAGE_STRING = PCRE 8.34
69SHELL = /bin/sh
70srcdir = .
71top_srcdir = .
72$(TEST_SUITE_LOG): $(TEST_LOGS)
73 @$(am__set_TESTS_bases); \
74 am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
75 redo_bases=`for i in $$bases; do \
76 am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
77 done`; \
78 st=0; \
79 errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
80 for i in $$redo_bases; do \
81 test -f $$i.trs && test -r $$i.trs \
82 || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
83 test -f $$i.log && test -r $$i.log \
84 || { echo "$$errmsg $$i.log" >&2; st=1; }; \
85 done; \
86 test $$st -eq 0 || exit 1;
87 @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
88 ws='[ ]'; \
89 results=`for b in $$bases; do echo $$b.trs; done`; \
90 test -n "$$results" || results=/dev/null; \
91 all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
92 pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
93 fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
94 skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
95 xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
96 xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
97 error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
98 if test `expr $$fail + $$xpass + $$error` -eq 0; then \
99 success=true; \
100 else \
101 success=false; \
102 fi; \
103 br='==================='; br=$$br$$br$$br$$br; \
104 result_count () \
105 { \
106 if test x"$$1" = x"--maybe-color"; then \
107 maybe_colorize=yes; \
108 elif test x"$$1" = x"--no-color"; then \
109 maybe_colorize=no; \
110 else \
111 echo "$@: invalid 'result_count' usage" >&2; exit 4; \
112 fi; \
113 shift; \
114 desc=$$1 count=$$2; \
115 if test $$maybe_colorize = yes && test $$count -gt 0; then \
116 color_start=$$3 color_end=$$std; \
117 else \
118 color_start= color_end=; \
119 fi; \
120 echo "$${color_start}# $$desc $$count$${color_end}"; \
121 }; \
122 create_testsuite_report () \
123 { \
124 result_count $$1 "TOTAL:" $$all "$$brg"; \
125 result_count $$1 "PASS: " $$pass "$$grn"; \
126 result_count $$1 "SKIP: " $$skip "$$blu"; \
127 result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
128 result_count $$1 "FAIL: " $$fail "$$red"; \
129 result_count $$1 "XPASS:" $$xpass "$$red"; \
130 result_count $$1 "ERROR:" $$error "$$mgn"; \
131 }; \
132 { \
133 echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
134 $(am__rst_title); \
135 create_testsuite_report --no-color; \
136 echo; \
137 echo ".. contents:: :depth: 2"; \
138 echo; \
139 for b in $$bases; do echo $$b; done; \
140 } >$(TEST_SUITE_LOG).tmp || exit 1; \
141 mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
142 if $$success; then \
143 col="$$grn"; \
144 else \
145 col="$$red"; \
146 test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
147 fi; \
148 echo "$${col}$$br$${std}"; \
149 echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
150 echo "$${col}$$br$${std}"; \
151 create_testsuite_report --maybe-color; \
152 echo "$$col$$br$$std"; \
153 if $$success; then :; else \
154 echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
155 echo "$$col$$br$$std"; \
156 fi; \
157 $$success || exit 1
158check-TESTS:
159 @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
160 @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
161 @set +e; $(am__set_TESTS_bases); \
162 log_list=`for i in $$bases; do echo $$i.log; done`; \
163 log_list=`echo $$log_list`; \
164 $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
165 exit $$?;
166pcre_stringpiece_unittest.log: pcre_stringpiece_unittest$(EXEEXT)
167 @p='pcre_stringpiece_unittest$(EXEEXT)'; \
168 b='pcre_stringpiece_unittest'; \
169 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
170 --log-file $$b.log --trs-file $$b.trs \
171 $(am__common_driver_flags) -- "$$tst"
172RunTest.log: RunTest
173 @p='RunTest'; \
174 b='RunTest'; \
175 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
176 --log-file $$b.log --trs-file $$b.trs \
177 $(am__common_driver_flags) -- "$$tst"
178RunGrepTest.log: RunGrepTest
179 @p='RunGrepTest'; \
180 b='RunGrepTest'; \
181 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
182 --log-file $$b.log --trs-file $$b.trs \
183 $(am__common_driver_flags) -- "$$tst"
diff --git a/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch b/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch
new file mode 100644
index 0000000000..89b44f6aa6
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch
@@ -0,0 +1,41 @@
1Upstream-Status: Inappropriate [debian patch]
2
3This patch address a namespace collision with libc.
4
5Although there is no "#include <regex.h>" in the source file, at
6runtime, it's unintentionally linked to the libc version, the regcomp of
7libc is called instead the pcre one using pcre's data structure...
8that looks like a disaster.
9
10Can patch is from Debian (and Ubuntu 11.04alpha has it also).
11
12[sgw: added patch comment]
13Signed-off-by: Qing He <qing.he@intel.com>
14Signed-off-by: Saul Wold <sgw@linux.intel.com>
15
16--- a/pcreposix.h 2010-05-17 00:17:23.000000000 +0800
17+++ b/pcreposix.h 2009-01-15 04:32:17.000000000 +0800
18@@ -133,14 +130,19 @@
19
20 /* The functions */
21
22-PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
23-PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
24+PCREPOSIX_EXP_DECL int pcreposix_regcomp(regex_t *, const char *, int);
25+PCREPOSIX_EXP_DECL int pcreposix_regexec(const regex_t *, const char *, size_t,
26 regmatch_t *, int);
27-PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
28-PCREPOSIX_EXP_DECL void regfree(regex_t *);
29+PCREPOSIX_EXP_DECL size_t pcreposix_regerror(int, const regex_t *, char *, size_t);
30+PCREPOSIX_EXP_DECL void pcreposix_regfree(regex_t *);
31
32 #ifdef __cplusplus
33 } /* extern "C" */
34 #endif
35
36+#define regcomp pcreposix_regcomp
37+#define regexec pcreposix_regexec
38+#define regerror pcreposix_regerror
39+#define regfree pcreposix_regfree
40+
41 #endif /* End of pcreposix.h */
diff --git a/meta/recipes-support/libpcre/libpcre/pcre-cross.patch b/meta/recipes-support/libpcre/libpcre/pcre-cross.patch
new file mode 100644
index 0000000000..83880f7098
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/pcre-cross.patch
@@ -0,0 +1,48 @@
1Upstream-Status: Pending
2
3--- pcre-8.32.orig/Makefile.am
4+++ pcre-8.32/Makefile.am
5@@ -197,8 +197,18 @@ bin_SCRIPTS = pcre-config
6
7+CC_FOR_BUILD = @CC_FOR_BUILD@
8+CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
9+CCLD_FOR_BUILD = @CCLD_FOR_BUILD@
10+LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
11+
12 if WITH_REBUILD_CHARTABLES
13
14 noinst_PROGRAMS += dftables
15 dftables_SOURCES = dftables.c
16+dftables_LINK = $(CCLD_FOR_BUILD) -o $@
17+dftables_LDFLAGS = $(LDFLAGS_FOR_BUILD)
18+
19+dftables.o: $(srcdir)/dftables.c
20+ $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/dftables.c
21
22 pcre_chartables.c: dftables$(EXEEXT)
23 ./dftables$(EXEEXT) $@
24--- pcre-8.32.orig/configure.ac
25+++ pcre-8.32/configure.ac
26@@ -72,6 +72,22 @@ then
27 fi
28 fi
29
30+if test x"$cross_compiling" = xyes; then
31+ CC_FOR_BUILD="${CC_FOR_BUILD-gcc}"
32+ CCLD_FOR_BUILD="${CCLD_FOR_BUILD-gcc}"
33+ CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD}"
34+ LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD}"
35+else
36+ CC_FOR_BUILD="${CC_FOR_BUILD-\$(CC)}"
37+ CCLD_FOR_BUILD="${CCLD_FOR_BUILD-\$(CCLD)}"
38+ CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD-\$(CFLAGS)}"
39+ LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD-\$(LDFLAGS)}"
40+fi
41+AC_ARG_VAR(CC_FOR_BUILD, [build system C compiler])
42+AC_ARG_VAR(CCLD_FOR_BUILD, [build system C linker frontend])
43+AC_ARG_VAR(CFLAGS_FOR_BUILD, [build system C compiler arguments])
44+AC_ARG_VAR(LDFLAGS_FOR_BUILD, [build system C linker frontend arguments])
45+
46 # AC_PROG_CXX will return "g++" even if no c++ compiler is installed.
47 # Check for that case, and just disable c++ code if g++ doesn't run.
48 AC_LANG_PUSH(C++)
diff --git a/meta/recipes-support/libpcre/libpcre/run-ptest b/meta/recipes-support/libpcre/libpcre/run-ptest
new file mode 100644
index 0000000000..990d4a12ad
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3make check-TESTS
diff --git a/meta/recipes-support/libpcre/libpcre_8.35.bb b/meta/recipes-support/libpcre/libpcre_8.35.bb
new file mode 100644
index 0000000000..92098c8c51
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre_8.35.bb
@@ -0,0 +1,75 @@
1DESCRIPTION = "The PCRE library is a set of functions that implement regular \
2expression pattern matching using the same syntax and semantics as Perl 5. PCRE \
3has its own native API, as well as a set of wrapper functions that correspond \
4to the POSIX regular expression API."
5SUMMARY = "Perl Compatible Regular Expressions"
6HOMEPAGE = "http://www.pcre.org"
7SECTION = "devel"
8LICENSE = "BSD"
9LIC_FILES_CHKSUM = "file://LICENCE;md5=ded617e975f28e15952dc68b84a7ac1a"
10SRC_URI = "${SOURCEFORGE_MIRROR}/project/pcre/pcre/${PV}/pcre-${PV}.tar.bz2 \
11 file://pcre-cross.patch \
12 file://fix-pcre-name-collision.patch \
13 file://run-ptest \
14 file://Makefile \
15"
16
17SRC_URI[md5sum] = "6aacb23986adccd9b3bc626c00979958"
18SRC_URI[sha256sum] = "a961c1c78befef263cc130756eeca7b674b4e73a81533293df44e4265236865b"
19
20S = "${WORKDIR}/pcre-${PV}"
21
22PROVIDES += "pcre"
23DEPENDS += "bzip2 zlib"
24
25PACKAGECONFIG[pcretest-readline] = "--enable-pcretest-libreadline,--disable-pcretest-libreadline,readline,"
26
27BINCONFIG = "${bindir}/pcre-config"
28
29inherit autotools binconfig-disabled ptest
30
31PARALLEL_MAKE = ""
32
33EXTRA_OECONF = "\
34 --enable-newline-is-lf \
35 --enable-rebuild-chartables \
36 --enable-utf8 \
37 --with-link-size=2 \
38 --with-match-limit=10000000 \
39"
40
41# Set LINK_SIZE in BUILD_CFLAGS given that the autotools bbclass use it to
42# set CFLAGS_FOR_BUILD, required for the libpcre build.
43BUILD_CFLAGS =+ "-DLINK_SIZE=2 -I${B}"
44CFLAGS += "-D_REENTRANT"
45CXXFLAGS_append_powerpc = " -lstdc++"
46
47PACKAGES =+ "libpcrecpp libpcreposix pcregrep pcregrep-doc pcretest pcretest-doc"
48
49SUMMARY_libpcrecpp = "${SUMMARY} - C++ wrapper functions"
50SUMMARY_libpcreposix = "${SUMMARY} - C wrapper functions based on the POSIX regex API"
51SUMMARY_pcregrep = "grep utility that uses perl 5 compatible regexes"
52SUMMARY_pcregrep-doc = "grep utility that uses perl 5 compatible regexes - docs"
53SUMMARY_pcretest = "program for testing Perl-comatible regular expressions"
54SUMMARY_pcretest-doc = "program for testing Perl-comatible regular expressions - docs"
55
56FILES_libpcrecpp = "${libdir}/libpcrecpp.so.*"
57FILES_libpcreposix = "${libdir}/libpcreposix.so.*"
58FILES_pcregrep = "${bindir}/pcregrep"
59FILES_pcregrep-doc = "${mandir}/man1/pcregrep.1"
60FILES_pcretest = "${bindir}/pcretest"
61FILES_pcretest-doc = "${mandir}/man1/pcretest.1"
62
63BBCLASSEXTEND = "native nativesdk"
64
65do_install_ptest() {
66 t=${D}${PTEST_PATH}
67 cp ${WORKDIR}/Makefile $t
68 cp -r ${S}/testdata $t
69 for i in pcre_stringpiece_unittest pcregrep pcretest; \
70 do cp ${B}/.libs/$i $t; \
71 done
72 for i in RunTest RunGrepTest test-driver; \
73 do cp ${S}/$i $t; \
74 done
75}