]> git.sesse.net Git - vlc/blobdiff - configure.ac
Simplify twolame detection
[vlc] / configure.ac
index e7e2f10c6a906bd9757de86b3eb9d6c8b41eb213..83a19ada49f3b368c75572cc6e87efc8a9e0d2ec 100644 (file)
@@ -943,12 +943,6 @@ fi
 AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ])
 
 
-dnl Check for hal
-PKG_ENABLE_MODULES_VLC([HAL], [], [hal >= 0.5.0], [Linux HAL services discovery], [auto])
-
-dnl Check for mtp
-PKG_ENABLE_MODULES_VLC([MTP], [], [libmtp >= 0.3.0],[MTP devices support],[auto])
-
 dnl Check for dbus
 AC_ARG_ENABLE(dbus,
   [  --enable-dbus           Linux D-BUS message bus system (default enabled)])
@@ -1674,9 +1668,6 @@ AS_IF([test "${enable_sout}" != "no"], [
 ])
 AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
 
-dnl Check for libshout
-PKG_ENABLE_MODULES_VLC([shout], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
-
 dnl Lua modules
 AC_ARG_ENABLE(lua,
   AS_HELP_STRING([--enable-lua],[lua playlist, metafetcher and interface
@@ -2565,6 +2556,11 @@ if test "${enable_sout}" != "no"; then
     PKG_ENABLE_MODULES_VLC([MUX_OGG], [], [ogg >= 1.0], [Ogg demux support], [auto])
 fi
 
+if test "${enable_sout}" != "no"; then
+dnl Check for libshout
+PKG_ENABLE_MODULES_VLC([shout], [access_output_shout], [shout >= 2.1], [libshout output plugin], [auto])
+fi
+
 dnl
 dnl  matroska demux plugin
 dnl
@@ -2976,48 +2972,7 @@ fi
 dnl
 dnl twolame encoder plugin
 dnl
-AC_ARG_ENABLE(twolame,
-[  --enable-twolame        twolame codec (default disabled)])
-if test "${enable_twolame}" = "yes"
-then
-  AC_ARG_WITH(twolame-tree,
-  [    --with-twolame-tree=PATH twolame tree for static linking])
-  if test -n "${with_twolame_tree}"
-  then
-    AC_MSG_CHECKING(for libtwolame.a in ${with_twolame_tree})
-    real_twolame_tree="`cd ${with_twolame_tree} 2>/dev/null && pwd`"
-    if test -z "${real_twolame_tree}"
-    then
-      dnl  The given directory can't be found
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot cd to ${with_twolame_tree}])
-    fi
-    if test -f "${real_twolame_tree}/libtwolame/.libs/libtwolame.a"
-    then
-      dnl  Use a custom twolame
-      AC_MSG_RESULT(${real_twolame_tree}/libtwolame/.libs/libtwolame.a)
-      VLC_ADD_PLUGIN([twolame])
-      VLC_ADD_LIBS([twolame],[${real_twolame_tree}/libtwolame/.libs/libtwolame.a])
-      VLC_ADD_CPPFLAGS([twolame],[-I${real_twolame_tree}/libtwolame -DLIBTWOLAME_STATIC])
-    else
-      dnl  The given libtwolame wasn't built
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot find ${real_twolame_tree}/libtwolame/.libs/libtwolame.a, make sure you compiled libtwolame in ${with_twolame_tree}])
-    fi
-  else
-    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_twolame} -DLIBTWOLAME_STATIC"
-    LDFLAGS="${LDFLAGS_save} ${LIBS_twolame}"
-    AC_CHECK_HEADERS(twolame.h, ,
-      [ AC_MSG_ERROR([Cannot find development header for libtwolame...]) ])
-    AC_CHECK_LIB(twolame, twolame_init, [
-      VLC_ADD_PLUGIN([twolame])
-      VLC_ADD_CPPFLAGS([twolame],[-DLIBTWOLAME_STATIC])
-      VLC_ADD_LIBS([twolame],[-ltwolame]) ],
-        [ AC_MSG_ERROR([Cannot find libtwolame library...]) ])
-    LDFLAGS="${LDFLAGS_save}"
-    CPPFLAGS="${CPPFLAGS_save}"
-  fi
-fi
+PKG_ENABLE_MODULES_VLC([twolame], [], [twolame], [MPEG Audio Layer 2 encoder], [auto], [], [], [ -DLIBTWOLAME_STATIC])
 
 dnl
 dnl  QuickTime plugin
