Make xserver-launcher a module

Kristian Høgsberg 13 years ago
parent 02e79dc935
commit d012e9dfa4
  1. 34
      src/Makefile.am
  2. 16
      src/compositor.c
  3. 2
      src/xserver-launcher.c

@ -11,8 +11,7 @@ AM_CPPFLAGS = \
weston_LDFLAGS = -export-dynamic weston_LDFLAGS = -export-dynamic
weston_CFLAGS = $(GCC_CFLAGS) weston_CFLAGS = $(GCC_CFLAGS)
weston_LDADD = \ weston_LDADD = \
$(COMPOSITOR_LIBS) $(DLOPEN_LIBS) $(XSERVER_LAUNCHER_LIBS) -lm \ $(COMPOSITOR_LIBS) $(DLOPEN_LIBS) -lm ../shared/libconfig-parser.la
../shared/libconfig-parser.la
weston_SOURCES = \ weston_SOURCES = \
compositor.c \ compositor.c \
@ -23,8 +22,7 @@ weston_SOURCES = \
util.c \ util.c \
matrix.c \ matrix.c \
matrix.h \ matrix.h \
weston-launch.h \ weston-launch.h
$(xserver_launcher_sources)
if BUILD_WESTON_LAUNCH if BUILD_WESTON_LAUNCH
weston_launch = weston-launch weston_launch = weston-launch
@ -50,19 +48,11 @@ endif
endif # BUILD_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 moduledir = @libdir@/weston
module_LTLIBRARIES = \ module_LTLIBRARIES = \
$(desktop_shell) \ $(desktop_shell) \
$(tablet_shell) \ $(tablet_shell) \
$(xserver_launcher) \
$(x11_backend) \ $(x11_backend) \
$(drm_backend) \ $(drm_backend) \
$(wayland_backend) \ $(wayland_backend) \
@ -80,7 +70,8 @@ endif
if ENABLE_DRM_COMPOSITOR if ENABLE_DRM_COMPOSITOR
drm_backend = drm-backend.la drm_backend = drm-backend.la
drm_backend_la_LDFLAGS = -module -avoid-version 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_CFLAGS = $(DRM_COMPOSITOR_CFLAGS) $(GCC_CFLAGS)
drm_backend_la_SOURCES = \ drm_backend_la_SOURCES = \
compositor-drm.c \ compositor-drm.c \
@ -110,6 +101,19 @@ openwfd_backend_la_CFLAGS = $(OPENWFD_COMPOSITOR_CFLAGS) $(GCC_CFLAGS)
openwfd_backend_la_SOURCES = compositor-openwfd.c tty.c evdev.c evdev.h openwfd_backend_la_SOURCES = compositor-openwfd.c tty.c evdev.c evdev.h
endif 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 if ENABLE_DESKTOP_SHELL
desktop_shell = desktop-shell.la desktop_shell = desktop-shell.la
desktop_shell_la_LDFLAGS = -module -avoid-version desktop_shell_la_LDFLAGS = -module -avoid-version

@ -2509,8 +2509,9 @@ int main(int argc, char *argv[])
struct wl_event_source *signals[4]; struct wl_event_source *signals[4];
struct wl_event_loop *loop; struct wl_event_loop *loop;
struct sigaction segv_action; struct sigaction segv_action;
void *shell_module, *backend_module; void *shell_module, *backend_module, *xserver_module;
int (*shell_init)(struct weston_compositor *ec); int (*shell_init)(struct weston_compositor *ec);
int (*xserver_init)(struct weston_compositor *ec);
struct weston_compositor struct weston_compositor
*(*backend_init)(struct wl_display *display, *(*backend_init)(struct wl_display *display,
int argc, char *argv[]); int argc, char *argv[]);
@ -2600,14 +2601,17 @@ int main(int argc, char *argv[])
ec->option_idle_time = idle_time; ec->option_idle_time = idle_time;
ec->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) if (shell_init(ec) < 0)
exit(EXIT_FAILURE); 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)) { if (wl_display_add_socket(display, socket_name)) {
fprintf(stderr, "failed to add socket: %m\n"); fprintf(stderr, "failed to add socket: %m\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);

@ -1701,7 +1701,7 @@ weston_xserver_destroy(struct wl_listener *l, void *data)
free(wxs); free(wxs);
} }
int WL_EXPORT int
weston_xserver_init(struct weston_compositor *compositor) weston_xserver_init(struct weston_compositor *compositor)
{ {
struct wl_display *display = compositor->wl_display; struct wl_display *display = compositor->wl_display;

Loading…
Cancel
Save