From edd1c89ea1814ae03d25879435c0d4f34eab9c67 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 27 Aug 2013 23:45:00 -0400 Subject: [PATCH] configure: Make wayland entirely optional --- configure.ac | 14 ++++++++++---- src/Makefile.am | 19 ++++++++++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 01b8c57c8..3cbcaf068 100644 --- a/configure.ac +++ b/configure.ac @@ -97,7 +97,16 @@ SHARED_PCS="gio-unix-2.0 >= $GIO_MIN_VERSION PKG_CHECK_MODULES(GNOME_SHELL, $SHARED_PCS) PKG_CHECK_MODULES(MUTTER, libmutter >= $MUTTER_MIN_VERSION) -PKG_CHECK_MODULES(MUTTER_WAYLAND, libmutter-wayland >= $MUTTER_MIN_VERSION) + +AC_MSG_CHECKING([for wayland support]) +PKG_CHECK_EXISTS([libmutter-wayland >= $MUTTER_MIN_VERSION], + [MUTTER_WAYLAND_TYPELIB_DIR=`$PKG_CONFIG --variable=typelibdir libmutter-wayland` + AC_SUBST(MUTTER_WAYLAND_TYPELIB_DIR) + have_mutter_wayland=yes], + [have_mutter_wayland=no]) + +AC_MSG_RESULT($have_mutter_wayland) +AM_CONDITIONAL(HAVE_MUTTER_WAYLAND, test $have_mutter_wayland != no) PKG_CHECK_MODULES(GNOME_SHELL_JS, gio-2.0 gjs-internals-1.0 >= $GJS_MIN_VERSION) PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.8 x11) @@ -138,9 +147,6 @@ AC_SUBST(MUTTER_GIR_DIR) MUTTER_TYPELIB_DIR=`$PKG_CONFIG --variable=typelibdir libmutter` AC_SUBST(MUTTER_TYPELIB_DIR) -MUTTER_WAYLAND_TYPELIB_DIR=`$PKG_CONFIG --variable=typelibdir libmutter-wayland` -AC_SUBST(MUTTER_WAYLAND_TYPELIB_DIR) - GJS_CONSOLE=`$PKG_CONFIG --variable=gjs_console gjs-1.0` AC_SUBST(GJS_CONSOLE) diff --git a/src/Makefile.am b/src/Makefile.am index 89072fb58..7af1f80ff 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,7 +33,11 @@ bin_SCRIPTS += gnome-shell-extension-tool gnome-shell-extension-prefs \ gnome-shell-perf-tool EXTRA_DIST += gnome-shell-extension-tool.in gnome-shell-extension-prefs.in \ gnome-shell-perf-tool.in -bin_PROGRAMS = gnome-shell gnome-shell-wayland +bin_PROGRAMS = gnome-shell + +if HAVE_MUTTER_WAYLAND +bin_PROGRAMS += gnome-shell-wayland +endif HAVE_MUTTER_WAYLAND generated_script_substitutions = \ -e "s|@bindir[@]|$(bindir)|g" \ @@ -75,9 +79,13 @@ gnome_shell_cflags = \ -DJSDIR=\"$(pkgdatadir)/js\" privlibdir = $(pkglibdir) -privlib_LTLIBRARIES = libgnome-shell-js.la libgnome-shell-menu.la libgnome-shell.la libgnome-shell-wayland.la +privlib_LTLIBRARIES = libgnome-shell-js.la libgnome-shell-menu.la libgnome-shell.la noinst_LTLIBRARIES += libgnome-shell-base.la +if HAVE_MUTTER_WAYLAND +privlib_LTLIBRARIES += libgnome-shell-wayland.la +endif HAVE_MUTTER_WAYLAND + shell_built_sources = \ shell-enum-types.h \ shell-enum-types.c @@ -166,7 +174,6 @@ libgnome_shell_sources = \ $(NULL) libgnome_shell_la_SOURCES = $(libgnome_shell_sources) -libgnome_shell_wayland_la_SOURCES = $(libgnome_shell_sources) libgnome_shell_la_gir_sources = \ $(filter-out %-private.h $(shell_private_sources), $(shell_public_headers_h) $(libgnome_shell_base_la_SOURCES) $(libgnome_shell_sources)) @@ -182,6 +189,9 @@ gnome_shell_CPPFLAGS = \ gnome_shell_LDADD = libgnome-shell.la libgnome-shell-js.la $(MUTTER_LIBS) $(BLUETOOTH_LIBS) gnome_shell_DEPENDENCIES = libgnome-shell.la +if HAVE_MUTTER_WAYLAND +libgnome_shell_wayland_la_SOURCES = $(libgnome_shell_sources) + gnome_shell_wayland_SOURCES = main.c gnome_shell_wayland_CPPFLAGS = \ -DHAVE_WAYLAND \ @@ -191,6 +201,7 @@ gnome_shell_wayland_CPPFLAGS = \ gnome_shell_wayland_LDADD = libgnome-shell-wayland.la libgnome-shell-js.la $(MUTTER_WAYLAND_LIBS) $(BLUETOOTH_LIBS) gnome_shell_wayland_DEPENDENCIES = libgnome-shell-wayland.la +endif HAVE_MUTTER_WAYLAND ######################################## @@ -292,9 +303,11 @@ libgnome_shell_la_LDFLAGS = $(libgnome_shell_ldflags) libgnome_shell_la_LIBADD = $(MUTTER_LIBS) libgnome-shell-base.la libgnome_shell_la_CPPFLAGS = $(MUTTER_CFLAGS) $(gnome_shell_cflags) +if HAVE_MUTTER_WAYLAND libgnome_shell_wayland_la_LDFLAGS = $(libgnome_shell_ldflags) libgnome_shell_wayland_la_LIBADD = $(MUTTER_WAYLAND_LIBS) libgnome-shell-base.la libgnome_shell_wayland_la_CPPFLAGS = $(MUTTER_WAYLAND_CFLAGS) -DHAVE_WAYLAND $(gnome_shell_cflags) +endif HAVE_MUTTER_WAYLAND ShellMenu-0.1.gir: libgnome-shell-menu.la ShellMenu_0_1_gir_INCLUDES = Gio-2.0