@@ -4173,29 +4128,7 @@ PKG_ENABLE_MODULES_VLC([PORTAUDIO], [], [portaudio-2.0], [Portaudio library supp
 dnl
 dnl  ALSA module
 dnl
-AC_ARG_ENABLE(alsa,
-  [  --enable-alsa           ALSA sound support for Linux (default enabled)])
-if test "${enable_alsa}" != "no"
-then
-  AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
-  if test "${have_alsa}" = "true"
-  then
-    CFLAGS="${CFLAGS_save}"
-    AC_TRY_COMPILE([#define ALSA_PCM_NEW_HW_PARAMS_API
-                    #define ALSA_PCM_NEW_SW_PARAMS_API
-                    #include <alsa/asoundlib.h>],
-       [snd_pcm_hw_params_get_period_time(0,0,0);],
-        AC_DEFINE(HAVE_ALSA_NEW_API, 1, Define if ALSA is at least rc4))
-    VLC_ADD_PLUGIN([alsa])
-    VLC_ADD_LIBS([alsa],[-lasound -lm -ldl])
-    VLC_ADD_PLUGIN([access_alsa])
-    VLC_ADD_LIBS([access_alsa],[-lasound -lm -ldl])
-  else
-    if test "${enable_alsa}" = "yes"; then
-      AC_MSG_ERROR([Could not find ALSA development headers])
-    fi
-  fi
-fi
+PKG_ENABLE_MODULES_VLC([ALSA], [], [alsa >= 1.0.0], [Alsa sound support for linux], [auto])
 
 dnl
 dnl  win32 waveOut plugin
@@ -4324,25 +4257,7 @@ class testclass : public SearchResponseListener, public MediaPlayer
 dnl
 dnl UPnP Plugin (Intel SDK)
 dnl
-AC_ARG_ENABLE(upnp,
-  AS_HELP_STRING([--enable-upnp],[Intel UPnP SDK (default enabled)]))
-
-VLC_ADD_CXXFLAGS([upnp_intel], [ ])
-AS_IF([test "x${enable_upnp}" != "xno"], [
-  AC_CHECK_LIB([upnp], [UpnpInit], [has_upnp="yes"], [has_upnp="no"], [-lpthread])
-  AS_IF([test "x${enable_upnp}" != "x" && test "${has_upnp}" = "no"], [
-    AC_MSG_ERROR([cannot find Intel UPnP SDK (libupnp)])
-  ])
-  AS_IF([test "${has_upnp}" = "yes"], [
-    VLC_ADD_LIBS([upnp_intel], [-lupnp -lixml])
-  ])
-], [
-  has_upnp="no"
-])
-
-AS_IF([test "${has_upnp}" = "yes"], [
-  VLC_ADD_PLUGIN([upnp_intel])
-])
+PKG_ENABLE_MODULES_VLC([UPNP], [upnp_intel], [libupnp], [Intel UPnp SDK],[auto])
 
 
 dnl
@@ -4669,57 +4584,7 @@ fi
 dnl
 dnl  goom visualization plugin
 dnl
-AC_ARG_ENABLE(goom,
-[  --enable-goom           goom visualisation plugin (default disabled)])
-if test "${enable_goom}" = "yes"
-then
-  AC_ARG_WITH(goom-tree,
-    [    --with-goom-tree=PATH goom tree for static linking (required)])
-
-  dnl
-  dnl test for --with-goom-tree
-  dnl
-  if test "${with_goom_tree}" != "no" -a -n "${with_goom_tree}"; then
-    AC_MSG_CHECKING(for libgoom2.a in ${with_goom_tree})
-    real_goom_tree="`cd ${with_goom_tree} 2>/dev/null && pwd`"
-    if test -z "${real_goom_tree}"; then
-      dnl  The given directory can't be found
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot cd to ${with_goom_tree}])
-    fi
-    if test -f "${real_goom_tree}/src/.libs/libgoom2.a"; then
-      AC_MSG_RESULT(${real_goom_tree}/src/.libs/libgoom2.a)
-      VLC_ADD_PLUGIN([goom])
-      VLC_ADD_LIBS([goom],[-L${real_goom_tree}/src/.libs -lgoom2])
-      VLC_ADD_CPPFLAGS([goom],[-I${real_goom_tree}/src -DUSE_GOOM_TREE])
-    else
-      dnl  The given libgoom2 wasn't built, try to look for the old goom
-      AC_MSG_RESULT(no)
-      AC_MSG_CHECKING(for libgoom.a in ${with_goom_tree})
-      if test -f "${real_goom_tree}/libgoom.a"; then
-        AC_MSG_RESULT(${real_goom_tree}/libgoom.a)
-        VLC_ADD_PLUGIN([goom])
-        VLC_ADD_LIBS([goom],[-L${real_goom_tree} -lgoom])
-        VLC_ADD_CPPFLAGS([goom],[-I${real_goom_tree} -DUSE_GOOM_TREE -DOLD_GOOM])
-      else
-        dnl  The given libgoom wasn't built
-        AC_MSG_RESULT(no)
-        AC_MSG_ERROR([cannot find ${real_goom_tree}/src/.libs/libgoom2.a, make sure you compiled goom in ${with_goom_tree}])
-      fi
-    fi
-  else
-    AC_CHECK_HEADERS(goom/goom.h, [
-      LDFLAGS="${LDFLAGS_save} ${LIBS_goom}"
-      AC_CHECK_LIB(goom2, goom_init, [
-        VLC_ADD_PLUGIN([goom])
-        VLC_ADD_LIBS([goom],[-lgoom2])
-      ],[
-        AC_MSG_ERROR([Could not find goom on your system: you may get it from http://www.ios-software.com/.])
-      ])
-      LDFLAGS="${LDFLAGS_save}"
-    ])
-  fi
-fi
+PKG_ENABLE_MODULES_VLC([goom], [], [libgoom2], [goom visualization plugin], [auto])
 
 dnl
 dnl libprojectM visualization plugin
@@ -4742,23 +4607,20 @@ fi
 
 dnl
 dnl  Bonjour services discovery
-dnl
 PKG_ENABLE_MODULES_VLC([BONJOUR], [], [avahi-client >= 0.6], [Bonjour services discovery], [auto])
 
+dnl
+dnl  HAL services discovery
+PKG_ENABLE_MODULES_VLC([HAL], [], [hal >= 0.5.0], [Linux HAL services discovery], [auto])
+
+dnl
+dnl MTP devices services discovery
+PKG_ENABLE_MODULES_VLC([MTP], [], [libmtp >= 0.3.0],[MTP devices support],[auto])
+
 dnl
 dnl  Lirc plugin
 dnl
-AC_ARG_ENABLE(lirc,
-  [  --enable-lirc           lirc support (default disabled)])
-if test "${enable_lirc}" = "yes"
-then
-  AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
-  if test "${have_lirc}" = "true"
-  then
-    VLC_ADD_PLUGIN([lirc])
-    VLC_ADD_LIBS([lirc],[-llirc_client])
-  fi
-fi
+PKG_ENABLE_MODULES_VLC([lirc], [], [liblircclient0], [lirc support], [auto])
 
 
 AC_ARG_WITH(,[Misc options:])