]> git.sesse.net Git - mlt/blob - src/modules/avformat/configure
config mods; avformat static or shared build; corrections to sdl
[mlt] / src / modules / avformat / configure
1 #!/bin/bash
2
3 if [ "$help" = "1" ]
4 then
5         cat << EOF
6 FFMPEG/avformat options:
7
8   --avformat-shared=path  - Link against a shared installation of ffmpeg (default)
9   --avformat-static=path  - Link against a static ffmpeg dev tree
10   --avformat-ldextra=libs - Provide additional libs to link with
11
12 EOF
13
14 else
15         echo > config.mak
16
17         export static_ffmpeg=
18         export shared_ffmpeg=`whereis ffmpeg | cut -f 2 -d' '`
19         export extra_libs=
20
21         if [ "$shared_ffmpeg" != "" ]
22         then
23                 # Chop ffmpeg 
24                 shared_ffmpeg=`dirname $shared_ffmpeg`
25                 # Chop bin 
26                 shared_ffmpeg=`dirname $shared_ffmpeg`
27         fi
28
29         for i in "$@"
30         do
31                 case $i in
32                         --avformat-static=* )   static_ffmpeg="${i#--avformat-static=}" ;;
33                         --avformat-shared=* )   shared_ffmpeg="${i#--avformat-shared=}" ;;
34                         --avformat-ldextra=* )  extra_libs="${i#--avformat-ldextra=}" ;;
35                 esac
36         done
37
38         if [ "$static_ffmpeg" != "" ]
39         then 
40                 if [ -d "$static_ffmpeg" ]
41                 then
42                         echo "CFLAGS+=-I$static_ffmpeg/libavformat -I$static_ffmpeg/libavcodec" >> config.mak
43                         echo "LDFLAGS+=-L$static_ffmpeg/libavformat -L$static_ffmpeg/libavcodec" >> config.mak
44                 else
45                         echo "avformat: Invalid path specified: $static_ffmpeg"
46                         touch ../disable-avformat
47                         echo 0
48                 fi
49         else 
50                 if [ -d "$shared_ffmpeg/include/ffmpeg" -a -f "$shared_ffmpeg/lib/libavformat.so" ]
51                 then
52                         echo "CFLAGS+=-I$shared_ffmpeg/include/ffmpeg " >> config.mak
53                         echo "LDFLAGS+=-L$shared_ffmpeg" >> config.mak
54                 else
55                         echo "avformat: No build environment found."
56                         touch ../disable-avformat
57                         exit 0
58                 fi
59         fi
60
61         echo "EXTRA_LIBS=$extra_libs" >> config.mak
62
63 cat << EOF >> ../producers.dat
64 avformat                libmltavformat.so
65 EOF
66
67 cat << EOF >> ../filters.dat
68 avdeinterlace   libmltavformat.so
69 avresample              libmltavformat.so
70 EOF
71
72 cat << EOF >> ../consumers.dat
73 avformat                libmltavformat.so
74 EOF
75
76 fi
77