> Gesendet: Sonntag, 18. Juni 2017 um 17:48 Uhr
> Von: gerritbinnenmars <gerritbinnenm...@gmail.com>
> An: dev@celix.apache.org
> Betreff: Re: Is there a Yocto-Recipe for Celix 2.0.0 available?
>
> HelloI think a colleguae created a yocto recipe. I will ask him tomorrow 
> about it.
> Gerrit
> -------- Oorspronkelijk bericht --------Van: Pepijn Noltes 
> <pepijnnol...@gmail.com> Datum: 18-06-17  13:02  (GMT+01:00) Aan: 
> dev@celix.apache.org Onderwerp: Re: Is there a Yocto-Recipe for Celix 2.0.0 
> available? 
> Hi,
> 
> 
> On Fri, Jun 16, 2017 at 7:08 PM eddi1...@gmx.net <eddi1...@gmx.net> wrote:
> 
> > On 16.06.2017 15:30, eddi1...@gmx.net wrote:
> > > Hallo,
> > >
> > > is there a yocto recipe for celix 2.0.0 available? I don't found it at
> > > http://layers.openembedded.org.
> 
> >
> > > After that I tried to build the recipe on my own, but I get build errors
> > > because of the -Werror-Flag that is set by the buildsystem and I am not
> > > able to change the CFLAGS for this recipe only. I am a novice in yocto.
> >
> 
> Aah cool. Yeah there is currently no Yocto recipe for Celix, but if you are
> able to create a working one, we are happy to receive a patch ;)
> 
> 
> > >
> > > Thanks.
> >
> > I disabled all Werrors in the CMakeLists,txt. But now I get a new error
> > in dfi/private/src/json_serializer.c:266
> >
> > json_array_foreach(array, index, val) {..}
> >
> > error: expected ';' before '{' token
> >
> > What is that? A nested function in C? And how I could compile it?
> >
> >
> json_array_foreach is a marco from the jansson library. It was introduced
> in jansson version 2.5 (2.8 is the current). I think there error is a
> result of the marco not being available.
> Do you known which version version of jansson you are using?
> 
> 
> >
> > Row 254:
> > static int jsonSerializer_parseSequence(dyn_type *seq, json_t *array,
> > void *seqLoc) {
> >      assert(dynType_type(seq) == DYN_TYPE_SEQUENCE);
> >      int status = OK;
> >
> >      size_t size = json_array_size(array);
> >      //LOG_DEBUG("Allocating sequence with capacity %zu", size);
> >      status = dynType_sequence_alloc(seq, seqLoc, (int) size);
> >
> >      if (status == OK) {
> >          dyn_type *itemType = dynType_sequence_itemType(seq);
> >          size_t index;
> >          json_t *val;
> >          json_array_foreach(array, index, val) {
> >              void *valLoc = NULL;
> >              status =
> > dynType_sequence_increaseLengthAndReturnLastLoc(seq, seqLoc, &valLoc);
> >              //LOG_DEBUG("Got sequence loc %p for index %zu", valLoc,
> > index);
> >
> >              if (status == OK) {
> >                  status = jsonSerializer_parseAny(itemType, valLoc, val);
> >                  if (status != OK) {
> >                      break;
> >                  }
> >              }
> >          }
> >      }
> >
> >      return status;
> > }
> > Row 281:
> >
> 


Yes. I used the wrong jansson version. Now it builds. I was able to create 
a recipe for celix, too. I had to create a patch, to remove all -Werror Flags
from the CMakeLists.txt. (My Compiler throws warnings (GCC 5.3))


Maybe someone with more experience could review this recipe. Especially to use
the right version in the dependencies (jansson greater 2.5). The Werror-Patch 
had to be in the subdir 'files'.

Recipe:

SUMMARY = "An implementation of the OSGi specification adapted to C and C++"
DESCRIPTION = "An implementation of the OSGi specification adapted to C and C++"
HOMEPAGE = "https://celix.apache.org/";
BUGTRACKER = "https://issues.apache.org/jira/projects/CELIX";
SECTION = "libs"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e9d731e145e8f416f2b8b6c0ed599d7d"

