[MPlayer-dev-eng] [PATCH] buildsystem changes for upcoming libavutil
Alexander Strasser
eclipse7 at gmx.net
Mon Aug 1 02:30:45 CEST 2005
Hi,
i plan to commit libavutil tommorrow which splits
some of the more generic parts of libavcodec into
a seperate lib.
Changes to the mplayer buildsystem will be needed
to support latest libavcodec then.
Attached is a patch to do that. Though it still
is not completely working, it has at least problems
with building mencoder.
I'll look into it again tonight. But i thought to
better post it here, maybe someone else spots the
problem faster than me.
Alex (beastd)
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.1034
diff -u -r1.1034 configure
--- configure 30 Jul 2005 01:07:27 -0000 1.1034
+++ configure 31 Jul 2005 23:29:13 -0000
@@ -5859,6 +5859,13 @@
_noinputmodules="live.com $_noinputmodules"
fi
+echocheck "FFmpeg libavutil (static)"
+if test -d libavutil ; then
+ _libavutil=yes
+else
+ _libavutil=no
+fi
+echores "$_libavutil"
echocheck "FFmpeg libavcodec (static)"
if test "$_libavcodec" = auto ; then
@@ -5866,8 +5873,26 @@
_libavcodec=no
if test -d libavcodec && test -f libavcodec/utils.c ; then
if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
- _libavcodec=yes
- echores "yes"
+ # check if libavutil is a required
+ cat > $TMPC << EOF
+#include "libavcodec/avcodec.h"
+#if LIBAVCODEC_BUILD >= 3211265
+#error We need libavutil!
+#endif
+int main(void) { return 0; }
+EOF
+
+ if cc_check -I. -I./libavutil; then
+ _libavutil_required="no"
+ else
+ _libavutil_required="yes"
+ fi
+ if test "$_libavutil_required" != "$_libavutil"; then
+ _libavcodec="no (libavutil availability does not fit libavcodec version)"
+ else
+ _libavcodec="yes"
+ fi
+ echores $_libavcodec
else
echores "no (old ffmpeg version, use CVS !)"
fi
@@ -5930,6 +5955,10 @@
_dep_libavcodec='libavcodec/libavcodec.a'
_def_ffpostprocess='#define FF_POSTPROCESS 1'
_codecmodules="libavcodec $_codecmodules"
+ if test "$_libavutil" = yes; then
+ _ld_libavutil='libavutil/libavutil.a'
+ _dep_libavutil='libavutil/libavutil.a'
+ fi
elif test "$_libavcodecso" = yes ; then
_def_libavcodec='#define USE_LIBAVCODEC 1'
_def_libavcodecso='#define USE_LIBAVCODEC_SO 1'
@@ -7003,8 +7032,9 @@
W32_LIB = $_ld_win32
DS_DEP = $_dep_dshow
DS_LIB = $_ld_dshow
-AV_DEP = $_dep_libavcodec $_dep_libavformat
-AV_LIB = $_ld_libavcodec $_ld_libavformat
+AV_DEP = $_dep_libavutil $_dep_libavcodec $_dep_libavformat
+AV_LIB = $_ld_libavformat $_ld_libavcodec $_ld_libavutil
+CONFIG_LIBAVUTIL = $_libavutil_required
CONFIG_LIBAVCODEC = $_libavcodec
CONFIG_LIBAVFORMAT = $_libavformat
ZORAN = $_zr
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.326
diff -u -r1.326 Makefile
--- Makefile 10 Jul 2005 17:14:09 -0000 1.326
+++ Makefile 31 Jul 2005 23:29:13 -0000
@@ -8,6 +8,14 @@
PRG_CFG = codec-cfg
+LIBAV_INC =
+ifeq ($(CONFIG_LIBAVUTIL),yes)
+LIBAV_INC += -I./libavutil
+endif
+ifeq ($(CONFIG_LIBAVCODEC),yes)
+LIBAV_INC += -I./libavcodec
+endif
+
# Do not strip the binaries at installation
ifeq ($(STRIPBINARIES),yes)
INSTALLSTRIP = -s
@@ -129,6 +137,7 @@
$(SDL_INC) \
$(X11_INC) \
$(XVID_INC) \
+ $(LIBAV_INC) \
#CFLAGS += -Wall
@@ -292,6 +301,9 @@
loader/dmo/libDMO_Filter.a:
$(MAKE) -C loader/dmo
+libavutil/libavutil.a:
+ $(MAKE) -C libavutil LIBPREF=lib LIBSUF=.a
+
libavcodec/libavcodec.a:
$(MAKE) -C libavcodec LIBPREF=lib LIBSUF=.a
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.302
diff -u -r1.302 mencoder.c
--- mencoder.c 23 Jul 2005 06:51:35 -0000 1.302
+++ mencoder.c 31 Jul 2005 23:29:13 -0000
@@ -80,7 +80,7 @@
#ifdef USE_LIBAVCODEC_SO
#include <ffmpeg/avcodec.h>
#else
-#include "libavcodec/avcodec.h"
+#include "avcodec.h"
#endif
#endif
Index: libmpcodecs/Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/Makefile,v
retrieving revision 1.146
diff -u -r1.146 Makefile
--- libmpcodecs/Makefile 10 Jul 2005 17:14:11 -0000 1.146
+++ libmpcodecs/Makefile 31 Jul 2005 23:29:13 -0000
@@ -183,8 +183,12 @@
ENCODER_SRCS += ae_lame.c
endif
+LIBAV_INC =
+ifeq ($(CONFIG_LIBAVUTIL),yes)
+LIBAV_INC += -I../libavutil
+endif
ifeq ($(CONFIG_LIBAVCODEC),yes)
-ENCODER_SRCS += ae_lavc.c
+LIBAV_INC += -I../libavcodec
endif
ifeq ($(MUSEPACK),yes)
@@ -201,7 +205,7 @@
SRCS2=$(ENCODER_SRCS)
OBJS2=$(SRCS2:.c=.o)
-CFLAGS = $(OPTFLAGS) -I. -Inative -I.. -I../libmpdemux -I../loader $(EXTRA_INC) $(X264_INC) -D_GNU_SOURCE
+CFLAGS = $(OPTFLAGS) -I. -Inative -I.. -I../libmpdemux -I../loader $(LIBAV_INC) $(EXTRA_INC) $(X264_INC) -D_GNU_SOURCE
.SUFFIXES: .c .o
Index: libmpcodecs/ad_ffmpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_ffmpeg.c,v
retrieving revision 1.19
diff -u -r1.19 ad_ffmpeg.c
--- libmpcodecs/ad_ffmpeg.c 6 Mar 2005 17:55:31 -0000 1.19
+++ libmpcodecs/ad_ffmpeg.c 31 Jul 2005 23:29:13 -0000
@@ -28,7 +28,7 @@
#ifdef USE_LIBAVCODEC_SO
#include <ffmpeg/avcodec.h>
#else
-#include "libavcodec/avcodec.h"
+#include "avcodec.h"
#endif
extern int avcodec_inited;
Index: libmpdemux/Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/Makefile,v
retrieving revision 1.95
diff -u -r1.95 Makefile
--- libmpdemux/Makefile 10 Jul 2005 17:14:12 -0000 1.95
+++ libmpdemux/Makefile 31 Jul 2005 23:29:13 -0000
@@ -106,8 +106,15 @@
muxer_rawaudio.c \
muxer_rawvideo.c \
+LIBAV_INC =
+ifeq ($(CONFIG_LIBAVUTIL),yes)
+LIBAV_INC += -I../libavutil
+endif
+ifeq ($(CONFIG_LIBAVCODEC),yes)
+LIBAV_INC += -I../libavcodec
+endif
ifeq ($(CONFIG_LIBAVFORMAT),yes)
-LIBAV_INC = -I../libavcodec -I../libavformat
+LIBAV_INC += -I../libavformat
SRCS += muxer_lavf.c
endif
More information about the MPlayer-dev-eng
mailing list