add --enable-xwayland configure option: USE_XWAYLAND controls XWayland support independently from USE_X11_BACKEND; LINK_X11 conditional links libX11 when either is enabled; X11 libs no longer linked in pure Wayland mode

This commit is contained in:
Window Maker 2026-06-05 19:35:01 +02:00
parent 0453888f08
commit e98dd1f6f0
2 changed files with 24 additions and 5 deletions

View File

@ -748,6 +748,25 @@ AS_IF([test "x$enable_x11_backend" = "xyes"],
[unsupported="$unsupported X11Backend"])
AM_CONDITIONAL([USE_X11_BACKEND], [test "x$enable_x11_backend" = "xyes"])
m4_divert_push([INIT_PREPARE])dnl
AC_ARG_ENABLE([xwayland],
[AS_HELP_STRING([--enable-xwayland],
[enable XWayland support in the Wayland compositor @<:@default=same as enable-x11-backend@:>@])],
[AS_CASE(["$enableval"],
[yes|no], [],
[AC_MSG_ERROR([bad value $enableval for --enable-xwayland])])],
[enable_xwayland=$enable_x11_backend])
m4_divert_pop([INIT_PREPARE])dnl
AS_IF([test "x$enable_xwayland" = "xyes"],
[AC_DEFINE([USE_XWAYLAND], [1],
[Define to 1 to enable XWayland support in the Wayland compositor])
supported_core="$supported_core XWayland"],
[unsupported="$unsupported XWayland"])
AM_CONDITIONAL([USE_XWAYLAND], [test "x$enable_xwayland" = "xyes"])
AM_CONDITIONAL([LINK_X11], [test "x$enable_x11_backend" = "xyes" -o "x$enable_xwayland" = "xyes"])
dnl X11 support inside libwraster (wrlib)
dnl =====================================

View File

@ -240,7 +240,7 @@ AM_CPPFLAGS = $(DFLAGS) \
-I$(srcdir)/backend/wayland \
@HEADER_SEARCH_PATH@
if USE_X11_BACKEND
if USE_XWAYLAND
AM_CPPFLAGS += -DUSE_XWAYLAND
endif
@ -249,14 +249,14 @@ wmaker_LDADD = \
$(top_builddir)/WINGs/libWINGs.la\
$(top_builddir)/WINGs/libWUtil.la\
$(top_builddir)/wrlib/libwraster.la\
@XLFLAGS@ \
@LIBXRANDR@ \
@LIBXINERAMA@ \
@XLIBS@ \
@WLROOTS_LIBS@ \
@LIBM@ \
@INTLIBS@
if LINK_X11
wmaker_LDADD += @XLFLAGS@ @LIBXRANDR@ @LIBXINERAMA@ @XLIBS@
endif
######################################################################
# Create a 'silent rule' for our make check the same way automake does