2014-04-25 19:41 に Pekka Paalanen さんは書きました:
On Mon, 17 Mar 2014 15:31:09 +0900
Nobuhiko Tanibata <[email protected]> wrote:

Signed-off-by: Nobuhiko Tanibata <[email protected]>
---

Changes for v2:
 - squash Makefile to this patch

Changes for v3 and v4
  - nothing. Version number aligned to the first patch

 ivi-shell/Makefile.am   | 12 ++++++++
ivi-shell/weston.ini.in | 79 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
 create mode 100644 ivi-shell/weston.ini.in

diff --git a/ivi-shell/Makefile.am b/ivi-shell/Makefile.am
index afaa5e3..333abb7 100644
--- a/ivi-shell/Makefile.am
+++ b/ivi-shell/Makefile.am
@@ -67,3 +67,15 @@ CLEANFILES = $(BUILT_SOURCES)

 wayland_protocoldir = $(top_srcdir)/protocol
 include $(top_srcdir)/wayland-scanner.mk
+
+
+weston.ini : $(srcdir)/weston.ini.in
+       $(AM_V_GEN)$(SED) \
+               -e 's|@bindir[@]|$(bindir)|g' \
+               -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
+               -e 's|@libexecdir[@]|$(libexecdir)|g' \
+               $< > $@
+
+all-local : weston.ini
+
+CLEANFILES += weston.ini
diff --git a/ivi-shell/weston.ini.in b/ivi-shell/weston.ini.in
new file mode 100644
index 0000000..c9a6861
--- /dev/null
+++ b/ivi-shell/weston.ini.in
@@ -0,0 +1,79 @@
+[core]
+shell=ivi-shell.so
+modules=hmi-controller.so

Ooh, I see, this is how you get hmi-controller.so loaded.

Since both ivi-shell.so and hmi-controller.so both link to
libweston-layout.la at build time and both are dlopen'd at runtime, what
guarantees that both use the same instance of the global 'ivilayout'
defined in weston-layout.c?

My knowledge of runtime dynamic linking is a bit weak, but
personally I'd just avoid that global there. It is a bit much of magic.

AFAICS, you might be implicitly depending on the loading order of
ivi-shell.so first, hmi-controller.so next. Weston does do it that way,
but I'd hope the dependency was more obvious than both secretly using
the same global in a yet third library.

What happens, if hmi-controller.so is loaded, but shell is not
ivi-shell.so?

What happens, if ivi-shell.so is the shell, but hmi-controller.so is
not loaded?

Would it be better if ivi-shell.so loaded the whatever hmi-controller
plugin that is appropriate? weston_load_module() is exported, and that
would make the dependency explicit, allowing you to nicely exit weston
with an error if something doesn't load right.

Thank you for comments.
I modified module_init of ivi-shell to explicitly load hmi-controller.so which depends on ivi-layout.so. hmi-controller.so is specified by key: ivi-module in weston.ini to avoid your concerning.

BR,
Nobouhiko



After all, hmi-controller.so seems like a plugin to ivi-shell than
anything else.


Thanks,
pq
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to