Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Wayland in desktop manager #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ AC_ARG_ENABLE(debug,
[enable_debug="${enableval}"],
[enable_debug=no])

if test "$enable_debug" = "yes"; then
if test x"$enable_debug" = "xyes"; then
# turn on debug and disable optimization
CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
case "$CC" in
Expand Down Expand Up @@ -80,26 +80,46 @@ AC_ARG_WITH(gtk,
[ac_with_gtk="${withval}"],
[ac_with_gtk=2])

# Checks for libraries.
AC_ARG_ENABLE(wayland,
[AC_HELP_STRING([--enable-wayland],
[Enable Wayland support])],
[enable_wayland="${enableval}"],
[enable_wayland=no])

AC_ARG_ENABLE(x11,
[AC_HELP_STRING([--enable-x11],
[Enable X11 support])],
[enable_x11="${enableval}"],
[enable_x11=yes])

PKG_CHECK_MODULES(XLIB, "x11")
AC_SUBST(XLIB_CFLAGS)
AC_SUBST(XLIB_LIBS)
if test x"$enable_wayland" = "xno" -a x"&$enable_x11" = "xno"; then
AC_MSG_ERROR([At least one of X11 and Wayland needs to be enabled])
fi

gio_modules="gthread-2.0 gio-unix-2.0 >= 2.18.0"
PKG_CHECK_MODULES(GIO, [$gio_modules])
AC_SUBST(GIO_CFLAGS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think it's better to not separate GIO_FLAGS from the rest?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we were calling e.g. PKG_CHECK_MODULES twice for those Gio packages and we aren't using just GIO_CFLAGS in a Makefile.am, but always as part of FM_CFLAGS, so I thought it might as well just be part of the rest.

AC_SUBST(GIO_LIBS)
# Checks for libraries.
fm_modules="gthread-2.0 gio-unix-2.0 >= 2.18.0 glib-2.0 pango >= 1.20.0 libfm >= 1.0"

fm_modules="$gio_modules glib-2.0 pango >= 1.20.0 libfm >= 1.0"
case "$ac_with_gtk" in
3|3.*)
fm_modules="$fm_modules gtk+-3.0 libfm-gtk3 >= 1.0.1"
if test x"$enable_wayland" = "xyes"; then
fm_modules="$fm_modules gtk-layer-shell-0 >= 0.5.2"
AC_DEFINE(HAVE_WAYLAND, 1, [Have Wayland support])
fi
;;
*)
fm_modules="$fm_modules gtk+-2.0 libfm-gtk >= 1.0.1"
if test x"$enable_wayland" = "xyes"; then
AC_MSG_ERROR([Wayland only works with GTK3])
fi
;;
esac

if test x"$enable_x11" = "xyes"; then
fm_modules="$fm_modules x11"
AC_DEFINE(HAVE_X11, 1, [Have X11 support])
fi

PKG_CHECK_MODULES(FM, [$fm_modules])
AC_SUBST(FM_CFLAGS)
AC_SUBST(FM_LIBS)
Expand Down
2 changes: 0 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ EXTRA_DIST= \
include_HEADERS = pcmanfm-modules.h

pcmanfm_CFLAGS = \
$(XLIB_CFLAGS) \
$(FM_CFLAGS) \
$(G_CAST_CHECKS) \
-Wall \
-Werror-implicit-function-declaration \
$(NULL)

pcmanfm_LDADD = \
$(XLIB_LIBS) \
$(FM_LIBS) \
$(NULL)

Expand Down
Loading