From 5c2583a0ee9a6e824bb1633748c1899bc99a695c Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sun, 27 Apr 2008 14:54:57 +0300 Subject: Make MPlayer build with a complete FFmpeg checkout in ffmpeg/ Instead of separate checkouts of the FFmpeg libavutil/, libavcodec/, libavformat/, libpostproc/ subdirectories make MPlayer build with a complete checkout of FFmpeg under ffmpeg/. configure now creates config.mak and config.h at both the top level and in ffmpeg/. The config.h files are identical. The config.mak for FFmpeg has different include paths. The top-level common.mak and subdir.mak are now used by libswscale only; the directories under ffmpeg/ use the versions in ffmpeg/. --- .gitignore | 1 + Makefile | 20 ++++++++++---------- common.mak | 2 +- configure | 33 +++++++++++++++++++-------------- dvdread/bswap.h | 2 +- 5 files changed, 32 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 69977f11c6..411891e554 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.d .depend +/ffmpeg /config.h /config.mak /configure.log diff --git a/Makefile b/Makefile index d6990561d6..2ea261ee54 100644 --- a/Makefile +++ b/Makefile @@ -588,10 +588,10 @@ SRCS_MENCODER-$(XVID4) += libmpcodecs/ve_xvid4.c COMMON_LIBS = libswscale/libswscale.a \ -COMMON_LIBS-$(LIBAVFORMAT_A) += libavformat/libavformat.a -COMMON_LIBS-$(LIBAVCODEC_A) += libavcodec/libavcodec.a -COMMON_LIBS-$(LIBAVUTIL_A) += libavutil/libavutil.a -COMMON_LIBS-$(LIBPOSTPROC_A) += libpostproc/libpostproc.a +COMMON_LIBS-$(LIBAVFORMAT_A) += ffmpeg/libavformat/libavformat.a +COMMON_LIBS-$(LIBAVCODEC_A) += ffmpeg/libavcodec/libavcodec.a +COMMON_LIBS-$(LIBAVUTIL_A) += ffmpeg/libavutil/libavutil.a +COMMON_LIBS-$(LIBPOSTPROC_A) += ffmpeg/libpostproc/libpostproc.a COMMON_LIBS-$(WIN32DLL) += loader/loader.a ALL_PRG-$(MPLAYER) += mplayer$(EXESUF) @@ -610,10 +610,10 @@ INSTALL_TARGETS-$(MENCODER) += install-mencoder install-mplayer-man INSTALL_TARGETS-$(GUI) += install-gui INSTALL_TARGETS += $(INSTALL_TARGETS-yes) -PARTS = libavcodec \ - libavformat \ - libavutil \ - libpostproc \ +PARTS = ffmpeg/libavcodec \ + ffmpeg/libavformat \ + ffmpeg/libavutil \ + ffmpeg/libpostproc \ libswscale \ ifeq ($(WIN32DLL),yes) @@ -681,7 +681,7 @@ mencoder$(EXESUF): $(MENCODER_DEPS) $(CC) -o $@ $^ $(LDFLAGS_MENCODER) codec-cfg$(EXESUF): codec-cfg.c codec-cfg.h help_mp.h - $(HOST_CC) -O -I. -DCODECS2HTML $< -o $@ + $(HOST_CC) -O -I. -Iffmpeg -DCODECS2HTML $< -o $@ codecs.conf.h: codec-cfg$(EXESUF) etc/codecs.conf ./codec-cfg$(EXESUF) ./etc/codecs.conf > $@ @@ -704,7 +704,7 @@ endif libdvdcss/%.o libdvdcss/%.d: CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DVERSION=\"1.2.9\" libfaad2/%.o libfaad2/%.d: CFLAGS += -Ilibfaad2 -D_GNU_SOURCE -libmpdemux/demux_lavf.o libmpdemux/demux_lavf.d libmpdemux/mp_taglists.o libmpdemux/mp_taglists.d: CFLAGS += -Ilibavcodec +libmpdemux/demux_lavf.o libmpdemux/demux_lavf.d libmpdemux/mp_taglists.o libmpdemux/mp_taglists.d: CFLAGS += -Iffmpeg/libavcodec mp3lib/decode_i586.o: CFLAGS += -fomit-frame-pointer diff --git a/common.mak b/common.mak index 1fbdf2b489..c33202f311 100644 --- a/common.mak +++ b/common.mak @@ -13,7 +13,7 @@ ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale CFLAGS = -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ -D_ISOC9X_SOURCE -I$(BUILD_ROOT) -I$(SRC_PATH) \ - $(addprefix -I$(SRC_PATH)/lib,$(ALLFFLIBS)) $(OPTFLAGS) + $(addprefix -I$(SRC_PATH)/ffmpeg/lib,$(ALLFFLIBS)) $(OPTFLAGS) %.o: %.c $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< diff --git a/configure b/configure index a0cd8db280..8507df187e 100755 --- a/configure +++ b/configure @@ -494,19 +494,19 @@ _libavutil_so=auto _libavcodec_a=auto _libamr_nb=auto _libamr_wb=auto -_libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` +_libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` _libavdecoders=` echo $_libavdecoders_all | sed -e s/LIBFAAD_DECODER// -e s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// ` -_libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` +_libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// -e s/LIBVORBIS_ENCODER// ` -_libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` +_libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` _libavparsers=$_libavparsers_all -_libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` +_libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` _libavbsfs=$_libavbsfs_all -_libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'` +_libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' ffmpeg/libavformat/allformats.c | tr '[a-z]' '[A-Z]'` _libavdemuxers=`echo $_libavdemuxers_all | sed -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/LIBNUT_DEMUXER// -e s/AVISYNTH_DEMUXER// ` -_libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'` +_libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' ffmpeg/libavformat/allformats.c | tr '[a-z]' '[A-Z]'` _libavmuxers=`echo $_libavmuxers_all | sed -e s/RTP_MUXER// ` -_libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'` +_libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' ffmpeg/libavformat/allformats.c | tr '[a-z]' '[A-Z]'` _libavcodec_so=auto _libavformat_a=auto _libavformat_so=auto @@ -6404,7 +6404,7 @@ echores "$_live" echocheck "FFmpeg libavutil" if test "$_libavutil_a" = auto ; then - if test -d libavutil ; then + if test -d ffmpeg/libavutil ; then _libavutil_a=yes _res_comment="static" else @@ -6444,7 +6444,7 @@ echores "$_libavutil" echocheck "FFmpeg libavcodec" if test "$_libavcodec_a" = auto ; then _libavcodec_a=no - if test -d libavcodec && test -f libavcodec/utils.c ; then + if test -d ffmpeg/libavcodec && test -f ffmpeg/libavcodec/utils.c ; then _libavcodec_a="yes" _res_comment="static" fi @@ -6488,7 +6488,7 @@ echores "$_libavcodec" echocheck "FFmpeg libavformat" if test "$_libavformat_a" = auto ; then _libavformat_a=no - if test -d libavformat && test -f libavformat/utils.c ; then + if test -d ffmpeg/libavformat && test -f ffmpeg/libavformat/utils.c ; then _libavformat_a=yes _res_comment="static" fi @@ -6524,7 +6524,7 @@ echores "$_libavformat" echocheck "FFmpeg libpostproc" if test "$_libpostproc_a" = auto ; then _libpostproc_a=no - if test -d libpostproc && test -f libpostproc/postprocess.h ; then + if test -d ffmpeg/libpostproc && test -f ffmpeg/libpostproc/postprocess.h ; then _libpostproc_a='yes' _res_comment="static" fi @@ -7626,9 +7626,6 @@ if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then CFLAGS="$CFLAGS -DHAVE_CONFIG_H" fi -CFLAGS="-I. -I.. -I../libavutil $CFLAGS" -CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS" - cat > $TMPC << EOF int main(void) { return 0; } EOF @@ -7637,6 +7634,10 @@ if test "$cc_vendor" = "gnu" ; then cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS" fi +CFLAGS_FFMPEG="-I../.. $CFLAGS" +CFLAGS="-I. -I../ffmpeg -I.. -I../ffmpeg/libavutil $CFLAGS" +CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS" + cc_check -mno-omit-leaf-frame-pointer && CFLAG_NO_OMIT_LEAF_FRAME_POINTER="-mno-omit-leaf-frame-pointer" #this must be the last test to be performed or the ones following it will likely fail @@ -7696,6 +7697,7 @@ INSTALL = $_install EXTRA_INC = $_inc_extra EXTRAXX_INC = $_inc_extra $_inc_extraxx OPTFLAGS = $CFLAGS \$(EXTRA_INC) +FFMPEG_OFLAGS = $CFLAGS_FFMPEG \$(EXTRA_INC) CFLAG_NO_OMIT_LEAF_FRAME_POINTER = $CFLAG_NO_OMIT_LEAF_FRAME_POINTER CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC) CFLAG_STACKREALIGN = $_stackrealign @@ -8655,6 +8657,9 @@ EOF # Do not overwrite an unchanged config.h to avoid superfluous rebuilds. cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h +cp -p config.h ffmpeg/config.h +sed -e 's/OPTFLAGS/MPLAYER_OPTFLAGS/' -e 's/FFMPEG_OFLAGS/OPTFLAGS/' config.mak >ffmpeg/config.mak + ############################################################################# cat << EOF diff --git a/dvdread/bswap.h b/dvdread/bswap.h index 881f4d36b5..92afd07c88 100644 --- a/dvdread/bswap.h +++ b/dvdread/bswap.h @@ -1,7 +1,7 @@ #ifndef DVDREAD_BSWAP_H #define DVDREAD_BSWAP_H -#include "../libavutil/bswap.h" +#include "libavutil/bswap.h" #ifdef WORDS_BIGENDIAN #define B2N_16(x) -- cgit v1.2.3