]> git.sesse.net Git - mlt/commitdiff
Use $avformat_suffix in pkg-config invocations
authorAlberto Villa <avilla@FreeBSD.org>
Thu, 4 Oct 2012 23:12:11 +0000 (01:12 +0200)
committerAlberto Villa <avilla@FreeBSD.org>
Thu, 4 Oct 2012 23:12:11 +0000 (01:12 +0200)
It is required to really build MLT against a non-default FFmpeg (i.e.,
makes --avformat-suffix option really work).
The same change should probably be applied to static FFmpeg section,
as well as to a MINGW32_NT-* case, but I'm not able to test this, so
I didn't touch those parts.

src/modules/avformat/configure

index c11b67985af8262bb7cc7b649002e1dd1f283bff..a53d32219f6ed65f0a6bdfa45b8a0acc110741c5 100755 (executable)
@@ -54,7 +54,7 @@ else
        echo > config.mak
 
        export static_ffmpeg=
-       export shared_ffmpeg=$(pkg-config --variable=prefix libavformat)
+       export shared_ffmpeg=
        export extra_libs=
        export avformat_suffix=
        export swscale=
@@ -82,6 +82,8 @@ else
                esac
        done
 
+       : ${shared_ffmpeg:=$(pkg-config --variable=prefix libavformat${avformat_suffix})}
+
        if [ "$static_ffmpeg" != "" ]
        then 
                if [ -d "$static_ffmpeg" ]
@@ -121,27 +123,27 @@ else
                                echo "CFLAGS+=-DAVDATADIR=\\\"share/ffmpeg/\\\"" >> config.mak
                        ;;
                        *)
-                               echo "CFLAGS+=-DAVDATADIR=\\\"${shared_ffmpeg}/share/ffmpeg/\\\"" >> config.mak
+                               echo "CFLAGS+=-DAVDATADIR=\\\"${shared_ffmpeg}/share/ffmpeg${avformat_suffix}/\\\"" >> config.mak
                        ;;
                esac
-               echo "CFLAGS+=$(pkg-config --cflags libavformat)" >> config.mak
-               echo "LDFLAGS+=$(pkg-config --libs-only-L libavformat)" >> config.mak
+               echo "CFLAGS+=$(pkg-config --cflags libavformat${avformat_suffix})" >> config.mak
+               echo "LDFLAGS+=$(pkg-config --libs-only-L libavformat${avformat_suffix})" >> config.mak
                if [ "$devices" = "true" ]
                then
-                       echo "CFLAGS+=$(pkg-config --cflags libavdevice)" >> config.mak
-                       echo "LDFLAGS+=$(pkg-config --libs-only-L libavdevice)" >> config.mak
+                       echo "CFLAGS+=$(pkg-config --cflags libavdevice${avformat_suffix})" >> config.mak
+                       echo "LDFLAGS+=$(pkg-config --libs-only-L libavdevice${avformat_suffix})" >> config.mak
                fi
-               avcodec_version=$(pkg-config --modversion libavcodec)
+               avcodec_version=$(pkg-config --modversion libavcodec${avformat_suffix})
                if [ "$swscale" != "" ] || [ $(echo $avcodec_version | cut -d. -f1) -gt 52 ] || ( [ $(echo $avcodec_version | cut -d. -f1) -ge 52 ] && [ $(echo $avcodec_version | cut -d. -f2) -ge 21 ] )
                then
-                       echo "CFLAGS+=$(pkg-config --cflags libswscale)" >> config.mak
-                       echo "LDFLAGS+=$(pkg-config --libs-only-L libswscale)" >> config.mak
+                       echo "CFLAGS+=$(pkg-config --cflags libswscale${avformat_suffix})" >> config.mak
+                       echo "LDFLAGS+=$(pkg-config --libs-only-L libswscale${avformat_suffix})" >> config.mak
                        echo "SWSCALE=1" >> config.mak
                fi
                
                if [ "$vdpau" = "true" ]
                then
-                       printf "#include <libavcodec/vdpau.h>\n int main(){ VdpBitstreamBuffer test; test.struct_version; return 0;}" | $CC -I"$(pkg-config --cflags libavformat)" -I"$shared_ffmpeg/include" $CFLAGS -c -x c -  >/dev/null 2>&1
+                       printf "#include <libavcodec/vdpau.h>\n int main(){ VdpBitstreamBuffer test; test.struct_version; return 0;}" | $CC -I"$(pkg-config --cflags libavformat${avformat_suffix})" -I"$shared_ffmpeg/include" $CFLAGS -c -x c -  >/dev/null 2>&1
                        [ "$x11" = "0" -a "$?" = "0" ] && echo "VDPAU=1" >> config.mak
                fi
        else