SRC_URI = "http://www-eu.apache.org/dist/${PN}/${P}/${P}.tar.gz \
           file://0001-Remove-Werror-Flags.patch \
          "
SRC_URI[md5sum] = "adfcc53b51dd5d188f850432f97211db"
SRC_URI[sha256sum] = 
"add1ac205e455b3d2b7ea5aae23b9216cfbb46fa977eaac971dfd81402a92f91"

RDEPENDS_${PN} = "util-linux jansson libxml2 libffi curl" 

inherit cmake pkgconfig



Patch:

>From 8a6f54af9213125b9e3c9586e6b9b1272cdd1c66 Mon Sep 17 00:00:00 2001
From: eddi1983 <eddi1...@gmx.net>
Date: Sun, 18 Jun 2017 19:11:25 +0200
Subject: [PATCH] Remove -Werror-Flags to build software

Signed-off-by: eddi1983 <eddi1...@gmx.net>
---
 CMakeLists.txt                               | 2 +-
 dependency_manager_cxx/CMakeLists.txt        | 2 +-
 examples/dm_example_cxx/CMakeLists.txt       | 2 +-
 examples/services_example_cxx/CMakeLists.txt | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8dba55d..5319344d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,7 +36,7 @@ IF (ANDROID)
     SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall ${CMAKE_C_FLAGS}")
 ENDIF()
 IF(UNIX AND NOT ANDROID)
-    SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall -Werror -fPIC 
${CMAKE_C_FLAGS}")
+    SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall -fPIC ${CMAKE_C_FLAGS}")
     SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") #TODO enable -Wall 
-Werror -> warning in cpputest
     SET(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG")
     SET(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG")
diff --git a/dependency_manager_cxx/CMakeLists.txt 
b/dependency_manager_cxx/CMakeLists.txt
index 6c9869e3..e52c057d 100644
--- a/dependency_manager_cxx/CMakeLists.txt
+++ b/dependency_manager_cxx/CMakeLists.txt
@@ -19,7 +19,7 @@ celix_subproject(DEPENDENCY_MANAGER_CXX "Option to build the 
C++ dependency mana
 if (DEPENDENCY_MANAGER_CXX)
 
     #set -Wall, -Werror locally, currenctly cpputest contains warnings
-    set(CMAKE_CXX_FLAGS "-Wall -Werror -fno-rtti -fno-exceptions 
${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-Wall -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
 
     # Add -fPIC for x86_64 Unix platforms; this lib will be linked to a shared 
lib
     if(UNIX AND NOT WIN32)
diff --git a/examples/dm_example_cxx/CMakeLists.txt 
b/examples/dm_example_cxx/CMakeLists.txt
index 88e1a89e..a63d63a2 100644
--- a/examples/dm_example_cxx/CMakeLists.txt
+++ b/examples/dm_example_cxx/CMakeLists.txt
@@ -16,7 +16,7 @@
 # under the License.
 if (BUILD_DEPENDENCY_MANAGER_CXX)
     #set -Wall, -Werror locally, currenctly cpputest contains warnings
-    set(CMAKE_CXX_FLAGS "-Wall -Werror -fno-rtti -fno-exceptions 
${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-Wall -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
 
     include_directories(
             ${PROJECT_SOURCE_DIR}/dependency_manager/public/include
diff --git a/examples/services_example_cxx/CMakeLists.txt 
b/examples/services_example_cxx/CMakeLists.txt
index b74c454f..db719a2f 100644
--- a/examples/services_example_cxx/CMakeLists.txt
+++ b/examples/services_example_cxx/CMakeLists.txt
@@ -16,7 +16,7 @@
 # under the License.
 if (BUILD_DEPENDENCY_MANAGER_CXX)
 
-    set(CMAKE_CXX_FLAGS "-Wall -Werror -fno-rtti -fno-exceptions 
${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-Wall -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
 
     include_directories(
             ${PROJECT_SOURCE_DIR}/dependency_manager/public/include
-- 
2.13.0





Reply via email to