From: Trent Lloyd Date: Mon, 6 Jun 2005 11:20:39 +0000 (+0000) Subject: * Patch by Ross Burton to allow disabling GTK (avahi-discover) with --enable-gtk... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=a355be1c7ab89eb0ace82ce703b37ff30e081492;p=catta * Patch by Ross Burton to allow disabling GTK (avahi-discover) with --enable-gtk=no (Fixes: #3476) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@105 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-discover/Makefile.am b/avahi-discover/Makefile.am index 8a5da9a..5cbe62d 100644 --- a/avahi-discover/Makefile.am +++ b/avahi-discover/Makefile.am @@ -25,6 +25,7 @@ AM_LDADD=$(GLIB20_LIBS) $(GTK20_LIBS) $(GLADE20_LIBS) # This cool debug trap works on i386/gcc only AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")' +if ENABLE_GTK bin_PROGRAMS = \ avahi-discover @@ -33,3 +34,4 @@ avahi_discover_SOURCES = \ avahi_discover_CFLAGS = $(AM_CFLAGS) avahi_discover_LDADD = $(AM_LDADD) ../avahi-core/libavahi-core.la ../avahi-common/libavahi-common.la +endif diff --git a/configure.ac b/configure.ac index 9861b45..e17692d 100644 --- a/configure.ac +++ b/configure.ac @@ -62,21 +62,33 @@ PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ]) AC_SUBST(GLIB20_CFLAGS) AC_SUBST(GLIB20_LIBS) -# Check for GTK 2.0 -PKG_CHECK_MODULES(GLIB20, [ gtk+-2.0 >= 2.4.0 ]) -AC_SUBST(GTK20_CFLAGS) -AC_SUBST(GTK20_LIBS) - -# Check for GLADE 2.0 -PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ]) -AC_SUBST(GLADE20_CFLAGS) -AC_SUBST(GLADE20_LIBS) - # Check for DBUS PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 0.23, dbus-glib-1 >= 0.23 ]) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) +AC_ARG_ENABLE(gtk, + AC_HELP_STRING([--enable-gtk],[use GTK+ (default=yes)]), + [case "${enableval}" in + yes) ENABLE_GTK=yes ;; + no) ENABLE_GTK=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-gtk) ;; + esac], + [ENABLE_GTK=yes]) dnl Default value + +if test "x$ENABLE_GTK" = "xyes"; then + # Check for GTK 2.0 + PKG_CHECK_MODULES(GTK20, [ gtk+-2.0 >= 2.4.0 ]) + AC_SUBST(GTK20_CFLAGS) + AC_SUBST(GTK20_LIBS) + + # Check for GLADE 2.0 + PKG_CHECK_MODULES(GLADE20, [ libglade-2.0 >= 2.4.0 ]) + AC_SUBST(GLADE20_CFLAGS) + AC_SUBST(GLADE20_LIBS) +fi +AM_CONDITIONAL(ENABLE_GTK, test "x$ENABLE_GTK" = "xyes") + # If using GCC specify some additional parameters if test "x$GCC" = "xyes" ; then CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"