[FIX] build for tizen_3.0 70/52170/3 accepted/tizen/mobile/20151125.125248 accepted/tizen/tv/20151125.125305 accepted/tizen/wearable/20151125.125318 submit/tizen/20151123.110430 submit/tizen/20151125.062050
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 19 Nov 2015 10:24:13 +0000 (13:24 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 23 Nov 2015 10:46:14 +0000 (02:46 -0800)
unsupported features:
- NSP
- WSP
- WSI

Change-Id: I148b715586d3af6ee79d6284363b8014a7ba7c1c
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
daemon/Makefile
daemon/da_protocol.c
daemon/daemon.c
daemon/wsi.c
packaging/swap-manager.spec
scripts/gen_preload_header.sh

index 9bd6b35..8ecdda1 100644 (file)
@@ -43,11 +43,6 @@ 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)
 FLAGS += -DCALL_MNGR
@@ -69,7 +64,6 @@ LDFLAGS := \
        -lsmack \
        -lecore \
        -lcapi-system-info \
-       -lwebsockets \
        -lparserelf
 
 # CALL_MNGR
@@ -77,13 +71,6 @@ ifeq ($(CALL_MNGR),y)
 LDFLAGS += -lcall-manager
 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 \
@@ -109,14 +96,12 @@ SRC_C := \
        smack.c \
        malloc_debug.c \
        target.c \
-       thread.c \
-       wsi.c
+       thread.c
 
 SRC_CPP := \
        cpp/features/feature.cpp \
        cpp/features/feature_manager.cpp \
        cpp/features/feature_manager_c.cpp \
-       cpp/features/feature_nsp.cpp \
 \
        cpp/inst/AppInst.cpp \
        cpp/inst/AppInstCont.cpp \
@@ -141,14 +126,7 @@ SCRIPTS := \
 all: debug
 
 GENERATED_DIR = include/generated
-GENERATED_WSI_PROF_H = include/generated/wsi_prof.h
-GENERATED_NSP_H = include/generated/nsp_data.h
-GENERATED_HEADERS := \
-       $(GENERATED_WSI_PROF_H) \
-       $(GENERATED_NSP_H)
-
-$(GENERATED_WSI_PROF_H): ../scripts/gen_wsi_prof.sh
-       sh $< > $@
+GENERATED_HEADERS :=
 
 
 #Preload
@@ -175,9 +153,27 @@ ifeq ($(WSP_SUPPORT),y)
 
 endif # WSP_SUPPORT
 
+# NSP
+ifeq ($(NSP_SUPPORT),y)
+  SRC_CPP += cpp/features/feature_nsp.cpp
+  GENERATED_NSP_H = include/generated/nsp_data.h
+  GENERATED_HEADERS += $(GENERATED_NSP_H)
+
+  $(GENERATED_NSP_H): ../scripts/gen_nsp_data.sh
+       sh $< > $@
+endif # NSP_SUPPORT
+
+# WSI
+ifeq ($(WSI_SUPPORT),y)
+  SRC_C += wsi.c
+  LDFLAGS += -lwebsockets -ljson-c
+  FLAGS += -DWSI_SUPPORT
+  GENERATED_WSI_PROF_H = include/generated/wsi_prof.h
+  GENERATED_HEADERS += $(GENERATED_WSI_PROF_H)
 
-$(GENERATED_NSP_H): ../scripts/gen_nsp_data.sh
+  $(GENERATED_WSI_PROF_H): ../scripts/gen_wsi_prof.sh
        sh $< > $@
+endif # WSI_SUPPORT
 
 $(GENERATED_DIR):
        mkdir -p $(GENERATED_DIR)
index ce78abc..3aca301 100644 (file)
@@ -660,9 +660,11 @@ enum ErrorCode stop_all_no_lock(void)
 
        // stop all only if it has not been called yet
        if (check_running_status(&prof_session)) {
+#ifdef WSI_SUPPORT
                if (is_feature_enabled(FL_WEB_PROFILING)) {
                        wsi_stop();
                }
+#endif /* WSI_SUPPORT */
 
                msg = gen_stop_msg();
                terminate_all();
index 959d63b..17d5e5b 100644 (file)
@@ -259,6 +259,7 @@ static int exec_app(const struct app_info_t *app_info)
                }
                break;
        case APP_TYPE_WEB:
+#ifdef WSI_SUPPORT
                if (wsi_set_profile(app_info)) {
                        LOGE("Cannot set web application profiling\n");
                        res = -1;
@@ -273,12 +274,14 @@ static int exec_app(const struct app_info_t *app_info)
                        LOGE("Cannot set web application smack rules\n");
                        res = -1;
                }
+#endif /* WSI_SUPPORT */
 
                if (exec_app_web(app_info->app_id)) {
                        LOGE("Cannot exec web app %s\n", app_info->app_id);
                        res = -1;
                }
 
