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 e402577..b9f1239 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 8575c35..7c68071 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 b30486c..6e33b84 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 107cd74..18c264b 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 f3d34e4..56c8ed2 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 0572308..d712b6d 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}")