From 5884bcde4a93723ab95324aee9ca18a16bbd846f Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Wed, 3 Aug 2011 12:12:31 +0300 Subject: [PATCH] configure: add helper for setting xserver directory With this the X server directory can become independent from the installation prefix set by autoconf. Signed-off-by: Tiago Vignatti --- compositor/Makefile.am | 2 +- compositor/xserver-launcher.c | 4 ++-- configure.ac | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/compositor/Makefile.am b/compositor/Makefile.am index f913a920..46a32208 100644 --- a/compositor/Makefile.am +++ b/compositor/Makefile.am @@ -3,7 +3,7 @@ bin_PROGRAMS = wayland-compositor AM_CPPFLAGS = \ -DDATADIR='"$(datadir)"' \ -DMODULEDIR='"$(moduledir)"' \ - -DBINDIR='"$(bindir)"' \ + -DXSERVER_PATH='"@XSERVER_PATH@"' \ $(COMPOSITOR_CFLAGS) wayland_compositor_LDFLAGS = -export-dynamic diff --git a/compositor/xserver-launcher.c b/compositor/xserver-launcher.c index f39c38de..a3c7fd8a 100644 --- a/compositor/xserver-launcher.c +++ b/compositor/xserver-launcher.c @@ -501,8 +501,8 @@ wlsc_xserver_handle_event(int listen_fd, uint32_t mask, void *data) snprintf(logfile, sizeof logfile, "/tmp/x-log-%d", mxs->display); - if (execl(BINDIR "/Xorg", - BINDIR "/Xorg", + if (execl(XSERVER_PATH, + XSERVER_PATH, display, "-wayland", "-rootless", diff --git a/configure.ac b/configure.ac index 228b527a..f19c4e7d 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,11 @@ AM_CONDITIONAL(ENABLE_XSERVER_LAUNCHER, test x$enable_xserver_launcher == xyes) if test x$enable_xserver_launcher == xyes; then PKG_CHECK_MODULES([XSERVER_LAUNCHER], xcb) AC_DEFINE([BUILD_XSERVER_LAUNCHER], [1], [Build the X server launcher]) + + AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH], + [Path to X server]), [XSERVER_PATH="$withval"], + [XSERVER_PATH="$bindir/Xorg"]) + AC_SUBST([XSERVER_PATH]) fi