0
0
mirror of https://github.com/vim/vim.git synced 2025-10-23 08:44:20 -04:00

patch 9.1.1561: configure: wayland test can be improved

Problem:  configure: wayland test can be improved
Solution: Define $WAYLAND_CFLAGS, simplify the wayland tests
          (Christoffer Aasted).

closes: #17772

Signed-off-by: Christoffer Aasted <chr.aasted@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christoffer Aasted
2025-07-17 21:11:06 +02:00
committed by Christian Brabandt
parent 861dade4e3
commit 138381bde0
5 changed files with 74 additions and 149 deletions

View File

@@ -2406,49 +2406,41 @@ CPPFLAGS=$cppflags_save
AC_MSG_CHECKING(--with-wayland argument)
AC_ARG_WITH(wayland,
[ --with-wayland Include support for the Wayland protocol.])
[ --with-wayland Include support for the Wayland protocol.],
[with_wayland=$withval],
[with_wayland=yes])
AC_MSG_RESULT([$with_wayland])
test -z "$with_wayland" && with_wayland=yes
if test "$with_wayland" = yes; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(if Wayland client header files can be found)
cppflags_save=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <wayland-client.h>], )],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no); no_wl=yes)
CPPFLAGS=$cppflags_save
if test "$no_wl" = yes; then
with_wayland=no
cflags_save=$CFLAGS
AC_MSG_CHECKING(for wayland)
if "$PKG_CONFIG" --exists 'wayland-client'; then
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_WAYLAND)
WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client`
CFLAGS="$CFLAGS $WAYLAND_CFLAGS"
WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client`
WAYLAND_SRC=" \
auto/wayland/wlr-data-control-unstable-v1.c \
auto/wayland/ext-data-control-v1.c \
auto/wayland/xdg-shell.c \
auto/wayland/primary-selection-unstable-v1.c \
wayland.c"
WAYLAND_OBJ=" \
objects/wlr-data-control-unstable-v1.o \
objects/ext-data-control-v1.o \
objects/xdg-shell.o \
objects/primary-selection-unstable-v1.o \
objects/wayland.o"
AC_SUBST(WAYLAND_CFLAGS)
AC_SUBST(WAYLAND_LIBS)
AC_SUBST(WAYLAND_SRC)
AC_SUBST(WAYLAND_OBJ)
else
AC_CHECK_LIB(wayland-client, wl_display_connect,[no_wl=no])
if test "$no_wl" = no; then
AC_DEFINE(HAVE_WAYLAND)
WAYLAND_LIBS="-lwayland-client";
AC_SUBST(WAYLAND_LIBS)
WAYLAND_SRC=" \
auto/wayland/wlr-data-control-unstable-v1.c \
auto/wayland/ext-data-control-v1.c \
auto/wayland/xdg-shell.c \
auto/wayland/primary-selection-unstable-v1.c \
wayland.c"
AC_SUBST(WAYLAND_SRC)
WAYLAND_OBJ=" \
objects/wlr-data-control-unstable-v1.o \
objects/ext-data-control-v1.o \
objects/xdg-shell.o \
objects/primary-selection-unstable-v1.o \
objects/wayland.o"
AC_SUBST(WAYLAND_OBJ)
else
with_wayland=no
fi
AC_MSG_RESULT(no)
with_wayland=no
fi
else
AC_MSG_RESULT(no)
CFLAGS=$cflags_save
fi
test -z "$with_x" && with_x=yes