From a51e6fa322a24979ec04d7cdec08d3bdcf279b12 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 7 Nov 2012 12:25:12 +0200 Subject: [PATCH] build: make default backend configurable Instead of hardcoding drm-backend.so as the default if environment presents neither Wayland nor X11, have a ./configure option to change it. It still defaults to drm-backend.so, if not given. Signed-off-by: Pekka Paalanen --- configure.ac | 10 ++++++++++ man/Makefile.am | 1 + man/weston.man | 2 +- src/compositor.c | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7d403cf..ecaea63 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,9 @@ AC_PROG_SED LT_PREREQ([2.2]) LT_INIT([disable-static]) +AC_ARG_VAR([WESTON_NATIVE_BACKEND], + [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@]) + PKG_PROG_PKG_CONFIG() AC_CHECK_FUNC([dlopen], [], @@ -255,6 +258,13 @@ fi AC_SUBST(GCC_CFLAGS) AC_SUBST(GCC_CXXFLAGS) +if test "x$WESTON_NATIVE_BACKEND" = "x"; then + WESTON_NATIVE_BACKEND="drm-backend.so" +fi +AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND]) +AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"], + [The default backend to load, if not wayland nor x11.]) + WAYLAND_SCANNER_RULES(['$(top_srcdir)/protocol']) AC_CONFIG_FILES([Makefile diff --git a/man/Makefile.am b/man/Makefile.am index 71d2073..4ff6bc7 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,6 +1,7 @@ man_MANS = weston.1 MAN_SUBSTS = \ + -e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g' \ -e 's|__weston_modules_dir__|$(pkglibdir)|g' \ -e 's|__version__|$(PACKAGE_VERSION)|g' diff --git a/man/weston.man b/man/weston.man index 7ccfac8..efb6d2b 100644 --- a/man/weston.man +++ b/man/weston.man @@ -98,7 +98,7 @@ Load instead of the default backend. The file is searched for in .IR "__weston_modules_dir__" , or you can pass an absolute path. The default backend is -.I drm-backend.so +.I __weston_native_backend__ unless the environment suggests otherwise, see .IR DISPLAY " and " WAYLAND_DISPLAY . .TP diff --git a/src/compositor.c b/src/compositor.c index b869462..f8b9b96 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -3151,7 +3151,7 @@ int main(int argc, char *argv[]) else if (getenv("DISPLAY")) backend = "x11-backend.so"; else - backend = "drm-backend.so"; + backend = WESTON_NATIVE_BACKEND; } config_file = config_file_path("weston.ini"); -- 2.7.4