diff mbox series

[oe,meta-oe,2/2] sblim-sfcb: Fix build with musl

Message ID 20170901050728.37511-2-raj.khem@gmail.com
State Accepted
Commit e67ac72d077a6d01577d15c08898f54bc5f568a2
Headers show
Series [oe,meta-oe,1/2] iptraf-ng: Add new recipe | expand

Commit Message

Khem Raj Sept. 1, 2017, 5:07 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...e-need-for-error.h-when-it-does-not-exist.patch | 124 +++++++++++++++++++++
 .../sblim-sfcb/sblim-sfcb_1.4.9.bb                 |   1 +
 2 files changed, 125 insertions(+)
 create mode 100644 meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-Replace-need-for-error.h-when-it-does-not-exist.patch

-- 
2.14.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-Replace-need-for-error.h-when-it-does-not-exist.patch b/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-Replace-need-for-error.h-when-it-does-not-exist.patch
new file mode 100644
index 000000000..e72305023
--- /dev/null
+++ b/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-Replace-need-for-error.h-when-it-does-not-exist.patch
@@ -0,0 +1,124 @@ 
+From 394bf0f1ed07419d40f6024363cc1ffc7ef61bc6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Aug 2017 21:56:25 -0700
+Subject: [PATCH] Replace need for error.h when it does not exist
+
+helps fixing build on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ brokerUpc.c   |  5 ++++-
+ configure.ac  |  2 +-
+ httpAdapter.c |  4 +++-
+ support.c     | 14 +++++++++++++-
+ trace.c       |  4 +++-
+ 5 files changed, 24 insertions(+), 5 deletions(-)
+
+diff --git a/brokerUpc.c b/brokerUpc.c
+index 17cbd9b..fe2b347 100644
+--- a/brokerUpc.c
++++ b/brokerUpc.c
+@@ -20,8 +20,11 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
++#ifdef HAVE_ERROR_H
+ #include <error.h>
+-
++#else
++#include <err.h>
++#endif
+ #include "support.h"
+ #include "native.h"
+ #include <sfcCommon/utilft.h>
+diff --git a/configure.ac b/configure.ac
+index ab2964e..d4915a1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -517,7 +517,7 @@ fi
+ # Checks for header files.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
+-AC_CHECK_HEADERS([fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h zlib.h])
++AC_CHECK_HEADERS([error.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h zlib.h])
+ AC_CHECK_HEADERS([cmpi/cmpimacs.h cmpi/cmpift.h cmpi/cmpidt.h],[],[AC_MSG_ERROR([Could not find required CPMI header.])])
+ 
+ # Checks for typedefs, structures, and compiler characteristics.
+diff --git a/httpAdapter.c b/httpAdapter.c
+index 2719e6c..e768972 100644
+--- a/httpAdapter.c
++++ b/httpAdapter.c
+@@ -71,7 +71,9 @@
+ #ifdef HAVE_UDS
+ #include <grp.h>
+ #endif
+-
++#ifndef __SOCKADDR_ARG
++# define __SOCKADDR_ARG         struct sockaddr *__restrict
++#endif
+ /* should probably go into cimRequest.h */
+ #define CIM_PROTOCOL_ANY     0
+ #define CIM_PROTOCOL_CIM_XML 1
+diff --git a/support.c b/support.c
+index c7bba8b..5b3eef1 100644
+--- a/support.c
++++ b/support.c
+@@ -32,7 +32,11 @@
+ #include "support.h"
+ #include <stdio.h>
+ #include <stdlib.h>
++#ifdef HAVE_ERROR_H
+ #include <error.h>
++#else
++#include <err.h>
++#endif
+ #include <errno.h>
+ #include "native.h"
+ #include "trace.h"
+@@ -331,17 +335,25 @@ loadQualifierDeclMI(const char *provider,
+   _SFCB_RETURN(NULL);
+ };
+ 
++
+ /****************************************************************************/
+ 
+ /** Exits the program with a memory allocation error message in case the given 
+  *  condition holds.
+  */
++#if HAVE_ERROR_H
+ #define __ALLOC_ERROR(cond) \
+   if ( cond ) { \
+     error_at_line ( -1, errno, __FILE__, __LINE__, \
+ 		    "unable to allocate requested memory." ); \
+   }
+-
++#else
++#define __ALLOC_ERROR(cond) \
++  if ( cond ) { \
++    err(1, "%s:%d: %s", __FILE__, __LINE__, \
++		    "unable to allocate requested memory." ); \
++  }
++#endif
+ /**
+  * flag to ensure MM is initialized only once
+  */
+diff --git a/trace.c b/trace.c
+index d7f30db..438af46 100644
+--- a/trace.c
++++ b/trace.c
+@@ -279,7 +279,9 @@ _sfcb_trap(int tn)
+   }
+ #endif
+ }
+-
++#ifndef SA_INTERRUPT
++# define SA_INTERRUPT 0x20000000 /* from GLIBC's <bits/sigaction.h> */
++#endif
+ sigHandler     *
+ setSignal(int sn, sigHandler * sh, int flags)
+ {
+-- 
+2.14.1
+
diff --git a/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb_1.4.9.bb b/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb_1.4.9.bb
index ddb1cba7f..c6b9f1019 100644
--- a/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb_1.4.9.bb
+++ b/meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb_1.4.9.bb
@@ -21,6 +21,7 @@  SRC_URI = "http://downloads.sourceforge.net/sblim/${BP}.tar.bz2 \
            file://sblim-sfcb-1.4.8-default-ecdh-curve-name.patch \
            file://sblim-sfcb-1.4.9-fix-ftbfs.patch \
            file://0001-include-stdint.h-system-header-for-UINT16_MAX.patch \
+           file://0001-Replace-need-for-error.h-when-it-does-not-exist.patch \
 "
 
 SRC_URI[md5sum] = "28021cdabc73690a94f4f9d57254ce30"