Allow building Wayland platform without dbus (#726)

This commit supports configure-based builds without the dbus-dev package;
CMake-based builds are expected to be changed in further commit.
This commit is contained in:
ManoloFLTK 2023-04-30 18:41:49 +02:00
parent 7a8343e7e4
commit cdd1566cf9
4 changed files with 11 additions and 6 deletions

View File

@ -130,9 +130,9 @@ in section 2.1 of file README.Unix.txt :
- libpango1.0-dev
- libwayland-dev
- wayland-protocols
- libdbus-1-dev
- libxkbcommon-dev
- libxinerama-dev
- libdbus-1-dev <== recommended to query current cursor theme
- libglew-dev <== necessary to use OpenGL version 3 or above
- cmake <== if you plan to build with CMake
- cmake-qt-gui <== if you plan to use the GUI of CMake
@ -161,8 +161,8 @@ package groups listed in section 2.2 of file README.Unix.txt :
- cairo-devel
- libxkbcommon-devel
- pango-devel
- dbus-devel
- mesa-libGLU-devel
- dbus-devel <== recommended to query current cursor theme
- gtk3-devel <== highly recommended, gives windows a GTK-style titlebar
- glew-devel <== necessary to use OpenGL version 3 or above
- cmake <== if you plan to build with CMake

View File

@ -899,6 +899,7 @@ HLINKS=
OSX_ONLY=:
THREADS=
LIBDECORDIR=""
LIBDECORDBUS=""
AC_ARG_WITH([links], AS_HELP_STRING([--with-links], [make header links for common misspellings (default=no)]))
@ -1011,10 +1012,9 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [
AS_IF([$PKGCONFIG --exists 'wayland-protocols >= 1.15'],[],[missing="yes"])
AS_IF([$PKGCONFIG --exists wayland-cursor],[],[missing="yes"])
AS_IF([$PKGCONFIG --exists xkbcommon],[],[missing="yes"])
AS_IF([$PKGCONFIG --exists dbus-1],[],[missing="yes"])
AS_IF([$PKGCONFIG --exists pangocairo],[],[missing="yes"])
AS_IF([test x$missing = xyes], [
AC_MSG_WARN([These packages 'wayland-client>=1.18 wayland-protocols>=1.15 wayland-cursor xkbcommon dbus-1 pangocairo' are required to build FLTK for wayland.])
AC_MSG_WARN([These packages 'wayland-client>=1.18 wayland-protocols>=1.15 wayland-cursor xkbcommon pangocairo' are required to build FLTK for wayland.])
AC_MSG_WARN([At least one of them is missing.])
AS_IF([test x$enable_wayland = xyes], [
AC_MSG_ERROR([Building for Wayland is not possible. Aborting.])
@ -1044,11 +1044,14 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [
# CXXFLAGS="$CXXFLAGS -DUSE_SYSTEM_LIBDECOR=0"
LIBS="$LIBS $($PKGCONFIG --libs wayland-cursor) $($PKGCONFIG --libs wayland-client) $($PKGCONFIG --libs xkbcommon) $($PKGCONFIG --libs pangocairo) "
AS_IF([test x$enable_x11 != xno], [LIBS="$LIBS $($PKGCONFIG --libs x11)"] )
LIBS="$LIBS $($PKGCONFIG --libs dbus-1) -ldl"
LIBS="$LIBS -ldl"
# CXXFLAGS="$CXXFLAGS -I../libdecor/src"
DSOFLAGS="$LIBS $DSOFLAGS"
enable_pango=yes
LIBDECORDIR="libdecor/build"
AS_IF([$PKGCONFIG --exists dbus-1],
[LIBDECORDBUS="-DHAS_DBUS $($PKGCONFIG --cflags dbus-1)" LIBS="$LIBS $($PKGCONFIG --libs dbus-1)"]
)
LDFLAGS="$LDFLAGS -rdynamic"
AC_SUBST([UNAME])
UNAME="$(uname -s)"
@ -1407,6 +1410,7 @@ AC_SUBST([OSX_ONLY])
AC_SUBST([THREADS])
AC_SUBST([LIBDECORDIR])
AC_SUBST([LIBDECORDBUS])
AC_SUBST([INSTALL_DESKTOP])
AC_SUBST([UNINSTALL_DESKTOP])

View File

@ -51,7 +51,7 @@ os-compatibility.o : ../src/os-compatibility.c
$(CC) $(CFLAGS_DECOR) -c ../src/os-compatibility.c
cursor-settings.o : ../src/cursor-settings.c
$(CC) $(CFLAGS_DECOR) -c ../src/cursor-settings.c -DHAS_DBUS `pkg-config --cflags dbus-1`
$(CC) $(CFLAGS_DECOR) -c ../src/cursor-settings.c $(LIBDECORDBUS)
../../src/xdg-shell-protocol.c :
wayland-scanner private-code $(PROTOCOLS)/stable/xdg-shell/xdg-shell.xml \

View File

@ -108,6 +108,7 @@ IMAGELIBS = -L../lib @IMAGELIBS@
# optional extra build step for libdecor:
LIBDECORDIR = @LIBDECORDIR@
LIBDECORDBUS = @LIBDECORDBUS@
# image libraries to build...
IMAGEDIRS = @JPEG@ @ZLIB@ @PNG@