[vlc-devel] commit: Simplify twolame detection (Jean-Baptiste Kempf )

git version control git at videolan.org
Sat Aug 8 13:10:15 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Aug  8 11:37:56 2009 +0200| [0a8af27eb9df68f205e9f2e922c1d9bf762fc3c8] | committer: Jean-Baptiste Kempf 

Simplify twolame detection

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0a8af27eb9df68f205e9f2e922c1d9bf762fc3c8
---

 configure.ac   |   43 +------------------------------------------
 m4/with_pkg.m4 |    3 ++-
 2 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7801813..83a19ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2972,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
diff --git a/m4/with_pkg.m4 b/m4/with_pkg.m4
index 705cf0c..16a3165 100644
--- a/m4/with_pkg.m4
+++ b/m4/with_pkg.m4
@@ -79,7 +79,7 @@ dnl PKG_ENABLE_MODULES_VLC(VARIABLE-PREFIX,
 dnl                         VLC_MODULE_NAME  dnl (if empty, same as VARIABLE-PREFIX)
 dnl                         PKG MODULES,
 dnl                         [DESCRIPTION], [DEFAULT],
-dnl                         [EXTRA_CFLAGS], [EXTRA_LIBS])
+dnl                         [EXTRA_CFLAGS], [EXTRA_LIBS], [EXTRA_CPPFLAGS]
 AC_DEFUN([PKG_ENABLE_MODULES_VLC],
 [
 m4_pushdef([module_name], AS_TR_SH(m4_default(m4_tolower([$2]),m4_tolower([$1]))))
@@ -87,6 +87,7 @@ m4_pushdef([enable_arg], m4_tolower([$1]))
 
 PKG_WITH_MODULES([$1],[$3],
     VLC_ADD_PLUGIN(module_name)
+    m4_ifnblank( [$8],  VLC_ADD_CPPFLAGS(module_name, [$8]))
     VLC_ADD_CFLAGS(module_name,[$$1_CFLAGS] [$6])
     VLC_ADD_LIBS(module_name,[$$1_LIBS] [$7]),
     AS_IF([test x"$AS_TR_SH([enable_]enable_arg)" = "xyes"],




More information about the vlc-devel mailing list