]> git.sesse.net Git - vlc/blobdiff - configure.ac
vlc-wrapper needs -lsocket on Solaris (fixes: #3035)
[vlc] / configure.ac
index be402578cc2f97d846cf5998b2448677b3744b08..53a21b136303d8cbc9f88310d611512ce2f51c7c 100644 (file)
@@ -573,8 +573,8 @@ AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
 ])
 
-dnl Check for Linux system calls
-AC_CHECK_FUNCS([vmsplice])
+dnl Check for non-standard system calls
+AC_CHECK_FUNCS([vmsplice fstatfs])
 
 AH_BOTTOM([#include <vlc_fixups.h>])
 
@@ -596,12 +596,14 @@ if test ${ac_cv_langinfo_codeset} = yes; then
     [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
 fi
 
+SOCKET_LIBS=""
 AC_CHECK_FUNCS(connect,,[
   AC_CHECK_LIB(socket,connect,[
     VLC_ADD_LIBS([libvlccore cdda cddax],-lsocket)
-    LIBS_socket="-lsocket"
+    SOCKET_LIBS="-lsocket"
   ])
 ])
+AC_SUBST(SOCKET_LIBS)
 
 AC_CHECK_FUNCS(send,,[
   AC_CHECK_LIB(socket,send,[
@@ -652,7 +654,7 @@ dnl  -lnsl and -lsocket are needed on Solaris;
 dnl  we purposedly make the test fail on Windows
 LIBS_save="${LIBS}"
 AH_TEMPLATE(HAVE_GETADDRINFO, [Define to 1 if you have the `getaddrinfo' function.])
-AC_SEARCH_LIBS([getaddrinfo], [nsl], [AC_DEFINE(HAVE_GETADDRINFO)],, [${LIBS_socket}])
+AC_SEARCH_LIBS([getaddrinfo], [nsl], [AC_DEFINE(HAVE_GETADDRINFO)],, [${SOCKET_LIBS}])
 
 dnl NOTE: we assume getaddrinfo will be present if getnameinfo or gai_strerro
 dnl are
@@ -945,36 +947,10 @@ AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
 
 
 dnl Check for hal
-AC_ARG_ENABLE(hal,
-  [  --enable-hal            Linux HAL services discovery (default enabled)])
-
-if test "${enable_hal}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
-then
-  PKG_CHECK_MODULES(HAL, hal >= 0.5.0,
-    [
-      AC_DEFINE( HAVE_HAL, 1, [Define if you have the HAL library] )
-      VLC_ADD_PLUGIN([hal])
-      VLC_ADD_PLUGIN([probe_hal])
-      VLC_ADD_LIBS([libvlccore hal probe_hal],[$HAL_LIBS])
-      VLC_ADD_CFLAGS([libvlccore hal probe_hal],[$HAL_CFLAGS])],
-    [AC_MSG_WARN([libhal >= 0.5.0 was not found. Install libhal-dev ?])]
-  )
-fi
+PKG_ENABLE_MODULES_VLC([HAL], [], [hal >= 0.5.0], [Linux HAL services discovery], [auto])
 
 dnl Check for mtp
-AC_ARG_ENABLE(mtp,
-  [  --enable-mtp            MTP devices support (default enabled)])
-
-if test "${enable_mtp}" != "no" -a "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
-then
-  PKG_CHECK_MODULES(MTP, libmtp >= 0.3.0,
-    [ VLC_ADD_PLUGIN([mtp])
-      VLC_ADD_PLUGIN([access_mtp])
-      VLC_ADD_LIBS([mtp access_mtp],[$MTP_LIBS])
-      VLC_ADD_CFLAGS([mtp access_mtp],[$MTP_CFLAGS])],
-       [AC_MSG_WARN(MTP library not found)]
-  )
-fi
+PKG_ENABLE_MODULES_VLC([MTP], [], [libmtp >= 0.3.0],[MTP devices support],[auto])
 
 dnl Check for dbus
 AC_ARG_ENABLE(dbus,
@@ -1702,7 +1678,7 @@ AS_IF([test "${enable_sout}" != "no"], [
 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
 
 dnl Check for libshout
-PKG_ENABLE_MODULES_VLC([access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
+PKG_ENABLE_MODULES_VLC([shout], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
 
 dnl Lua modules
 AC_ARG_ENABLE(lua,
@@ -1757,7 +1733,7 @@ AM_CONDITIONAL(BUILD_HTTPD, [test "${enable_httpd}" != "no"])
 dnl
 dnl libproxy support
 dnl
-PKG_ENABLE_MODULES_VLC([LIBPROXY], [libproxy-1.0], [libproxy support], [auto])
+PKG_ENABLE_MODULES_VLC([LIBPROXY], [], [libproxy-1.0], [libproxy support], [auto])
 
 
 dnl
@@ -1793,20 +1769,7 @@ AS_IF([test "${enable_growl}" != "no"], [
 dnl
 dnl Libnotify notification plugin
 dnl
-
-AC_ARG_ENABLE(notify,
-  [  --enable-notify         libnotify notification plugin (default enabled)])
-AS_IF([test "${enable_notify}" != "no" -a "${SYS}" != "mingw32"], [
-    PKG_CHECK_MODULES(NOTIFY, libnotify,
-      [
-        VLC_ADD_PLUGIN([notify])
-        VLC_ADD_CFLAGS(notify, [$NOTIFY_CFLAGS])
-        VLC_ADD_LIBS(notify, [$NOTIFY_LIBS])
-      ],[
-    AS_IF([test "${enable_notify}" = "yes"],[
-        AC_MSG_WARN( libnotify not found) ])
-      ])
-  ])
+PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify], [libnotify notification], [auto])
 
 dnl
 dnl Audioscrobbler plugin
@@ -1970,66 +1933,11 @@ lternatively you can use --disable-live555 to disable the liveMedia plugin.])
 fi
 
 dnl
-dnl  special access module for dc1394 input
-dnl
-AC_ARG_ENABLE(dc1394,
-  [  --enable-dc1394         dc1394 access module (default disabled)])
-if test "${enable_dc1394}" = "yes"
-then
-  dnl
-  dnl Check for libraw1394
-  dnl
-  PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 2.0.1,
-    [
-      VLC_ADD_LIBS([dc1394],[`${PKG_CONFIG} --libs libraw1394`])
-      VLC_ADD_CPPFLAGS([dc1394],[`${PKG_CONFIG} --cflags libraw1394`])
-    ],
-    [AC_MSG_ERROR([Couldn't find libraw1394 >= 2.0.1, install libraw1394 development package])]
-  )
-
-  dnl
-  dnl Check for libdc1394
-  dnl
-  PKG_CHECK_MODULES(LIBDC1394, libdc1394-2 >= 2.0.2,
-    [
-      VLC_ADD_PLUGIN([dc1394])
-      VLC_ADD_LIBS([dc1394],[`${PKG_CONFIG} --libs libdc1394-2`])
-      VLC_ADD_CPPFLAGS([access_dv],[`${PKG_CONFIG} --cflags libdc1394-2`])
-    ],
-    [AC_MSG_ERROR([Couldn't find libdc1394 >= 2.0.2, install libdc1394 development package])]
-  )
-fi
-
-dnl
-dnl dv module: digital video module check for libraw1394
+dnl - special access module for dc1394 input
+dnl - dv module: digital video module check for libraw1394
 dnl
-AC_ARG_ENABLE(dv,
-[  --enable-dv             dv input module (default disabled)])
-if test "${enable_dv}" = "yes"
-then
-  dnl
-  dnl Check for libraw1394
-  dnl
-  PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 2.0.1,
-    [
-      VLC_ADD_LIBS([access_dv],[`${PKG_CONFIG} --libs libraw1394`])
-      VLC_ADD_CPPFLAGS([access_dv],[`${PKG_CONFIG} --cflags libraw1394`])
-    ],
-    [AC_MSG_ERROR([Couldn't find libraw1394 >= 2.0.1, install libraw1394 development package])]
-  )
-
-  dnl
-  dnl Check for libavc1394
-  dnl
-  PKG_CHECK_MODULES(LIBAVC1394, libavc1394 >= 0.5.3,
-    [
-      VLC_ADD_PLUGIN([access_dv])
-      VLC_ADD_LIBS([access_dv],[`${PKG_CONFIG} --libs libavc1394`])
-      VLC_ADD_CPPFLAGS([access_dv],[`${PKG_CONFIG} --cflags libavc1394`])
-    ],
-    [AC_MSG_ERROR([Couldn't find libavc1394 >= 0.5.1, install libavc1394 development package])]
-  )
-fi
+PKG_ENABLE_MODULES_VLC([dc1394], [], [libraw1394 >= 2.0.1 libdc1394 >= 1.0.0], [dc1394 access module], [auto])
+PKG_ENABLE_MODULES_VLC([dv], [access_dv], [libraw1394 >= 2.0.1 libavc1394 >= 0.5.3], [DV input module], [auto])
 
 dnl
 dnl dvdread module: check for libdvdread
@@ -2418,17 +2326,8 @@ fi
 dnl
 dnl  gnomeVFS access module
 dnl
-AC_ARG_ENABLE(gnomevfs,
-  [  --enable-gnomevfs       GnomeVFS access module (default disabled)])
-if test "${enable_gnomevfs}" = "yes"
-then
-  PKG_CHECK_MODULES(GNOMEVFS, gnome-vfs-2.0,
-    VLC_ADD_LIBS([access_gnomevfs],[$GNOMEVFS_LIBS])
-    VLC_ADD_CPPFLAGS([access_gnomevfs],[$GNOMEVFS_CPPFLAGS])
-    VLC_ADD_CFLAGS([access_gnomevfs],[$GNOMEVFS_CFLAGS])
-    VLC_ADD_PLUGIN([access_gnomevfs]),
-    AC_MSG_WARN([GnomeVFS support disabled because GnomeVFS development headers not found]))
-fi
+PKG_ENABLE_MODULES_VLC([GNOMEVFS], [access_gnomevfs], [gnome-vfs-2.0], [GnomeVFS access module], [auto])
+
 
 dnl Need to test libcdio and libvcdinfo for a number of things. Do it now.
 AC_ARG_ENABLE(libcdio,
@@ -2664,9 +2563,9 @@ AC_CHECK_FUNCS(inet_ntop,[
 dnl
 dnl  ogg demux plugin
 dnl
-PKG_ENABLE_MODULES_VLC([OGG], [ogg >= 1.0], [Ogg demux support], [auto])
+PKG_ENABLE_MODULES_VLC([OGG], [], [ogg >= 1.0], [Ogg demux support], [auto])
 if test "${enable_sout}" != "no"; then
-    PKG_ENABLE_MODULES_VLC([MUX_OGG], [ogg >= 1.0], [Ogg demux support], [auto])
+    PKG_ENABLE_MODULES_VLC([MUX_OGG], [], [ogg >= 1.0], [Ogg demux support], [auto])
 fi
 
 dnl
@@ -3262,100 +3161,22 @@ dnl
 AS_IF([test "x${enable_dts}" != "x"], [
   AC_MSG_ERROR([--enable-dts is obsolete. Please use libdca and --enable-dca.])
 ])
-AS_IF([test "x${with_dts_tree}" != "x"], [
-  AC_MSG_ERROR([--with-dts-tree is obsolete. Please use libdca and --with-dca-tree.])
-])
-
-AC_ARG_ENABLE(dca,
-  AS_HELP_STRING([--enable-dca],[DTS Coherent Acoustics support with libdca
-                 (default enabled)]))
-AS_IF([test "${enable_dca}" != "no"], [
-  AC_ARG_WITH(dca-tree,
-    [    --with-dca-tree=PATH  libdca tree for static linking],,
-    [with_dca_tree="no"])
-  AS_IF([test "${with_dca_tree}" != "no"], [
-    real_dca_tree="`cd ${with_dca_tree} 2>/dev/null && pwd`"
-    AS_IF([test -z "${real_dca_tree}"], [
-      dnl  The given directory can't be found
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([${with_dca_tree} directory doesn't exist])
-    ])
-    dnl  Use a custom libdca
-    AC_MSG_CHECKING(for libdca in ${real_dca_tree})
-    AS_IF([test -f "${real_dca_tree}/libdca/.libs/libdca.a"], [
-      AC_MSG_RESULT(yes)
-      VLC_ADD_LIBS([dtstofloat32],[${real_dca_tree}/libdca/.libs/libdca.a])
-      AS_IF([test -f "${real_dca_tree}/include/dca.h"], [
-        VLC_ADD_CPPFLAGS([dtstofloat32],[-I${real_dca_tree}/include])
-      ], [
-        VLC_ADD_CPPFLAGS([dtstofloat32],[-I${real_dca_tree}/../include])
-      ])
-    ], [
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([the specified tree doesn't have libdca/.libs/libdca.a])
-    ])
-  ], [
-    PKG_CHECK_MODULES([DCA], [libdca >= 0.0.5], [
-      VLC_ADD_PLUGIN([dtstofloat32])
-      VLC_ADD_CPPFLAGS([dtstofloat32], [${DCA_CFLAGS}])
-      VLC_ADD_LIBS([dtstofloat32], [${DCA_LIBS}])
-    ], [
-      AS_IF([test "x${enable_dca}" != "x"], [
-        AC_MSG_ERROR([${DCA_PKG_ERRORS}])
-      ])
-    ])
-  ])
-])
+PKG_ENABLE_MODULES_VLC([DCA], [dtstofloat32], [libdca >= 0.0.5], [DTS Coherent Acoustics support with libdca], [auto])
 
 dnl
 dnl  Flac plugin
 dnl
-PKG_ENABLE_MODULES_VLC([FLAC], [flac], [libflac decoder/encoder support], [auto])
+PKG_ENABLE_MODULES_VLC([FLAC], [], [flac], [libflac decoder/encoder support], [auto])
 
 dnl
 dnl  Libmpeg2 plugin
 dnl
-AC_ARG_ENABLE(libmpeg2,
-  [  --enable-libmpeg2       libmpeg2 decoder support (default enabled)])
-if test "${enable_libmpeg2}" != "no"
-then
-  AC_ARG_WITH(libmpeg2-tree,
-  [    --with-libmpeg2-tree=PATH libmpeg2 tree for static linking])
-  AS_IF([test -n "${with_libmpeg2_tree}"],[
-    AC_MSG_CHECKING(for libmpeg2.a in ${with_libmpeg2_tree})
-    real_libmpeg2_tree="`cd ${with_libmpeg2_tree} 2>/dev/null && pwd`"
-    if test -z "${real_libmpeg2_tree}"
-    then
-      dnl  The given directory can't be found
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot cd to ${with_libmpeg2_tree}])
-    fi
-    if test -f "${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a"
-    then
-      dnl  Use a custom libmpeg2
-      AC_MSG_RESULT(${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a)
-      VLC_ADD_PLUGIN([libmpeg2])
-      VLC_ADD_LIBS([libmpeg2],[-L${real_libmpeg2_tree}/libmpeg2/.libs -lmpeg2])
-      VLC_ADD_CFLAGS([libmpeg2],[-I${real_libmpeg2_tree}/include])
-    else
-      dnl  The given libmpeg2 wasn't built
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot find ${real_libmpeg2_tree}/libmpeg2/.libs/libmpeg2.a, make sure you compiled libmpeg2 in ${with_libmpeg2_tree}])
-    fi
-  ],[
-   PKG_CHECK_MODULES(LIBMPEG2,[libmpeg2 > 0.3.2],[
-          VLC_ADD_PLUGIN([libmpeg2])
-          VLC_ADD_LIBS([libmpeg2], $LIBMPEG2_LIBS)
-          VLC_ADD_CFLAGS([libmpeg2], $LIBMPEG2_CFLAGS)
-       ],
-      AC_MSG_WARN([Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ . Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.]))
-  ])
-fi
+PKG_ENABLE_MODULES_VLC([LIBMPEG2], [], [libmpeg2 > 0.3.2], [libmpeg2 decoder support], [auto])
 
 dnl
 dnl  Vorbis plugin
 dnl
-PKG_ENABLE_MODULES_VLC([VORBIS], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
+PKG_ENABLE_MODULES_VLC([VORBIS], [], [ogg vorbis >= 1.1 vorbisenc >= 1.1], [Vorbis decoder and encoder], [auto])
 
 dnl
 dnl  Tremor plugin
@@ -3373,7 +3194,7 @@ fi
 dnl
 dnl  Speex plugin
 dnl
-PKG_ENABLE_MODULES_VLC([SPEEX], [ogg speex >= 1.0.5], [Speex decoder support], [auto])
+PKG_ENABLE_MODULES_VLC([SPEEX], [], [ogg speex >= 1.0.5], [Speex decoder support], [auto])
 
 dnl
 dnl  tarkin decoder plugin
@@ -3406,17 +3227,17 @@ fi
 dnl
 dnl  theora decoder plugin
 dnl
-PKG_ENABLE_MODULES_VLC([THEORA], [ogg theora >= 1.0], [experimental theora codec], [auto])
+PKG_ENABLE_MODULES_VLC([THEORA], [], [ogg theora >= 1.0], [experimental theora codec], [auto])
 
 dnl
 dnl  dirac encoder plugin
 dnl
-PKG_ENABLE_MODULES_VLC([DIRAC], [dirac >= 0.10.0], [dirac encoder], [auto], [], [ -lstdc++])
+PKG_ENABLE_MODULES_VLC([DIRAC], [], [dirac >= 0.10.0], [dirac encoder], [auto])
 
 dnl
 dnl  schroedinger decoder plugin (for dirac format video)
 dnl
-PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [schroedinger-1.0 >= 1.0.6], [dirac decoder using schroedinger], [auto])
+PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.6], [dirac decoder using schroedinger], [auto])
 
 dnl
 dnl  PNG decoder module
@@ -3508,7 +3329,7 @@ fi
 dnl
 dnl libfluidsynth (MIDI synthetizer) plugin
 dnl
-PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [fluidsynth], [MIDI synthetiser with libfluidsynth], [auto])
+PKG_ENABLE_MODULES_VLC([FLUIDSYNTH], [], [fluidsynth], [MIDI synthetiser with libfluidsynth], [auto])
 
 dnl
 dnl Teletext Modules
@@ -3634,7 +3455,7 @@ AS_IF([test "${enable_kate}" != "no"], [
 dnl
 dnl  tiger decoder plugin
 dnl
-PKG_ENABLE_MODULES_VLC([TIGER], [tiger >= 0.3.1], [Tiger rendering library for Kate streams],[auto])
+PKG_ENABLE_MODULES_VLC([TIGER], [], [tiger >= 0.3.1], [Tiger rendering library for Kate streams],[auto])
 
 
 dnl
@@ -4024,24 +3845,12 @@ fi
 dnl
 dnl  libxml2 module
 dnl
-AC_ARG_ENABLE(libxml2,
-  [  --enable-libxml2        libxml2 support (default enabled)])
-AS_IF([test "${enable_libxml2}" != "no"], [
-  PKG_CHECK_MODULES([XML2], [libxml-2.0 >= 2.5], [
-    VLC_ADD_CPPFLAGS([xml],[${XML2_CFLAGS}])
-    VLC_ADD_LIBS([xml],[${XML2_LIBS}])
-    VLC_ADD_PLUGIN([xml])
-  ], [
-    AS_IF([test "x${enable_xml2}" != "x"], [
-      AC_MSG_ERROR([Could not find libxml version 2.5 or higher])
-    ])
-  ])
-])
+PKG_ENABLE_MODULES_VLC([libxml2], [], [libxml-2.0 >= 2.5], [libxml2 support],[auto])
 
 dnl
 dnl  SVG module
 dnl
-PKG_ENABLE_MODULES_VLC([SVG], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
+PKG_ENABLE_MODULES_VLC([SVG], [], [librsvg-2.0 >= 2.9.0], [SVG rendering library],[auto])
 
 dnl
 dnl Snapshot vout module (with cache)
@@ -4382,23 +4191,12 @@ fi
 dnl
 dnl  Pulseaudio module
 dnl
-PKG_ENABLE_MODULES_VLC([PULSE], [libpulse >= 0.9.11], [Pulseaudio support], [auto])
+PKG_ENABLE_MODULES_VLC([PULSE], [], [libpulse >= 0.9.11], [Pulseaudio support], [auto])
 
 dnl
 dnl  Portaudio module
 dnl
-AC_ARG_ENABLE(portaudio,
-  [  --enable-portaudio      Portaudio library support (default disabled)],
-  [if test "${enable_portaudio}" = "yes"
-   then
-     VLC_ADD_PLUGIN([portaudio])
-     VLC_ADD_CXXFLAGS([portaudio],[])
-     if test "${SYS}" = "mingw32"; then
-        VLC_ADD_LIBS([portaudio],[-lportaudio -lwinmm -lole32])
-     else
-        VLC_ADD_LIBS([portaudio],[-lportaudio])
-     fi
-   fi])
+PKG_ENABLE_MODULES_VLC([PORTAUDIO], [], [portaudio-2.0], [Portaudio library support], [auto])
 
 dnl
 dnl  ALSA module
@@ -4475,17 +4273,9 @@ fi
 dnl
 dnl  JACK modules
 dnl
-AC_ARG_ENABLE(jack,
- [  --enable-jack           JACK audio I/O modules (default disabled)],,
- [enable_jack="no"])
+PKG_ENABLE_MODULES_VLC([JACK], [jack], [jack], [JACK audio I/O modules],[auto])
+PKG_ENABLE_MODULES_VLC([JACK], [access_jack], [jack], [JACK audio I/O modules],[auto])
 
-AS_IF([test "${enable_jack}" != "no"], [
-  AC_CHECK_HEADERS(jack/jack.h, [
-    VLC_ADD_PLUGIN([access_jack])
-    VLC_ADD_PLUGIN([jack])
-    VLC_ADD_LIBS([access_jack jack],[-ljack])
-  ],[AC_MSG_ERROR([cannot find JACK headers])])
-])
 
 dnl
 dnl  CyberLink for C++ UPnP stack
@@ -4979,19 +4769,7 @@ fi
 dnl
 dnl libprojectM visualization plugin
 dnl
-AC_ARG_ENABLE(projectm,
-  [  --enable-projectm          projectM visualization plugin (default disabled)])
-AS_IF([test "${enable_projectm}" = "yes"],
-  [
-    PKG_CHECK_MODULES(PROJECTM, libprojectM,
-    [
-      VLC_ADD_PLUGIN([projectm])
-      VLC_ADD_CXXFLAGS([projectm],[$PROJECTM_CFLAGS])
-      VLC_ADD_LIBS([projectm],[$PROJECTM_LIBS])
-      ],[
-      AC_MSG_WARN(libprojectM library not found)
-    ])
-  ])
+PKG_ENABLE_MODULES_VLC([projectm], [], [libprojectM], [projectM visualization plugin], [auto])
 
 dnl
 dnl  AtmoLight (homebrew AmbiLight)
@@ -5010,18 +4788,7 @@ fi
 dnl
 dnl  Bonjour services discovery
 dnl
-AC_ARG_ENABLE(bonjour,
-  [  --enable-bonjour        Bonjour services discovery (default enabled)])
-AS_IF([test "${enable_bonjour}" != "no"], [
-  PKG_CHECK_MODULES(BONJOUR, avahi-client >= 0.6, [
-    AC_DEFINE(HAVE_AVAHI_CLIENT, 1, [Define to 1 if you have libavahi-client])
-    VLC_ADD_LIBS([bonjour access_output_http],[$BONJOUR_LIBS])
-    VLC_ADD_CFLAGS([bonjour access_output_http],[$BONJOUR_CFLAGS])
-    VLC_ADD_PLUGIN([bonjour])
-  ], [
-    AC_MSG_WARN(avahi-client library not found)
-  ])
-])
+PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services discovery], [auto])
 
 dnl
 dnl  Lirc plugin