From 1af18d2ab02c55802be831190b60092ee8c656f0 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 10 May 2010 22:07:25 +0200 Subject: [PATCH] configure: Allow to disable build of tools that require GTK. --- Makefile.am | 2 ++ configure.ac | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index f475e98..f773b73 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,9 +41,11 @@ AM_CPPFLAGS = \ sbin_PROGRAMS = \ systemd +if HAVE_GTK bin_PROGRAMS = \ systemctl \ systemadm +endif pkglibexec_PROGRAMS = \ systemd-logger \ diff --git a/configure.ac b/configure.ac index c37ab0c..a0f3aad 100644 --- a/configure.ac +++ b/configure.ac @@ -63,9 +63,19 @@ PKG_CHECK_MODULES(DBUSGLIB, [ dbus-glib-1 ]) AC_SUBST(DBUSGLIB_CFLAGS) AC_SUBST(DBUSGLIB_LIBS) -PKG_CHECK_MODULES(GTK, [ gtk+-2.0 ]) -AC_SUBST(GTK_CFLAGS) -AC_SUBST(GTK_LIBS) +have_gtk=no +AC_ARG_ENABLE(gtk, AS_HELP_STRING([--disable-gtk], [disable GTK tools])) +if test "x$enable_gtk" != "xno"; then + PKG_CHECK_MODULES(GTK, [ gtk+-2.0 ] + [AC_DEFINE(HAVE_GTK, 1, [Define if GTK is available]) have_gtk=yes], + have_gtk=no) + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + if test "x$have_gtk" = xno -a "x$enable_gtk" = xyes; then + AC_MSG_ERROR([gtk support requested but libraries not found]) + fi +fi +AM_CONDITIONAL(HAVE_GTK, [test "$have_gtk" = "yes"]) PKG_CHECK_MODULES( CGROUP, [ libcgroup >= 0.35 ], [], [AC_CHECK_HEADER( [libcgroup.h], [], [AC_MSG_ERROR([*** libcgroup.h not found])], ) -- 2.47.2