weston_LDFLAGS = -export-dynamic
weston_CFLAGS = $(GCC_CFLAGS)
weston_LDADD = \
- $(COMPOSITOR_LIBS) $(DLOPEN_LIBS) $(XSERVER_LAUNCHER_LIBS) -lm \
- ../shared/libconfig-parser.la
+ $(COMPOSITOR_LIBS) $(DLOPEN_LIBS) -lm ../shared/libconfig-parser.la
weston_SOURCES = \
compositor.c \
util.c \
matrix.c \
matrix.h \
- weston-launch.h \
- $(xserver_launcher_sources)
+ weston-launch.h
if BUILD_WESTON_LAUNCH
weston_launch = weston-launch
endif # BUILD_WESTON_LAUNCH
-if ENABLE_XSERVER_LAUNCHER
-xserver_launcher_sources = \
- xserver-launcher.c \
- xserver-protocol.c \
- xserver-server-protocol.h \
- hash.c \
- hash.h
-endif
-
moduledir = @libdir@/weston
module_LTLIBRARIES = \
$(desktop_shell) \
- $(tablet_shell) \
+ $(tablet_shell) \
+ $(xserver_launcher) \
$(x11_backend) \
$(drm_backend) \
$(wayland_backend) \
if ENABLE_DRM_COMPOSITOR
drm_backend = drm-backend.la
drm_backend_la_LDFLAGS = -module -avoid-version
-drm_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(DRM_COMPOSITOR_LIBS)
+drm_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(DRM_COMPOSITOR_LIBS) \
+ ../shared/libconfig-parser.la
drm_backend_la_CFLAGS = $(DRM_COMPOSITOR_CFLAGS) $(GCC_CFLAGS)
drm_backend_la_SOURCES = \
compositor-drm.c \
openwfd_backend_la_SOURCES = compositor-openwfd.c tty.c evdev.c evdev.h
endif
+if ENABLE_XSERVER_LAUNCHER
+xserver_launcher = xserver-launcher.la
+xserver_launcher_la_LDFLAGS = -module -avoid-version
+xserver_launcher_la_LIBADD = $(XSERVER_LAUNCHER_LIBS)
+xserver_launcher_la_CFLAGS = $(GCC_CFLAGS)
+xserver_launcher_la_SOURCES = \
+ xserver-launcher.c \
+ xserver-protocol.c \
+ xserver-server-protocol.h \
+ hash.c \
+ hash.h
+endif
+
if ENABLE_DESKTOP_SHELL
desktop_shell = desktop-shell.la
desktop_shell_la_LDFLAGS = -module -avoid-version
struct wl_event_source *signals[4];
struct wl_event_loop *loop;
struct sigaction segv_action;
- void *shell_module, *backend_module;
+ void *shell_module, *backend_module, *xserver_module;
int (*shell_init)(struct weston_compositor *ec);
+ int (*xserver_init)(struct weston_compositor *ec);
struct weston_compositor
*(*backend_init)(struct wl_display *display,
int argc, char *argv[]);
ec->option_idle_time = idle_time;
ec->idle_time = idle_time;
-#ifdef BUILD_XSERVER_LAUNCHER
- if (xserver)
- weston_xserver_init(ec);
-#endif
-
if (shell_init(ec) < 0)
exit(EXIT_FAILURE);
+ xserver_init = NULL;
+ if (xserver)
+ xserver_init = load_module("xserver-launcher.so",
+ "weston_xserver_init",
+ &xserver_module);
+ if (xserver_init)
+ xserver_init(ec);
+
if (wl_display_add_socket(display, socket_name)) {
fprintf(stderr, "failed to add socket: %m\n");
exit(EXIT_FAILURE);