system-controller: build support for both ico and ivi-shell plugins in weston
authorJanos Kovacs <jankovac503@gmail.com>
Sat, 5 Jul 2014 17:26:25 +0000 (20:26 +0300)
committerKrisztian Litkey <krisztian.litkey@intel.com>
Thu, 8 Jan 2015 16:37:15 +0000 (18:37 +0200)
Change-Id: Ia54c4ee0f6df7ef5bf07c17abd525a9b8795605e

configure.ac
packaging/murphy.spec
src/Makefile.am
src/plugins/system-controller/wayland/scripting-input-manager.c
src/plugins/system-controller/wayland/scripting-window-manager.c

index 467a349..26810a3 100644 (file)
@@ -524,17 +524,28 @@ if test "$enable_systemctl" = "yes"; then
     AC_DEFINE([SYSTEMCTL_ENABLED], 1, [Enable system-controller support ?])
     PKG_CHECK_MODULES(WAYLAND_CLIENT, wayland-client)
     PKG_CHECK_MODULES(LIBXML2, libxml-2.0)
-    AC_CHECK_HEADER([ico-uxf-weston-plugin/ico_input_mgr-client-protocol.h])
+    AC_CHECK_HEADER(
+        [ico-uxf-weston-plugin/ico_input_mgr-client-protocol.h],
+        [weston_ico_plugins=yes], [weston_ico_plugins=false]
+    )
+    if test "$weston_ico_plugins" = "yes"; then
+        AC_MSG_NOTICE([System-controller uses ICO weston plugins.])
+    else
+        PKG_CHECK_MODULES(IVI_EXTENSION_PROTOCOL, ivi-extension-protocol)
+    fi
     PKG_CHECK_MODULES(AIL, ail)
-
 else
     AC_MSG_NOTICE([System-controller support is disabled.])
 fi
 
 AM_CONDITIONAL(SYSTEMCTL_ENABLED, [test "$enable_systemctl" = "yes"])
+AM_CONDITIONAL(WESTON_ICO_PLUGINS,[test "$weston_ico_plugins" = "yes"])
 AC_SUBST(SYSTEMCTL_ENABLED)
+AC_SUBST(WESTON_ICO_PLUGINS)
 AC_SUBST(WAYLAND_CLIENT_CFLAGS)
 AC_SUBST(WAYLAND_CLIENT_LIBS)
+AC_SUBST(IVI_EXTENSION_PROTOCOL_CFLAGS)
+AC_SUBST(IVI_EXTENSION_PROTOCOL_LIBS)
 AC_SUBST(LIBXML2_CFLAGS)
 AC_SUBST(LIBXML2_LIBS)
 AC_SUBST(AIL_CFLAGS)
index e0c999f..72869b5 100644 (file)
@@ -7,6 +7,8 @@
 # squashing the -core and -plugins-base packages into the base
 # murphy package.
 
+%define _with_icosyscon 1
+
 %{!?_with_debug:%{!?_without_debug:%define _without_debug 0}}
 %{!?_with_lua:%{!?_without_lua:%define _with_lua 1}}
 %{!?_with_pulse:%{!?_without_pulse:%define _with_pulse 1}}
@@ -19,6 +21,7 @@
 %{!?_with_websockets:%{!?_without_websockets:%define _with_websockets 1}}
 %{!?_with_smack:%{!?_without_smack:%define _with_smack 1}}
 %{!?_with_icosyscon:%{!?_without_icosyscon:%define _without_icosyscon 1}}
+%{!?_with_icoweston:%{!?_without_icoweston:%define _without_icoweston 1}}
 %{!?_with_sysmon:%{!?_without_sysmon:%define _with_sysmon 1}}
 %{!?_with_squashpkg:%{!?_without_squashpkg:%define _with_squashpkg 1}}
 
@@ -113,6 +116,8 @@ BuildRequires: pkgconfig(libsmack)
 %if %{?_with_icosyscon:1}%{!?_with_icosyscon:0}
 #%if %{_with_icosyscon} # gbs can't, so don't bother...
 BuildRequires: ico-uxf-weston-plugin-devel
+BuildRequires: weston-ivi-shell-devel
+BuildRequires: genivi-shell-devel
 BuildRequires: pkgconfig(ail)
 BuildRequires: pkgconfig(aul)
 BuildRequires: libxml2-devel
index 6593352..f42ddbc 100644 (file)
@@ -1506,6 +1506,7 @@ endif
 # system-controller
 if SYSTEMCTL_ENABLED
 SYSTEMCTL_DIR = plugins/system-controller
+
 SYSTEMCTL_PLUGIN_SOURCES =                                             \
        $(SYSTEMCTL_DIR)/plugin-system-controller.c                    \
        $(SYSTEMCTL_DIR)/resource-manager/resource-manager.c           \
@@ -1528,7 +1529,6 @@ SYSTEMCTL_PLUGIN_SOURCES =                                             \
        $(SYSTEMCTL_DIR)/wayland/animation.c                           \
        $(SYSTEMCTL_DIR)/wayland/input.c                               \
        $(SYSTEMCTL_DIR)/wayland/code.c                                \
