[yocto] [meta-mingw][PATCH] diffutils_3.6: build for mingw

Juro Bystricky juro.bystricky at intel.com
Thu Apr 12 16:28:14 PDT 2018


Build of diffutils was requested/broken for mingw because of the commit
"diffutils: allow native & nativesdk builds"

This patch implements neccessary steps needed to build diffutils executables:
    cmp.exe
    diff.exe
    diff3.exe
    sdiff.exe

[YOCTO #12662]

Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
---
 .../diffutils/diffutils/sdiff-no-kill.patch            | 18 ++++++++++++++++++
 recipes-extended/diffutils/diffutils_3.6.bbappend      | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 recipes-extended/diffutils/diffutils/sdiff-no-kill.patch
 create mode 100644 recipes-extended/diffutils/diffutils_3.6.bbappend

diff --git a/recipes-extended/diffutils/diffutils/sdiff-no-kill.patch b/recipes-extended/diffutils/diffutils/sdiff-no-kill.patch
new file mode 100644
index 0000000..70e7caf
--- /dev/null
+++ b/recipes-extended/diffutils/diffutils/sdiff-no-kill.patch
@@ -0,0 +1,18 @@
+"kill" is not supported by mingw, so compile conditionally,
+(same condition as another instance of "kill" in the source code).
+
+Upstream-Status: Pending
+Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
+
+--- a/src/sdiff.c
++++ b/src/sdiff.c
+@@ -805,7 +805,9 @@
+ 
+       /* Yield an exit status indicating that a signal was received.  */
+       untrapsig (s);
++#if HAVE_WORKING_FORK
+       kill (getpid (), s);
++#endif
+ 
+       /* That didn't work, so exit with error status.  */
+       exit (EXIT_TROUBLE);
diff --git a/recipes-extended/diffutils/diffutils_3.6.bbappend b/recipes-extended/diffutils/diffutils_3.6.bbappend
new file mode 100644
index 0000000..f301349
--- /dev/null
+++ b/recipes-extended/diffutils/diffutils_3.6.bbappend
@@ -0,0 +1,18 @@
+
+FILESEXTRAPATHS_prepend_mingw32 := "${THISDIR}/${BPN}:"
+
+SRC_URI_remove_mingw32 = "file://0001-explicitly-disable-replacing-getopt.patch"
+SRC_URI_append_mingw32 = " file://sdiff-no-kill.patch"
+
+CACHED_CONFIGUREVARS_append_mingw32 = " ac_cv_header_getopt_h=yes "
+
+# Add some definitions for POSIX signals..
+CFLAGS_append_mingw32 = " -DSIGALRM=14 -DSIGHUP=1 -DSIGQUIT=3 -DSIGPIPE=13 -DSIGTSTP=18 -DSIGSTOP=17 "
+
+do_configure_prepend_mingw32 () {
+    # Remove building of "man"
+    sed -i -e 's:^SUBDIRS = lib src tests doc man po gnulib-test:SUBDIRS = lib src tests doc po gnulib-test:g' ${S}/Makefile.am
+}
+
+
+
-- 
2.7.4




More information about the yocto mailing list