Remove ecore_x for pure Wayland build. 43/16943/7
authorRonan Le Martret <ronan@fridu.net>
Thu, 27 Feb 2014 09:21:15 +0000 (10:21 +0100)
committerRonan Le Martret <ronan@fridu.net>
Thu, 20 Mar 2014 13:34:41 +0000 (14:34 +0100)
Bug-Tizen: PTREL-723
Change-Id: I1bc8f66b216a3c4df3577f57cdbbfd9fee29d9ed
Signed-off-by: Ronan Le Martret <ronan@fridu.net>
client/CMakeLists.txt
client/net_nfc_client_system_handler.c
daemon/CMakeLists.txt
daemon/net_nfc_server_util.c
packaging/nfc-manager.spec
src/manager/CMakeLists.txt

index e4025778802a6ea073e22cfaf3b02f6850a77820..b9f12395c6dadb9a7d97f6257207bd16bff44ad1 100644 (file)
@@ -8,7 +8,14 @@ SET(NFC_CLIENT "nfc")
 
 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} CLIENT_SRCS)
 
-pkg_check_modules(client_pkgs REQUIRED security-server dlog ecore-x vconf libtzplatform-config)
+IF(X11_SUPPORT)
+       SET(WIN_PKG "ecore-x")
+ENDIF(X11_SUPPORT)
+IF(WAYLAND_SUPPORT)
+       SET(WIN_PKG "${WIN_PKG} ecore-wayland")
+ENDIF(WAYLAND_SUPPORT)
+pkg_check_modules(client_pkgs REQUIRED security-server dlog vconf libtzplatform-config ${WIN_PKG})
+
 
 FOREACH(flag ${client_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -19,6 +26,9 @@ ADD_LIBRARY(${NFC_CLIENT} SHARED ${CLIENT_SRCS})
 TARGET_LINK_LIBRARIES(${NFC_CLIENT} ${client_pkgs_LDFLAGS} nfc-common)
 SET_TARGET_PROPERTIES(${NFC_CLIENT} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
 
+IF(X11_SUPPORT)
+    ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF(X11_SUPPORT)
 FILE(GLOB CLIENT_HEADER include/*.h)
 SET(CLIENT_HEADER ${CLIENT_HEADER} ${CMAKE_SOURCE_DIR}/common/include/net_nfc_typedef.h)
 
index 8575c35d7701c9cae8aae16c2f13a1eb452ae1a6..7c68071562a00d0293c7b7119560cea1b2409dfe 100644 (file)
@@ -14,7 +14,6 @@
  * limitations under the License.
  */
 
-#include "Ecore_X.h"
 
 #include "net_nfc_typedef_internal.h"
 #include "net_nfc_debug_internal.h"
index b30486c842ce8467f39d6046d4831db380aa9d13..6e33b84ff3f7d84bdd23b0869a0d198d20319bd3 100755 (executable)
@@ -6,15 +6,21 @@ SET(NFC_DAEMON "nfc-manager-daemon")
 
 FILE(GLOB DAEMON_SRCS *.c)
 
+IF(X11_SUPPORT)
+       SET(WIN_PKG "ecore-x")
+ENDIF(X11_SUPPORT)
+IF(WAYLAND_SUPPORT)
+       SET(WIN_PKG "${WIN_PKG} ecore-wayland")
+ENDIF(WAYLAND_SUPPORT)
 IF(ARM_TARGET)
        pkg_check_modules(daemon_pkgs REQUIRED aul glib-2.0 gio-unix-2.0 security-server
                vconf dlog tapi appsvc libcurl bluetooth-api libssl svi capi-media-wav-player
-               pkgmgr pkgmgr-info capi-network-wifi ecore-x pmapi wifi-direct
-               libtzplatform-config)
+               pkgmgr pkgmgr-info capi-network-wifi pmapi wifi-direct
+               libtzplatform-config ${WIN_PKG})
 ELSE(ARM_TARGET)
-       pkg_check_modules(daemon_pkgs REQUIRED aul glib-2.0 gio-unix-2.0 security-server
-               vconf dlog tapi appsvc libcurl bluetooth-api libssl svi capi-media-wav-player
-               pkgmgr pkgmgr-info capi-network-wifi ecore-x pmapi libtzplatform-config)
+pkg_check_modules(daemon_pkgs REQUIRED aul glib-2.0 gio-unix-2.0 security-server
+       vconf dlog tapi appsvc libcurl bluetooth-api libssl svi capi-media-wav-player
+       pkgmgr pkgmgr-info capi-network-wifi pmapi libtzplatform-config ${WIN_PKG})
 ENDIF(ARM_TARGET)
 
 FOREACH(flag ${daemon_pkgs_CFLAGS})
index 107cd744359b73d32df63dab3ae47ce2fe33285f..18c264b6341e0187e74bf2ce007609b1a7e6b13d 100755 (executable)
@@ -35,7 +35,9 @@
 #include <wav_player.h>
 #include <appsvc.h>
 #include <aul.h>
+#ifdef HAVE_X11
 #include <Ecore_X.h>
+#endif
 
 #include "net_nfc_typedef.h"
 #include "net_nfc_typedef_internal.h"
@@ -939,6 +941,7 @@ int net_nfc_app_util_decode_base64(const char *buffer, uint32_t buf_len, uint8_t
 
 pid_t net_nfc_app_util_get_focus_app_pid()
 {
+#ifdef HAVE_X11
        pid_t pid;
        Ecore_X_Window focus;
 
@@ -948,6 +951,7 @@ pid_t net_nfc_app_util_get_focus_app_pid()
        if (ecore_x_netwm_pid_get(focus, &pid))
                return pid;
 
+#endif
        return -1;
 }
 
index f3d34e42764c0f25143efca2ea9ef87fa1e73feb..56c8ed2468ebb6e546d8f60296bd77f7d573a248 100755 (executable)
@@ -1,3 +1,6 @@
+%bcond_with wayland
+%bcond_with x
+
 Name:       nfc-manager
 Summary:    NFC framework manager
 Version:    0.1.6
@@ -25,7 +28,12 @@ BuildRequires:  pkgconfig(libssl)
 BuildRequires:  pkgconfig(libcurl)
 BuildRequires:  pkgconfig(pkgmgr)
 BuildRequires:  pkgconfig(pkgmgr-info)
+%if %{with x}
 BuildRequires:  pkgconfig(ecore-x)
+%endif
+%if %{with wayland}
+BuildRequires:  pkgconfig(ecore-wayland)
+%endif
 BuildRequires:  pkgconfig(pmapi)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  python
@@ -92,7 +100,17 @@ NFC manager Client library for developing NFC client applications.
 
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} %{?ARM_DEF}
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} %{?ARM_DEF} \
+%if %{with wayland}
+         -DWAYLAND_SUPPORT=On \
+%else
+         -DWAYLAND_SUPPORT=Off \
+%endif
+%if %{with x}
+         -DX11_SUPPORT=On
+%else
+         -DX11_SUPPORT=Off
+%endif
 
 
 %install
index 05723081250e401a42748afd464ee0c03b2c263d..d712b6dc053f3a38b2acd0b94247c522e863b0c0 100644 (file)
@@ -13,8 +13,14 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
        SET(CMAKE_BUILD_TYPE "Release")
 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 
+IF(X11_SUPPORT)
+       SET(WIN_PKG "ecore-x")
+ENDIF(X11_SUPPORT)
+IF(WAYLAND_SUPPORT)
+       SET(WIN_PKG "${WIN_PKG} ecore-wayland")
+ENDIF(WAYLAND_SUPPORT)
 INCLUDE(FindPkgConfig)
-pkg_check_modules(manager_pkges REQUIRED aul glib-2.0 gobject-2.0 security-server dbus-glib-1 vconf dlog tapi appsvc libcurl bluetooth-api heynoti smartcard-service smartcard-service-common libssl pmapi svi capi-media-wav-player pkgmgr pkgmgr-info ecore-x)
+pkg_check_modules(manager_pkges REQUIRED aul glib-2.0 gobject-2.0 security-server dbus-glib-1 vconf dlog tapi appsvc libcurl bluetooth-api heynoti smartcard-service smartcard-service-common libssl pmapi svi capi-media-wav-player pkgmgr pkgmgr-info ${WIN_PKG})
 
 FOREACH(flag ${manager_pkges_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")