--- minidlna-1.2.1/configure.ac
+++ minidlna-1.2.1/configure.ac
@@ -477,6 +477,9 @@
         AM_CONDITIONAL(NEED_VORBIS, true),
         -logg)
 
+AC_ARG_ENABLE([avahi], AS_HELP_STRING([--enable-avahi], [Enable search for avahi]))
+
+AS_IF([test "x$enable_avahi" = "xyes"], [
 AC_CHECK_LIB(avahi-client, avahi_threaded_poll_new,
         [AC_CHECK_HEADERS([avahi-common/thread-watch.h],
          AM_CONDITIONAL(HAVE_AVAHI, true)
@@ -484,6 +487,7 @@
          AM_CONDITIONAL(HAVE_AVAHI, false))],
          AM_CONDITIONAL(HAVE_AVAHI, false),
         -lavahi-client -lavahi-common)
+], [AM_CONDITIONAL(HAVE_AVAHI, false)])
 
 ################################################################################################################
 ### Header checks
