diff options
author | Pekka Paalanen <ppaalanen@gmail.com> | 2012-11-07 12:25:12 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-11-08 16:56:25 -0500 |
commit | a51e6fa322a24979ec04d7cdec08d3bdcf279b12 (patch) | |
tree | 74997da2dd640471778c8b48037a51f1a9e559e4 | |
parent | f97f811cf3a622f57b7ad098a33c844b9deae050 (diff) |
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 <ppaalanen@gmail.com>
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | man/Makefile.am | 1 | ||||
-rw-r--r-- | man/weston.man | 2 | ||||
-rw-r--r-- | src/compositor.c | 2 |
4 files changed, 13 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 7d403cf1..ecaea63f 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 71d2073b..4ff6bc7d 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 7ccfac8d..efb6d2b4 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 b869462a..f8b9b960 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"); |