--avformat-swscale with --avformat-svn is only permitted with --enable-gpl
[melted] / src / modules / avformat / configure
index eb8670d..96dda2b 100755 (executable)
@@ -70,15 +70,35 @@ else
 
        if [ "$svn_ffmpeg" != "" ]
        then
-               [ ! -d "ffmpeg" ] && ( 
+               if [ "$gpl" = "true" ]
+               then
+                       enable_gpl="--enable-gpl"
+                       if [ "$swscale" != "" ]
+                       then
+                                       enable_swscale="--enable-swscaler"
+                                       echo "SWSCALE=1" >> config.mak
+                       fi
+               elif [ "$swscale" != "" ]
+               then
+                       echo
+                       echo "ERROR        ERROR        ERROR        ERROR        ERROR        ERROR"
+                       echo "--enable-gpl is required to use --avformat-swscale with --avformat-svn!"
+                       echo
+                       exit
+               fi
+               if [ ! -d "ffmpeg" ]
+               then
                        echo
                        echo "Checking out ffmpeg/avformat - no password required"
                        echo
                        svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
-               )
-               [ -d "ffmpeg" ] && ( cd ffmpeg ; ./configure --enable-shared --build-suffix="$avformat_suffix" )
+               fi
+               [ -d "ffmpeg" ] && ( cd ffmpeg ; ./configure $enable_gpl $enable_swscale )
                #[ ! -f "ffmpeg/ffmpeg.patch" ] && ( cd ffmpeg ; cp ../ffmpeg.patch . ; patch -p0 < ffmpeg.patch )
-               echo "CFLAGS+=-I`pwd`/ffmpeg/libavformat -I`pwd`/ffmpeg/libavcodec -I`pwd`/ffmpeg/libavutil" >> config.mak
+               echo "CFLAGS+=-I`pwd`/ffmpeg/libavformat -I`pwd`/ffmpeg/libavcodec -I`pwd`/ffmpeg/libavutil -I`pwd`/ffmpeg/libswscale" >> config.mak
+               echo "LDFLAGS+=-L`pwd`/ffmpeg/libavformat -L`pwd`/ffmpeg/libavcodec -L`pwd`/ffmpeg/libavutil -L`pwd`/ffmpeg/libswscale" >> config.mak
+               [ $targetos = "Darwin" ] &&
+                       echo "LDFLAGS+=-single_module" >> config.mak
                echo "LOCAL_FFMPEG=1" >> config.mak
                extra_libs="$extra_libs -lz"
        elif [ "$static_ffmpeg" != "" ]