summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/flex
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2015-12-15 13:59:34 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-22 16:08:51 +0000
commit86c8b8b82e39ca4233ef0ae258dc0cb18734151c (patch)
treed47c506f3f0719e5818349f3fecfd5a34144ba2f /meta/recipes-devtools/flex
parentdad130b76493429b6dc1de436cb758cd1735f808 (diff)
downloadpoky-86c8b8b82e39ca4233ef0ae258dc0cb18734151c.tar.gz
flex: update to 2.6.0
Drop backported 0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch Test cases have been completely rearranged upstream, so ptest support is fully rewritten. Merge split bb/inc as there's no other user of the .inc [RB] As automake insists adding BUILD_SOURCES as a dependency to the "all" target, remove tests/ from the build unless ptests are enabled. This means native builds don't need a bison dependency. If ptests are enabled, we build-depend on flex-native and bison-native for the test suite, and tell it to use the flex-native binary instead of attempting to run the cross flex it just built. [RB] Move in-tree files from files/ to flex/ for consistency. [RB] (From OE-Core rev: 4fe048b7b32eb3d20a43171b83e8ad2037192d34) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/flex')
-rw-r--r--meta/recipes-devtools/flex/files/0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch80
-rwxr-xr-xmeta/recipes-devtools/flex/files/run-ptest29
-rw-r--r--meta/recipes-devtools/flex/flex.inc45
-rw-r--r--meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch28
-rw-r--r--meta/recipes-devtools/flex/flex/disable-tests.patch19
-rw-r--r--meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch (renamed from meta/recipes-devtools/flex/files/do_not_create_pdf_doc.patch)0
-rwxr-xr-xmeta/recipes-devtools/flex/flex/run-ptest5
-rw-r--r--meta/recipes-devtools/flex/flex_2.5.39.bb9
-rw-r--r--meta/recipes-devtools/flex/flex_2.6.0.bb55
9 files changed, 107 insertions, 163 deletions
diff --git a/meta/recipes-devtools/flex/files/0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch b/meta/recipes-devtools/flex/files/0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch
deleted file mode 100644
index 3504f546d3..0000000000
--- a/meta/recipes-devtools/flex/files/0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch
+++ /dev/null
@@ -1,80 +0,0 @@
1From 7fbc074901129ffaff9e18fadacae62d8053ad95 Mon Sep 17 00:00:00 2001
2From: Manoj Srivastava <srivasta@golden-gryphon.com>
3Date: Wed, 9 Apr 2014 00:23:07 -0700
4Subject: [PATCH] Do not use obsolete bison constructs in tests.
5
6In Bison 3.0, support for YYLEX_PARAM and YYPARSE_PARAM has been
7removed (deprecated in Bison 1.875): use %lex-param, %parse-param, or
8%param. This commit fixes the tests so they still work.
9
10Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
11
12Upstream-Status: Backport [from http://sourceforge.net/p/flex/bugs/169/]
13
14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
15---
16 tests/test-bison-yylloc/parser.y | 4 ++--
17 tests/test-bison-yylval/parser.y | 4 ++--
18 2 files changed, 4 insertions(+), 4 deletions(-)
19
20diff --git a/tests/test-bison-yylloc/parser.y b/tests/test-bison-yylloc/parser.y
21index e8f4e56..224d252 100644
22--- a/tests/test-bison-yylloc/parser.y
23+++ b/tests/test-bison-yylloc/parser.y
24@@ -22,6 +22,7 @@
25 */
26
27 %parse-param { void* scanner }
28+%lex-param { void* scanner }
29
30 /*
31 How to compile:
32@@ -34,7 +35,6 @@
33 #include "config.h"
34
35 #define YYERROR_VERBOSE 1
36-#define YYLEX_PARAM scanner
37
38 extern int testget_lineno(void*);
39
40@@ -52,7 +52,7 @@ int process_text(char* s) {
41
42 %}
43
44-%pure_parser
45+%pure-parser
46
47 %union {
48 int lineno;
49diff --git a/tests/test-bison-yylval/parser.y b/tests/test-bison-yylval/parser.y
50index 0ffdb89..626c5e7 100644
51--- a/tests/test-bison-yylval/parser.y
52+++ b/tests/test-bison-yylval/parser.y
53@@ -26,6 +26,7 @@
54 bison --defines --output-file="parser.c" --name-prefix="test" parser.y
55 */
56 %parse-param { void* scanner }
57+%lex-param { void* scanner }
58 %{
59 #include <stdio.h>
60 #include <stdlib.h>
61@@ -33,7 +34,6 @@
62 #include "config.h"
63
64 #define YYERROR_VERBOSE 1
65-#define YYLEX_PARAM scanner
66
67
68 /* A dummy function. A check against seg-faults in yylval->str. */
69@@ -49,7 +49,7 @@ int process_text(char* s) {
70
71 %}
72
73-%pure_parser
74+%pure-parser
75
76 %union {
77 long unused;
78--
791.9.1
80
diff --git a/meta/recipes-devtools/flex/files/run-ptest b/meta/recipes-devtools/flex/files/run-ptest
deleted file mode 100755
index bffba16f70..0000000000
--- a/meta/recipes-devtools/flex/files/run-ptest
+++ /dev/null
@@ -1,29 +0,0 @@
1#!/bin/sh
2
3test1="test-alloc-extra test-array-nr test-array-r test-basic-nr test-basic-r test-extended test-quotes \
4test-bison-nr test-bison-yylloc test-bison-yylval test-c++-basic test-c-cpp-nr test-prefix-nr test-ccl \
5test-c-cpp-r test-c++-multiple-scanners test-mem-r test-mem-nr test-debug-nr test-linedir-r test-noansi-r \
6test-yyextra test-header-r test-noansi-nr test-debug-r TEMPLATE test-top test-header-nr test-prefix-r"
7test2="test-multiple-scanners-nr test-posixly-correct test-posix test-string-r test-string-nr"
8test3="test-pthread test-include-by-push test-include-by-buffer test-include-by-reentrant"
9test4="test-lineno-nr test-lineno-r test-lineno-trailing"
10test5="test-c++-yywrap test-rescan-r test-rescan-nr"
11test6="test-reject-nr test-reject-r"
12test7="test-reject-ser test-reject-ver"
13test8="test-multiple-scanners-r"
14
15output() {
16 if [ $? -eq 0 ]; \
17 then echo "PASS: $i"; \
18 else echo "FAIL: $i"; \
19 fi;
20}
21
22for i in $test1; do $i/$i < $i/test.input >/dev/null; output; done
23for i in $test2; do $i/$i >/dev/null; output; done
24for i in $test3; do cd $i; ./$i test-1.input >/dev/null; output; cd ..; done
25for i in $test4; do test `$i/$i < $i/test.input` -eq `$i/$i 1 < $i/test.input` >/dev/null; output; done
26for i in $test5; do $i/$i $i/test.input >/dev/null; output; done
27for i in $test6; do test-reject/$i < test-reject/test.input >/dev/null; output; done
28for i in $test7; do test-reject/$i test-reject/$i.tables < test-reject/test.input >/dev/null; output; done
29cd $test8; ./$test8 >/dev/null; i=$test8 output
diff --git a/meta/recipes-devtools/flex/flex.inc b/meta/recipes-devtools/flex/flex.inc
deleted file mode 100644
index fbe921bfbe..0000000000
--- a/meta/recipes-devtools/flex/flex.inc
+++ /dev/null
@@ -1,45 +0,0 @@
1SUMMARY = "Flex (The Fast Lexical Analyzer)"
2DESCRIPTION = "Flex is a fast lexical analyser generator. Flex is a tool for generating programs that recognize \
3lexical patterns in text."
4HOMEPAGE = "http://sourceforge.net/projects/flex/"
5
6SECTION = "devel"
7LICENSE = "BSD"
8DEPENDS += "${@'bison-native flex-native' if '${PTEST_ENABLED}' == '1' else ''}"
9
10SRC_URI = "${SOURCEFORGE_MIRROR}/flex/flex-${PV}.tar.bz2 \
11 file://0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch \
12 file://run-ptest \
13"
14
15inherit autotools gettext texinfo ptest
16
17
18M4 = "${bindir}/m4"
19M4_class-native = "${STAGING_BINDIR_NATIVE}/m4"
20
21EXTRA_OECONF += "ac_cv_path_M4=${M4}"
22EXTRA_OEMAKE += "m4=${STAGING_BINDIR_NATIVE}/m4"
23
24do_install_append_class-native() {
25 create_wrapper ${D}/${bindir}/flex M4=${M4}
26}
27
28do_install_append_class-nativesdk() {
29 create_wrapper ${D}/${bindir}/flex M4=${M4}
30}
31
32RDEPENDS_${PN} += "m4"
33
34do_compile_ptest() {
35 for i in `find ${S}/tests/ -type d |grep -Ev "concatenated-options|reject|table-opts" | awk -F/ '{print $NF}'`; \
36 do oe_runmake -C ${S}/tests/$i -f ${B}/tests/$i/Makefile top_builddir=${B} FLEX=flex $i; \
37 done
38 oe_runmake -C ${S}/tests/test-reject -f ${B}/tests/test-reject/Makefile top_builddir=${B} FLEX=flex test-reject-nr test-reject-r test-reject-ser test-reject-ver
39}
40
41do_install_ptest() {
42 for i in `find ${S}/tests/ -type d | awk -F/ '{print $NF}'`; \
43 do cp -r ${S}/tests/$i ${D}${PTEST_PATH}; \
44 done
45}
diff --git a/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch
new file mode 100644
index 0000000000..556c240b24
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch
@@ -0,0 +1,28 @@
1From b4aa18d939fc0c8825fa584dfcee1a7da61099cf Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 10 Dec 2015 16:09:26 +0200
4Subject: [PATCH] tests: add a target for building tests without running them
5
6Upstream-Status: Inappropriate [oe specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 tests/Makefile.am | 3 +++
10 1 file changed, 3 insertions(+)
11
12diff --git a/tests/Makefile.am b/tests/Makefile.am
13index 4ac3c17..0025cfe 100644
14--- a/tests/Makefile.am
15+++ b/tests/Makefile.am
16@@ -21,6 +21,9 @@
17
18 TESTS = $(check_PROGRAMS) options.cn
19
20+# This allows building tests without running them
21+buildtests: $(TESTS)
22+
23 # The script testwrapper.sh will run most tests as is. A couple tests
24 # in the suite end in .reject, .table and the like so that we can pass
25 # different arguments to the test runner. We list those extensions so
26--
272.6.2
28
diff --git a/meta/recipes-devtools/flex/flex/disable-tests.patch b/meta/recipes-devtools/flex/flex/disable-tests.patch
new file mode 100644
index 0000000000..4dc801d72c
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex/disable-tests.patch
@@ -0,0 +1,19 @@
1Due to automake stupidity the Makefile in tests/ has an 'all' target that
2depends on $(BUILD_SOURCES), which means when building flex parts of the test
3suite are built even if they're not needed, resulting in flex needing
4flex-native and bison-native to build.
5
6This patch removes the tests directory from SUBDIRS and will be conditionally
7applied by the recipe.
8
9Upstream-Status: Inappropriate
10Signed-off-by: Ross Burton <ross.burton@intel.com>
11
12diff --git a/Makefile.am b/Makefile.am
13index 076ccad..0574d7b 100644
14--- a/Makefile.am
15+++ b/Makefile.am
16@@ -55,3 +55,2 @@ SUBDIRS = \
17 po \
18- tests \
19 tools
diff --git a/meta/recipes-devtools/flex/files/do_not_create_pdf_doc.patch b/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch
index 032833ae7a..032833ae7a 100644
--- a/meta/recipes-devtools/flex/files/do_not_create_pdf_doc.patch
+++ b/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch
diff --git a/meta/recipes-devtools/flex/flex/run-ptest b/meta/recipes-devtools/flex/flex/run-ptest
new file mode 100755
index 0000000000..19db337900
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex/run-ptest
@@ -0,0 +1,5 @@
1#!/bin/sh
2
3# make would want to rebuild some files with a compiler otherwise :-/
4make FLEX=/usr/bin/flex -t check-TESTS || true
5make FLEX=/usr/bin/flex check-TESTS
diff --git a/meta/recipes-devtools/flex/flex_2.5.39.bb b/meta/recipes-devtools/flex/flex_2.5.39.bb
deleted file mode 100644
index 7485743b29..0000000000
--- a/meta/recipes-devtools/flex/flex_2.5.39.bb
+++ /dev/null
@@ -1,9 +0,0 @@
1require flex.inc
2LICENSE = "BSD"
3LIC_FILES_CHKSUM = "file://COPYING;md5=e4742cf92e89040b39486a6219b68067"
4BBCLASSEXTEND = "native nativesdk"
5
6SRC_URI += "file://do_not_create_pdf_doc.patch"
7
8SRC_URI[md5sum] = "77d44c6bb8c0705e0017ab9a84a1502b"
9SRC_URI[sha256sum] = "add2b55f3bc38cb512b48fad7d72f43b11ef244487ff25fc00aabec1e32b617f"
diff --git a/meta/recipes-devtools/flex/flex_2.6.0.bb b/meta/recipes-devtools/flex/flex_2.6.0.bb
new file mode 100644
index 0000000000..8285426d45
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex_2.6.0.bb
@@ -0,0 +1,55 @@
1SUMMARY = "Flex (The Fast Lexical Analyzer)"
2DESCRIPTION = "Flex is a fast lexical analyser generator. Flex is a tool for generating programs that recognize \
3lexical patterns in text."
4HOMEPAGE = "http://sourceforge.net/projects/flex/"
5SECTION = "devel"
6LICENSE = "BSD"
7
8DEPENDS = "${@bb.utils.contains('PTEST_ENABLED', '1', 'bison-native flex-native', '', d)}"
9BBCLASSEXTEND = "native nativesdk"
10
11LIC_FILES_CHKSUM = "file://COPYING;md5=e4742cf92e89040b39486a6219b68067"
12
13SRC_URI = "${SOURCEFORGE_MIRROR}/flex/flex-${PV}.tar.bz2 \
14 file://run-ptest \
15 file://do_not_create_pdf_doc.patch \
16 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
17 ${@bb.utils.contains('PTEST_ENABLED', '1', '', 'file://disable-tests.patch', d)} \
18 "
19
20SRC_URI[md5sum] = "266270f13c48ed043d95648075084d59"
21SRC_URI[sha256sum] = "24e611ef5a4703a191012f80c1027dc9d12555183ce0ecd46f3636e587e9b8e9"
22
23UPSTREAM_CHECK_REGEX = "flex-(?P<pver>\d+(\.\d+)+)\.tar"
24
25inherit autotools gettext texinfo ptest
26
27M4 = "${bindir}/m4"
28M4_class-native = "${STAGING_BINDIR_NATIVE}/m4"
29EXTRA_OECONF += "ac_cv_path_M4=${M4}"
30EXTRA_OEMAKE += "m4=${STAGING_BINDIR_NATIVE}/m4"
31
32EXTRA_OEMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', 'FLEX=${STAGING_BINDIR_NATIVE}/flex', '', d)}"
33
34do_install_append_class-native() {
35 create_wrapper ${D}/${bindir}/flex M4=${M4}
36}
37
38do_install_append_class-nativesdk() {
39 create_wrapper ${D}/${bindir}/flex M4=${M4}
40}
41
42RDEPENDS_${PN} += "m4"
43RDEPENDS_${PN}-ptest += "bash gawk"
44
45do_compile_ptest() {
46 oe_runmake -C ${B}/tests -f ${B}/tests/Makefile top_builddir=${B} INCLUDES=-I${S}/src buildtests
47}
48
49do_install_ptest() {
50 mkdir -p ${D}${PTEST_PATH}/build-aux/
51 cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
52 cp -r ${S}/tests/* ${D}${PTEST_PATH}
53 cp -r ${B}/tests/* ${D}${PTEST_PATH}
54 sed -e 's/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/^top_srcdir = \(.*\)/top_srcdir = ./' -i ${D}${PTEST_PATH}/Makefile
55}