]> git.meshlink.io Git - catta/commitdiff
* Patch by Ross Burton to allow disabling GTK (avahi-discover) with --enable-gtk...
authorTrent Lloyd <lathiat@bur.st>
Mon, 6 Jun 2005 11:20:39 +0000 (11:20 +0000)
committerTrent Lloyd <lathiat@bur.st>
Mon, 6 Jun 2005 11:20:39 +0000 (11:20 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@105 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-discover/Makefile.am
configure.ac

index 8a5da9ab78fbe6ba5dfa7267793b1381c79aa36d..5cbe62d34d3219b39c1f5eec4c7dc82fef902eea 100644 (file)
@@ -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
index 9861b45b55a412412e85a7c6fbc40cc4a32830aa..e17692da5aa77d9bc32ac7a9a56bdabd11633d6d 100644 (file)
@@ -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"