[MPlayer-dev-eng] [PATCH] don't link mplayer with encoding libs and allow disabling some encoders in lavc

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Wed Nov 8 04:13:47 CET 2006


On Wednesday, 08 November 2006 at 04:12, Dominik 'Rathann' Mierzejewski wrote:
> Currently, if libmp3lame is detected, both mencoder and mplayer will get
> linked against it (due to libavcodec). Same goes for x264 and faac. Using
> --disable-encoder=mp3lame --disable-encoder=x264 --disable-encoder=faac
> is not enough. This patch disables linking mplayer with those if the above
> options are passed to configure. Tested and working as advertised. ;)

... this patch:

-- 
MPlayer developer and RPMs maintainer: http://rpm.greysector.net/mplayer/
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
--- MPlayer-20739/Makefile.r	2006-11-07 01:53:16.000000000 +0100
+++ MPlayer-20739/Makefile	2006-11-08 03:43:04.000000000 +0100
@@ -310,7 +310,7 @@
 
 ifeq ($(MENCODER),yes)
 LIBS_MENCODER = libmpcodecs/libmpencoders.a \
-                $(MP3LAME_LIB) \
+                $(EXTRA_LIB_MENCODER) \
                 $(COMMON_LIBS) \
 
 $(PRG_MENCODER): $(MENCODER_DEP)
--- MPlayer-20739/configure.r	2006-11-07 01:53:16.000000000 +0100
+++ MPlayer-20739/configure	2006-11-08 03:52:11.000000000 +0100
@@ -5801,13 +5801,19 @@
 fi
 if test "$_faac" = yes ; then
   _def_faac="#define HAVE_FAAC 1"
-  _def_lavc_faac="#define CONFIG_FAAC 1"
+  if echo $_libavencoders | grep -q faac ; then
+    _lavc_faac=yes
+    _def_lavc_faac="#define CONFIG_FAAC 1"
+  else
+    _lavc_faac=no
+    _def_lavc_faac="#undef CONFIG_FAAC"
+  fi
   _codecmodules="faac $_codecmodules"
 else
   _def_faac="#undef HAVE_FAAC"
   _nocodecmodules="faac $_nocodecmodules"
 fi
-echores "$_faac"
+echores "$_faac (in libavcodec: $_lavc_faac)"
 
 
 echocheck "FAAD2 (AAC) support"
@@ -6480,16 +6486,23 @@
 if test "$_x264" = yes ; then
   _x264=yes
   _def_x264='#define HAVE_X264 1'
-  _def_lavc_x264='#define CONFIG_X264 1'
   _codecmodules="x264 $_codecmodules"
+  if echo $_libavencoders | grep -q x264 ; then
+    _lavc_x264=yes
+    _def_lavc_x264='#define CONFIG_X264 1'
+  else
+    _lavc_x264=no
+    _def_lavc_x264='#undef CONFIG_X264'
+  fi
 else
   _x264=no
   _ld_x264=''
+  _lavc_x264=no
   _def_x264='#undef HAVE_X264'
   _def_lavc_x264='#undef CONFIG_X264'
   _nocodecmodules="x264 $_nocodecmodules"
 fi
-echores "$_x264"
+echores "$_x264 (in libavcodec: $_lavc_x264)"
 
 
 echocheck "nut"
@@ -7395,17 +7408,25 @@
   $_ld_static $_ld_zlib $_ld_termcap $_ld_lirc $_ld_lircc $_ld_win32 \
   $_ld_win32libs $_ld_lm $_ld_libC $_ld_fribidi $_ld_smb $_ld_gif \
   $_ld_libcdio $_ld_dvdread $_ld_dvdnav $_macosx_frameworks $_ld_cdparanoia \
-  $_ld_xvid $_ld_x264 $_ld_mp3lame $_ld_libdts $_ld_mad \
+  $_ld_xvid $_ld_libdts $_ld_mad \
   $_ld_vorbis $_ld_libdv $_ld_theora $_ld_faad $_ld_speex $_xmms_lib \
-  $_toolame_lib $_twolame_lib $_ld_faac $_ld_musepack $_ld_liblzo $_ld_png \
+  $_ld_musepack $_ld_liblzo $_ld_png \
   $_ld_jpeg $_ld_alsa $_ld_nut $_ld_arch $_ld_iconv $_ld_mlib
 VO_LIBS = $_ld_aa $_ld_sdl $_ld_ggi $_ld_svga $_ld_directfb $_ld_caca \
   $_ld_vesa $_ld_vidix_external $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm \
   $_ld_xinerama $_ld_x11 $_ld_sock
 AO_LIBS = $_ld_arts $_ld_esd $_ld_jack $_ld_openal $_ld_nas $_ld_sgiaudio \
   $_ld_polyp
-ENCORE_LIB = $_ld_mp3lame
-LAVC_MP3LAME = $_lavc_mp3lame
+EXTRA_LIB_MENCODER = $_ld_mp3lame $_ld_x264 $_toolame_lib $_twolame_lib $_ld_faac
+ifeq ($_lavc_faac,yes)
+EXTRA_LIB += $_ld_faac
+endif
+ifeq ($_lavc_mp3lame,yes)
+EXTRA_LIB += $_ld_mp3lame
+endif
+ifeq ($_lavc_x264,yes)
+EXTRA_LIB += $_ld_x264
+endif
 FREETYPE_LIB = $_ld_freetype
 FONTCONFIG_LIB = $_ld_fontconfig
 GTK_LIBS = $_ld_static $_ld_gtk $_ld_glib


More information about the MPlayer-dev-eng mailing list