]> git.ipfire.org Git - people/ms/systemd.git/commitdiff
configure: Allow to disable build of tools that require GTK. optional-gtk
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 May 2010 20:07:25 +0000 (22:07 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 May 2010 20:07:25 +0000 (22:07 +0200)
Makefile.am
configure.ac

index f475e9849c8c1e9c9470fd2519e34696095d8fec..f773b739763f4a0089c1529c20c9f31c2c493212 100644 (file)
@@ -41,9 +41,11 @@ AM_CPPFLAGS = \
 sbin_PROGRAMS = \
        systemd
 
+if HAVE_GTK
 bin_PROGRAMS = \
        systemctl \
        systemadm
+endif
 
 pkglibexec_PROGRAMS = \
        systemd-logger \
index c37ab0c9177791923d9c33acb4ff657162fd749b..a0f3aadb43bb3cf2100da7e1146b4a1ead955809 100644 (file)
@@ -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])], )