-       $(SYSTEMCTL_DIR)/wayland/ico-window-manager.c                  \
        $(SYSTEMCTL_DIR)/wayland/scripting-wayland.c                   \
        $(SYSTEMCTL_DIR)/wayland/scripting-window-manager.c            \
        $(SYSTEMCTL_DIR)/wayland/scripting-animation.c                 \
@@ -1536,19 +1536,38 @@ SYSTEMCTL_PLUGIN_SOURCES =                                             \
        $(SYSTEMCTL_DIR)/wayland/scripting-output.c                    \
        $(SYSTEMCTL_DIR)/wayland/scripting-area.c                      \
        $(SYSTEMCTL_DIR)/wayland/scripting-layer.c                     \
-       $(SYSTEMCTL_DIR)/wayland/ico-input-manager.c                   \
        $(SYSTEMCTL_DIR)/wayland/scripting-input-manager.c             \
        $(SYSTEMCTL_DIR)/wayland/scripting-input.c                     \
        $(SYSTEMCTL_DIR)/wayland/scripting-code.c
 
+if WESTON_ICO_PLUGINS
+SYSTEMCTL_PLUGIN_SOURCES +=                                            \
+       $(SYSTEMCTL_DIR)/wayland/ico-window-manager.c                  \
+       $(SYSTEMCTL_DIR)/wayland/ico-input-manager.c
+
 SYSTEMCTL_PLUGIN_CFLAGS  = \
-                       $(WEBSOCKETS_CFLAGS) $(WAYLAND_CLIENT_CFLAGS) $(LIBXML2_CFLAGS) \
-                       $(AUL_CFLAGS) $(AIL_CFLAGS) \
-                       -Iico-uxf-weston-plugin \
-                        -I$(top_builddir)/src/$(SYSTEMCTL_DIR)
+       $(WEBSOCKETS_CFLAGS) $(WAYLAND_CLIENT_CFLAGS) $(LIBXML2_CFLAGS) \
+       $(AUL_CFLAGS) $(AIL_CFLAGS) \
+       -DWESTON_ICO_PLUGINS \
+       -Iico-uxf-weston-plugin \
+        -I$(top_builddir)/src/$(SYSTEMCTL_DIR)
 SYSTEMCTL_PLUGIN_LIBS    = \
-                       $(WEBSOCKET_LIBS) $(WAYLAND_CLIENT_LIBS) $(LIBXML2_LIBS) $(AUL_LIBS) \
-                       $(AIL_CFLAGS) -lico-uxf-weston-plugin $(TZCONFIG_LIBS)
+       $(WEBSOCKET_LIBS) $(WAYLAND_CLIENT_LIBS) $(LIBXML2_LIBS) $(AUL_LIBS) \
+       $(AIL_CFLAGS) -lico-uxf-weston-plugin $(TZCONFIG_LIBS)
+else
+SYSTEMCTL_PLUGIN_SOURCES +=                                            \
+       $(SYSTEMCTL_DIR)/wayland/glm-window-manager.c                  \
+       $(SYSTEMCTL_DIR)/wayland/glm-input-manager.c
+SYSTEMCTL_PLUGIN_CFLAGS  = \
+       $(WEBSOCKETS_CFLAGS) $(WAYLAND_CLIENT_CFLAGS) $(LIBXML2_CFLAGS) \
+       $(IVI_EXTENSION_PROTOCOL_CFLAGS) \
+       $(AUL_CFLAGS) $(AIL_CFLAGS) \
+        -I$(top_builddir)/src/$(SYSTEMCTL_DIR)
+SYSTEMCTL_PLUGIN_LIBS    = \
+       $(WEBSOCKET_LIBS) $(WAYLAND_CLIENT_LIBS) $(LIBXML2_LIBS) \
+       $(IVI_EXTENSION_PROTOCOL_CFLAGS) \
+       $(AUL_LIBS) $(AIL_CFLAGS)
+endif
 
 SYSTEMCTL_PLUGIN_LOADER  = linkedin-system-controller-loader.c
 
@@ -1617,7 +1636,7 @@ SYSMON_PLUGIN_SOURCES =                                           \
 
 
 SYSMON_PLUGIN_CFLAGS  = -I$(top_builddir)/src/plugins/system-monitor
-SYSTEMCTL_PLUGIN_LIBS = -lm
+SYSMON_PLUGIN_LIBS    = -lm
 
 SYSMON_PLUGIN_LOADER  = linkedin-system-monitor-loader.c
 
index ad430ed..6fca1dd 100644 (file)
@@ -289,7 +289,10 @@ static int input_manager_create(lua_State *L)
     inpmgr->input_update = input_update;
     inpmgr->code_update = code_update;
 
+#ifdef WESTON_ICO_PLUGINS
     mrp_ico_input_manager_register(wl);
+#else
+#endif
 
     mrp_wayland_register_input_manager_update_callback(wl,
                                                    manager_update_callback);
index d3e01f5..5ab26b8 100644 (file)
@@ -303,7 +303,10 @@ static int window_manager_create(lua_State *L)
     winmgr->window_update = window_update;
 
     mrp_wayland_output_register(wl);
+#ifdef WESTON_ICO_PLUGINS
     mrp_ico_window_manager_register(wl);
+#else
+#endif
 
     mrp_wayland_register_window_manager_update_callback(wl,
                                                    manager_update_callback);