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>
dev
Pekka Paalanen 12 years ago committed by Kristian Høgsberg
parent f97f811cf3
commit a51e6fa322
  1. 10
      configure.ac
  2. 1
      man/Makefile.am
  3. 2
      man/weston.man
  4. 2
      src/compositor.c

@ -20,6 +20,9 @@ AC_PROG_SED
LT_PREREQ([2.2]) LT_PREREQ([2.2])
LT_INIT([disable-static]) 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() PKG_PROG_PKG_CONFIG()
AC_CHECK_FUNC([dlopen], [], AC_CHECK_FUNC([dlopen], [],
@ -255,6 +258,13 @@ fi
AC_SUBST(GCC_CFLAGS) AC_SUBST(GCC_CFLAGS)
AC_SUBST(GCC_CXXFLAGS) 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']) WAYLAND_SCANNER_RULES(['$(top_srcdir)/protocol'])
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile

@ -1,6 +1,7 @@
man_MANS = weston.1 man_MANS = weston.1
MAN_SUBSTS = \ MAN_SUBSTS = \
-e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g' \
-e 's|__weston_modules_dir__|$(pkglibdir)|g' \ -e 's|__weston_modules_dir__|$(pkglibdir)|g' \
-e 's|__version__|$(PACKAGE_VERSION)|g' -e 's|__version__|$(PACKAGE_VERSION)|g'

@ -98,7 +98,7 @@ Load
instead of the default backend. The file is searched for in instead of the default backend. The file is searched for in
.IR "__weston_modules_dir__" , .IR "__weston_modules_dir__" ,
or you can pass an absolute path. The default backend is 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 unless the environment suggests otherwise, see
.IR DISPLAY " and " WAYLAND_DISPLAY . .IR DISPLAY " and " WAYLAND_DISPLAY .
.TP .TP

@ -3151,7 +3151,7 @@ int main(int argc, char *argv[])
else if (getenv("DISPLAY")) else if (getenv("DISPLAY"))
backend = "x11-backend.so"; backend = "x11-backend.so";
else else
backend = "drm-backend.so"; backend = WESTON_NATIVE_BACKEND;
} }
config_file = config_file_path("weston.ini"); config_file = config_file_path("weston.ini");

Loading…
Cancel
Save