summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuro Bystricky <juro.bystricky@intel.com>2018-04-12 15:49:29 -0700
committerJuro Bystricky <juro.bystricky@intel.com>2018-04-12 16:23:31 -0700
commiteee38fa5f2a376c840878fb818cb1dabd9a45491 (patch)
tree478f29e0cc0d0cc7b72ce89d7eb431cd9a532bfd
parent6a7e6a53bb1198d9f99e6b91947ddf31627b7db4 (diff)
diffutils_3.6: build for mingw
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@intel.com>
-rw-r--r--recipes-extended/diffutils/diffutils/sdiff-no-kill.patch18
-rw-r--r--recipes-extended/diffutils/diffutils_3.6.bbappend18
2 files changed, 36 insertions, 0 deletions
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@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
+}
+
+
+