[IMPROVE] Add old json support in case of wearable 81/46981/1
authorAlexander Aksenov <a.aksenov@samsung.com>
Thu, 27 Aug 2015 13:13:06 +0000 (16:13 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Thu, 27 Aug 2015 13:13:06 +0000 (16:13 +0300)
Change-Id: Iabcb35f787e177849f27d3244440a3c7f968e75f
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
daemon/Makefile
daemon/wsi.c
packaging/swap-manager.spec

index 4cda24b..9882a6b 100644 (file)
@@ -43,6 +43,10 @@ ifeq ($(PROFILE_TV),y)
 FLAGS += -DPROFILE_TV
 endif # PROFILE_TV
 
+# set using old json
+ifeq ($(OLD_JSON),y)
+FLAGS += -DOLD_JSON
+endif # OLD_JSON
 
 # CALL_MNGR
 ifeq ($(CALL_MNGR),y)
@@ -66,7 +70,6 @@ LDFLAGS := \
        -lecore \
        -lcapi-system-info \
        -lwebsockets \
-       -ljson-c \
        -lparserelf
 
 # CALL_MNGR
@@ -74,6 +77,13 @@ ifeq ($(CALL_MNGR),y)
 LDFLAGS += -lcallmgr_client
 endif # CALL_MNGR
 
+# set using old json
+ifeq ($(OLD_JSON),y)
+LDFLAGS += -ljson
+else
+LDFLAGS += -ljson-c
+endif # OLD_JSON
+
 SRC_C := \
        buffer.c \
        da_data.c \
index 7559c1e..f925c99 100644 (file)
 #include <string.h>
 #include <pthread.h>
 #include <libwebsockets.h>
-#include <json.h>
 #include <errno.h>
 
+#ifdef OLD_JSON
+#include <json/json.h>
+#else /* OLD_JSON */
+#include <json.h>
+#endif /* OLD_JSON */
+
+
 #include "wsi.h"
 #include "swap_debug.h"
 #include "da_protocol.h"
index 34ccb1e..3ecef63 100644 (file)
@@ -13,7 +13,11 @@ BuildRequires:  vconf-devel
 BuildRequires:  capi-system-info-devel
 BuildRequires:  capi-system-runtime-info-devel
 BuildRequires:  libwebsockets-devel
+%if "%{sec_product_feature_profile_wearable}" == "1"
+BuildRequires:  libjson-devel
+%else
 BuildRequires:  pkgconfig(json-c)
+%endif
 BuildRequires:  pkgconfig(ecore)
 %if "%{?tizen_profile_name}" == "mobile"
 BuildRequires:  pkgconfig(callmgr_client)
@@ -68,7 +72,9 @@ SWAP_BUILD_CMD+=" CALL_MNGR=y"
 %if "%{?tizen_profile_name}" == "tv"
 SWAP_BUILD_CMD+=" PROFILE_TV=y"
 %else
-%if "%{sec_product_feature_profile_wearable}" != "1"
+%if "%{sec_product_feature_profile_wearable}" == "1"
+SWAP_BUILD_CMD+=" OLD_JSON=y"
+%else
 SWAP_BUILD_CMD+=" WSP_SUPPORT=y"
 %endif
 %endif