Build modification to ffmpeg/avformat
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 9 May 2005 08:00:37 +0000 (08:00 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 9 May 2005 08:00:37 +0000 (08:00 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@722 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/avformat/Makefile
src/modules/avformat/configure
src/modules/avformat/factory.c

index 07ac987..dd83b8b 100644 (file)
@@ -17,11 +17,7 @@ CFLAGS+=-I../..
 
 LDFLAGS+=-L../../framework
 
-ifdef LOCAL_FFMPEG 
-       LDFLAGS+=-lavformat.mlt -lavcodec.mlt $(EXTRA_LIBS) -lmlt
-else
-       LDFLAGS+=-lavformat -lavcodec $(EXTRA_LIBS) -lmlt
-endif
+LDFLAGS+=-lavformat$(AVFORMAT_SUFFIX) -lavcodec$(AVFORMAT_SUFFIX) $(EXTRA_LIBS) -lmlt
 
 SRCS := $(OBJS:.o=.c)
 
@@ -30,8 +26,8 @@ all:  $(TARGET)
 $(TARGET): $(OBJS)
                if [ $(LOCAL_FFMPEG) ] ; then \
                        $(MAKE) -C ffmpeg all ; \
-                       cp -f ffmpeg/libavcodec/libavcodec$(LIBSUF) ../../framework/libavcodec.mlt$(LIBSUF) ; \
-                       cp -f ffmpeg/libavformat/libavformat$(LIBSUF) ../../framework/libavformat.mlt$(LIBSUF) ; \
+                       cp -f ffmpeg/libavcodec/libavcodec$(AVFORMAT_SUFFIX)$(LIBSUF) ../../framework/libavcodec$(AVFORMAT_SUFFIX)$(LIBSUF) ; \
+                       cp -f ffmpeg/libavformat/libavformat$(AVFORMAT_SUFFIX)$(LIBSUF) ../../framework/libavformat$(AVFORMAT_SUFFIX)$(LIBSUF) ; \
                fi
                $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS)
 
@@ -45,13 +41,13 @@ dist-clean: clean
 
 clean: 
                #if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg clean ; fi
-               rm -f $(OBJS) $(TARGET) 
+               rm -f ../../framework/libavcodec$(AVFORMAT_SUFFIX)$(LIBSUF) ../../framework/libavformat$(AVFORMAT_SUFFIX)$(LIBSUF) $(OBJS) $(TARGET) 
 
 install: all
                install -m 755 $(TARGET) "$(prefix)/share/mlt/modules"
                if [ $(LOCAL_FFMPEG) ] ; then \
-                       install -m 755 ../../framework/libavcodec.mlt$(LIBSUF) "$(prefix)/lib" ; \
-                       install -m 755 ../../framework/libavformat.mlt$(LIBSUF) "$(prefix)/lib" ; \
+                       install -m 755 ../../framework/libavcodec$(AVFORMAT_SUFFIX)$(LIBSUF) "$(prefix)/lib" ; \
+                       install -m 755 ../../framework/libavformat$(AVFORMAT_SUFFIX)$(LIBSUF) "$(prefix)/lib" ; \
                fi
 
 ifneq ($(wildcard .depend),)
index b6a94e3..2b373ef 100755 (executable)
@@ -32,6 +32,7 @@ else
        export shared_ffmpeg=`whereis ffmpeg | cut -f 2 -d' '`
        export extra_libs=
        export cvs_ffmpeg=
+       export avformat_suffix=
 
        if [ "$shared_ffmpeg" != "" ]
        then
@@ -48,13 +49,20 @@ else
                        --avformat-shared=* )   shared_ffmpeg="${i#--avformat-shared=}" ;;
                        --avformat-ldextra=* )  extra_libs="${i#--avformat-ldextra=}" ;;
                        --avformat-cvs )                cvs_ffmpeg=true ;;
+                       --avformat-suffix=* )   avformat_suffix="${i#--avformat-suffix=}" ;;
                esac
        done
 
        if [ "$cvs_ffmpeg" != "" ]
        then
-               [ ! -d "ffmpeg" ] && cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg
-               [ -d "ffmpeg" ] && ( cd ffmpeg ; ./configure --enable-shared )
+               [ ! -d "ffmpeg" ] && ( 
+                       echo
+                       echo "Checking out ffmpeg/avformat - no password required"
+                       echo
+                       cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg login
+                       cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg
+               )
+               [ -d "ffmpeg" ] && ( cd ffmpeg ; ./configure --enable-shared --build-suffix="$avformat_suffix" )
                #[ ! -f "ffmpeg/ffmpeg.patch" ] && ( cd ffmpeg ; cp ../ffmpeg.patch . ; patch -p0 < ffmpeg.patch )
                echo "CFLAGS+=-I`pwd`/ffmpeg/libavformat -I`pwd`/ffmpeg/libavcodec" >> config.mak
                echo "LOCAL_FFMPEG=1" >> config.mak
@@ -86,6 +94,7 @@ else
        fi
 
        echo "EXTRA_LIBS=$extra_libs" >> config.mak
+       echo "AVFORMAT_SUFFIX=$avformat_suffix" >> config.mak
 
 cat << EOF >> ../producers.dat
 avformat               libmltavformat$LIBSUF
index 9c413ae..49d6b93 100644 (file)
@@ -87,7 +87,7 @@ static void avformat_init( )
                pthread_mutex_init( &avformat_mutex, NULL );
                av_register_all( );
                mlt_factory_register_for_clean_up( NULL, avformat_destroy );
-               //av_log_set_level( -1 );
+               av_log_set_level( -1 );
        }
 }