summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/recipes-devtools/m4
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/recipes-devtools/m4')
-rw-r--r--external/poky/meta/recipes-devtools/m4/m4-1.4.18.inc40
-rw-r--r--external/poky/meta/recipes-devtools/m4/m4/0001-test-getopt-posix-fix.patch41
-rw-r--r--external/poky/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch3
-rw-r--r--external/poky/meta/recipes-devtools/m4/m4/remove-gets.patch24
-rw-r--r--external/poky/meta/recipes-devtools/m4/m4/run-ptest5
-rw-r--r--external/poky/meta/recipes-devtools/m4/m4/serial-tests-config.patch30
6 files changed, 114 insertions, 29 deletions
diff --git a/external/poky/meta/recipes-devtools/m4/m4-1.4.18.inc b/external/poky/meta/recipes-devtools/m4/m4-1.4.18.inc
index a6cef6f3..a9b63c1b 100644
--- a/external/poky/meta/recipes-devtools/m4/m4-1.4.18.inc
+++ b/external/poky/meta/recipes-devtools/m4/m4-1.4.18.inc
@@ -4,15 +4,17 @@ DESCRIPTION = "GNU m4 is an implementation of the traditional Unix macro process
compatible although it has some extensions (for example, handling more than 9 positional parameters to macros). \
GNU M4 also has built-in functions for including files, running shell commands, doing arithmetic, etc."
-inherit autotools texinfo
+inherit autotools texinfo ptest
SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz \
file://ac_config_links.patch \
- file://remove-gets.patch \
file://m4-1.4.18-glibc-change-work-around.patch \
"
-
-SRC_URI_append_class-target = " file://0001-Unset-need_charset_alias-when-building-for-musl.patch"
+SRC_URI_append_class-target = " file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://run-ptest \
+ file://serial-tests-config.patch \
+ file://0001-test-getopt-posix-fix.patch \
+ "
SRC_URI[md5sum] = "a077779db287adf4e12a035029002d28"
SRC_URI[sha256sum] = "ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab"
@@ -28,3 +30,33 @@ acpaths = "-I ./m4"
EXTRA_OECONF += "--without-libsigsegv-prefix"
EXTRA_OEMAKE += "'infodir=${infodir}'"
+
+do_compile_ptest() {
+ cd ${B}/tests
+ sed -i '/^buildtest-TESTS: /c buildtest-TESTS: $(TESTS) $(check_LIBRARIES) $(check_PROGRAMS)' Makefile
+ oe_runmake buildtest-TESTS
+}
+
+do_install_ptest() {
+ cp -r ${B}/tests ${D}${PTEST_PATH}
+ cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests/
+ sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
+ sed -i -e "s;LOCALE_FR='fr_FR';LOCALE_FR='fr_FR.iso88591';g" \
+ -e "s;LOCALE_FR_UTF8='none';LOCALE_FR_UTF8='fr_FR.utf8';g" ${D}${PTEST_PATH}/tests/Makefile
+ find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {}
+ cp ${S}/build-aux/update-copyright ${D}${PTEST_PATH}/tests/
+ sed -i 's;update-copyright;./update-copyright;g' ${D}${PTEST_PATH}/tests/test-update-copyright.sh
+ chmod 0755 ${D}${PTEST_PATH}/tests/test-mbrtowc-w32-1.sh ${D}${PTEST_PATH}/tests/test-spawn-pipe-main \
+ ${D}${PTEST_PATH}/tests/test-spawn-pipe-child ${D}${PTEST_PATH}/tests/test-version-etc \
+ ${D}${PTEST_PATH}/tests/test-xalloc-die
+}
+
+
+RDEPENDS_${PN}-ptest += "make coreutils diffutils"
+RDEPENDS_${PN}-ptest_append_libc-glibc = "\
+ locale-base-fr-fr.iso-8859-1 \
+"
+
+INSANE_SKIP_${PN}-ptest += "ldflags"
+INSANE_SKIP_${PN}-ptest += "rpaths"
+
diff --git a/external/poky/meta/recipes-devtools/m4/m4/0001-test-getopt-posix-fix.patch b/external/poky/meta/recipes-devtools/m4/m4/0001-test-getopt-posix-fix.patch
new file mode 100644
index 00000000..11508ee0
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/m4/m4/0001-test-getopt-posix-fix.patch
@@ -0,0 +1,41 @@
+From 75bea7c72a919859674f493548653de88f96c798 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Mon, 22 Apr 2019 10:36:13 +0800
+Subject: [PATCH] test-getopt-posix fix
+
+fix below problem:
+test-getopt.h:754: assertion 'strcmp (argv[1], "donald") == 0' failed
+
+get this patch from
+https://github.com/habitat-sh/core-plans/blob/master/m4/fix-test-getopt-posix-with-glibc-2.26.patch
+
+Upstream-Status: Pending
+
+have report this bug to m4-discuss@gnu.org
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ tests/test-getopt-posix.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/tests/test-getopt-posix.c b/tests/test-getopt-posix.c
+index 5532271..2a3d511 100644
+--- a/tests/test-getopt-posix.c
++++ b/tests/test-getopt-posix.c
+@@ -22,6 +22,13 @@
+ ftell link warning if we are not using the gnulib ftell module. */
+ #define _GL_NO_LARGE_FILES
+
++/*
++ * Glibc 2.26 does hard include bits/getopt_posix.h which causes the system
++ * to use glibc's getopt but the tests expect gnulib behavior. Until a better
++ * fix is available this avoids that mis-resolution.
++ */
++#include <getopt.h>
++
+ /* POSIX and glibc provide the getopt() function in <unistd.h>, see
+ http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html
+ https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch b/external/poky/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch
index 72e7ae20..c10bcbf6 100644
--- a/external/poky/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch
+++ b/external/poky/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch
@@ -3,8 +3,9 @@ update for glibc libio.h removal in 2.28+
see
https://src.fedoraproject.org/rpms/m4/c/814d592134fad36df757f9a61422d164ea2c6c9b?branch=master
-Upstream-Status: Pending
+Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a718]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
Index: m4-1.4.18/lib/fflush.c
===================================================================
--- m4-1.4.18.orig/lib/fflush.c
diff --git a/external/poky/meta/recipes-devtools/m4/m4/remove-gets.patch b/external/poky/meta/recipes-devtools/m4/m4/remove-gets.patch
deleted file mode 100644
index abe82f3b..00000000
--- a/external/poky/meta/recipes-devtools/m4/m4/remove-gets.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-eglibc has remove gets starting 2.16
-therefore check for its being there before
-undefining it.
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/lib/stdio.in.h b/lib/stdio.in.h
-index 5727452..f04a691 100644
---- a/lib/stdio.in.h
-+++ b/lib/stdio.in.h
-@@ -742,10 +742,12 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
- /* It is very rare that the developer ever has full control of stdin,
- so any use of gets warrants an unconditional warning; besides, C11
- removed it. */
-+#if defined gets
- #undef gets
- #if HAVE_RAW_DECL_GETS && !defined __cplusplus
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- #endif
-+#endif
-
- #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
- struct obstack;
diff --git a/external/poky/meta/recipes-devtools/m4/m4/run-ptest b/external/poky/meta/recipes-devtools/m4/m4/run-ptest
new file mode 100644
index 00000000..5c0fe933
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/m4/m4/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+#This script is used to run m4 test suites
+cd tests
+make -k runtest-TESTS top_srcdir=.. srcdir=.
diff --git a/external/poky/meta/recipes-devtools/m4/m4/serial-tests-config.patch b/external/poky/meta/recipes-devtools/m4/m4/serial-tests-config.patch
new file mode 100644
index 00000000..34e6ad80
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/m4/m4/serial-tests-config.patch
@@ -0,0 +1,30 @@
+From ab8491111b4578db5b735c6466187775e1855f18 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Tue, 23 Apr 2019 15:35:00 +0800
+Subject: [PATCH] add a patch to use serial-tests config needed by ptest
+
+Add serial-tests support, ptest need it.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 78b8788..931fa6f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -22,7 +22,7 @@ AC_INIT([GNU M4], m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+ [bug-m4@gnu.org])
+ AC_CONFIG_AUX_DIR([build-aux])
+
+-AM_INIT_AUTOMAKE([1.11.6 dist-bzip2 dist-xz color-tests parallel-tests
++AM_INIT_AUTOMAKE([1.11.6 dist-bzip2 dist-xz color-tests serial-tests
+ silent-rules subdir-objects gnu])
+ AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
+
+--
+2.7.4
+