fix build issue for x and wayland environment 83/34883/2 tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common accepted/tizen/common/20150204.154316 accepted/tizen/mobile/20150205.042009 accepted/tizen/tv/20150205.022559 accepted/tizen/wearable/20150205.062051 submit/tizen/20150204.052453
authorBoram Park <boram1288.park@samsung.com>
Wed, 4 Feb 2015 06:25:01 +0000 (15:25 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 4 Feb 2015 06:37:59 +0000 (15:37 +0900)
Change-Id: I8b64952a52a4b85566341ec40ed9dd0a2be80405

CMakeLists.txt
packaging/capi-system-media-key.spec
src/media_key.c

index 0085604168b483c9c475c6d921a833eac1afab6d..53e45d20dec9140e5bc61c8024082e42caaee142 100644 (file)
@@ -10,7 +10,15 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(INC_DIR include)
 INCLUDE_DIRECTORIES(${INC_DIR})
 
-SET(requires "dlog capi-base-common aul capi-ui-efl-util")
+SET(requires "dlog capi-base-common aul")
+IF (WITH_WAYLAND)
+       ADD_DEFINITIONS("-DWAYLAND")
+ENDIF (WITH_WAYLAND)
+IF (WITH_X11)
+       ADD_DEFINITIONS("-DX11")
+       SET(requires "${requires} utilX")
+ENDIF (WITH_X11)
+
 SET(pc_requires "capi-base-common")
 
 INCLUDE(FindPkgConfig)
index 7510e9a3f956f28f973662a8a1ba53546dd8e0d5..a0ed681352a1d6ef15ff4c177603b0f9f5e0dcb5 100644 (file)
@@ -1,3 +1,6 @@
+%bcond_with x
+%bcond_with wayland
+
 Name:       capi-system-media-key
 Summary:    A System Information library in SLP C API
 Version:    0.1.0
@@ -11,7 +14,10 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(aul)
-BuildRequires:  pkgconfig(capi-ui-efl-util)
+%if %{with x}
+BuildRequires:  pkgconfig(x11)
+BuildRequires:  pkgconfig(utilX)
+%endif
 
 %description
 %{summary}.
@@ -31,7 +37,13 @@ cp %{SOURCE1001} .
 
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+%if %{with wayland}
+-DWITH_WAYLAND=TRUE
+%endif
+%if %{with x}
+-DWITH_X11=TRUE
+%endif
 
 make %{?jobs:-j%jobs}
 
index bb1325ec529542a9c03ddf799939ddaf95159789..1afc54ebbc0eb23c81818182ef2b8a9fdc4376cc 100644 (file)
@@ -18,7 +18,9 @@
 #include <aul.h>
 #include <media_key.h>
 #include <string.h>
-#include <efl_util.h>
+#if X11
+#include <utilX.h>
+#endif
 #include <dlog.h>
 
 #ifdef LOG_TAG
@@ -47,6 +49,7 @@ static int __aul_key_handler(bundle *b, void *data)
        key_str = (char *)bundle_get_val(b, AUL_K_MULTI_KEY);
        event_str = (char *)bundle_get_val(b, AUL_K_MULTI_KEY_EVENT);
 
+#if X11
        if (!strcmp(key_str, KEY_PLAYCD)) {
                key = MEDIA_KEY_PLAY;
        } else if (!strcmp(key_str, KEY_STOPCD)) {
@@ -62,6 +65,9 @@ static int __aul_key_handler(bundle *b, void *data)
        } else if (!strcmp(key_str, KEY_FASTFORWARD)) {
                key = MEDIA_KEY_FASTFORWARD;
        }
+#else
+       LOGE("[%s] not implemented for wayland", __FUNCTION__);
+#endif
 
        if (!strcmp(event_str, AUL_V_KEY_RELEASED)) {
                event = MEDIA_KEY_STATUS_RELEASED;