+#ifdef WSI_SUPPORT
                if (!is_feature_enabled(FL_WEB_PROFILING)) {
                        if (wsi_enable_profiling(PROF_OFF)) {
                                LOGE("Cannot disable web application profiling\n");
@@ -288,6 +291,7 @@ static int exec_app(const struct app_info_t *app_info)
                }
 
                wsi_start();
+#endif /* WSI_SUPPORT */
 
                break;
        default:
index 2fc929e..f4473b2 100644 (file)
 #include <pthread.h>
 #include <libwebsockets.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 909c299..56237c4 100644 (file)
@@ -5,53 +5,38 @@ Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
 Source:    %{name}_%{version}.tar.gz
-BuildRequires:  smack-devel
-BuildRequires:  libattr-devel
-BuildRequires:  glib2-devel
-BuildRequires:  aul-devel
-BuildRequires:  vconf-devel
-BuildRequires:  capi-system-info-devel
-BuildRequires:  capi-system-runtime-info-devel
-BuildRequires:  libwebsockets-devel
-BuildRequires:  wrt
-%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:  call-manager
-BuildRequires:  libcall-manager-devel
-%endif
-BuildRequires:  swap-probe-devel
-BuildRequires:  swap-probe-elf
-%if "%{?tizen_profile_name}" == "tv"
-BuildRequires:  webkit2-efl-tv
-%if "%{TIZEN_PRODUCT_TV}" != "1"
-BuildRequires:  webkit2-efl-tv-debuginfo
-%endif
-%else
-BuildRequires:  webkit2-efl
-BuildRequires:  webkit2-efl-debuginfo
-%endif
-%if "%{sec_product_feature_profile_wearable}" == "1"
-BuildRequires:  launchpad-process-pool
-BuildRequires:  launchpad-loader
-%else
-BuildRequires:  launchpad
-%endif
-BuildRequires:  app-core-efl
-%if "%{TIZEN_PRODUCT_TV}" != "1"
-BuildRequires:  app-core-debuginfo
-%endif
-%if "%_project" != "Kirana_SWA_OPEN:Build" && "%_project" != "Kirana_SWA_OPEN:Daily"
-Requires:  swap-modules
-%endif
-Requires:  swap-probe
-Requires:  swap-probe-elf
-Requires:  sdbd
-Requires:  libwebsockets
+
+
+# setup config
+%define NSP_SUPPORT 0
+%define WSP_SUPPORT 0
+%define WSI_SUPPORT 0
+
+
+ExcludeArch: aarch64 x86_64
+BuildRequires: smack-devel
+BuildRequires: libattr-devel
+BuildRequires: glib2-devel
+BuildRequires: aul-devel
+BuildRequires: vconf-devel
+BuildRequires: capi-system-info-devel
+BuildRequires: capi-system-runtime-info-devel
+BuildRequires: pkgconfig(json-c)
+BuildRequires: pkgconfig(ecore)
+BuildRequires: launchpad
+BuildRequires: app-core-efl
+BuildRequires: swap-probe-devel
+BuildRequires: swap-probe-elf
+
+
+# FIXME: add WSP_SUPPORT wrt webkit2-efl and webkit2-efl-debuginfo
+# FIXME: add NSP_SUPPORT app-core-efl-debuginfo
+# FIXME: add WSI_SUPPORT libwebsockets-devel
+
+Requires: swap-modules
+Requires: swap-probe
+Requires: swap-probe-elf
+Requires: sdbd
 
 %description
 SWAP manager is a part of data collection back-end for DA.
@@ -68,22 +53,19 @@ echo "__tizen_product_2_4_wearable__="%{sec_product_feature_profile_wearable} >>
 popd
 cd daemon
 
-%if "%{?tizen_profile_name}" == "mobile"
-SWAP_BUILD_CMD+=" CALL_MNGR=y"
+%if %{NSP_SUPPORT}
+  export NSP_SUPPORT=y
 %endif
 
-%if "%{?tizen_profile_name}" == "tv"
-SWAP_BUILD_CMD+=" PROFILE_TV=y"
-%else
-%if "%{sec_product_feature_profile_wearable}" == "1"
-SWAP_BUILD_CMD+=" OLD_JSON=y"
-%else
-SWAP_BUILD_CMD+=" WSP_SUPPORT=y"
+%if %{WSP_SUPPORT}
+  export WSP_SUPPORT=y
 %endif
+
+%if %{WSI_SUPPORT}
+  export WSI_SUPPORT=y
 %endif
 
-SWAP_BUILD_CMD+=" make"
-eval ${SWAP_BUILD_CMD}
+make
 
 %install
 rm -rf ${RPM_BUILD_ROOT}
index c74178c..8c667e3 100755 (executable)
@@ -5,7 +5,7 @@ preload_open_function="dlopen"
 handlers_lib="/usr/lib/da_probe_tizen.so"
 linker_path="/lib/"
 linker_sym="_r_debug"
-test_bin="/usr/bin/WebProcess"
+test_bin="/bin/su"
 
 output=$1