]> git.sesse.net Git - mlt/blob - src/modules/avformat/configure
Colour space filter
[mlt] / src / modules / avformat / configure
1 #!/bin/sh
2
3 if [ "$help" = "1" ]
4 then
5         cat << EOF
6 FFMPEG/avformat options:
7
8   --avformat-cvs          - Obtain ffmpeg from CVS
9   --avformat-shared=path  - Link against a shared installation of ffmpeg (default)
10   --avformat-static=path  - Link against a static ffmpeg dev tree
11   --avformat-ldextra=libs - Provide additional libs to link with
12
13 EOF
14
15 else
16         echo > config.mak
17
18         export static_ffmpeg=
19         export shared_ffmpeg=`whereis ffmpeg | cut -f 2 -d' '`
20         export extra_libs=
21         export cvs_ffmpeg=
22
23         if [ "$shared_ffmpeg" != "" ]
24         then
25                 # Chop ffmpeg 
26                 shared_ffmpeg=`dirname $shared_ffmpeg`
27                 # Chop bin 
28                 shared_ffmpeg=`dirname $shared_ffmpeg`
29         fi
30
31         for i in "$@"
32         do
33                 case $i in
34                         --avformat-static=* )   static_ffmpeg="${i#--avformat-static=}" ;;
35                         --avformat-shared=* )   shared_ffmpeg="${i#--avformat-shared=}" ;;
36                         --avformat-ldextra=* )  extra_libs="${i#--avformat-ldextra=}" ;;
37                         --avformat-cvs )                cvs_ffmpeg=true ;;
38                 esac
39         done
40
41         if [ "$cvs_ffmpeg" != "" ]
42         then
43                 [ ! -d "ffmpeg" ] && cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co -D "8/5/2004 15:30 CET" ffmpeg
44                 [ -d "ffmpeg" ] && ( cd ffmpeg ; ./configure )
45                 #[ ! -f "ffmpeg/ffmpeg.patch" ] && ( cd ffmpeg ; cp ../ffmpeg.patch . ; patch -p0 < ffmpeg.patch )
46                 echo "CFLAGS+=-I`pwd`/ffmpeg/libavformat -I`pwd`/ffmpeg/libavcodec" >> config.mak
47                 echo "LDFLAGS+=-L`pwd`/ffmpeg/libavformat -L`pwd`/ffmpeg/libavcodec" >> config.mak
48                 echo "LOCAL_FFMPEG=1" >> config.mak
49                 extra_libs="$extra_libs -lz"
50         elif [ "$static_ffmpeg" != "" ]
51         then 
52                 if [ -d "$static_ffmpeg" ]
53                 then
54                         echo "CFLAGS+=-I$static_ffmpeg/libavformat -I$static_ffmpeg/libavcodec" >> config.mak
55                         echo "LDFLAGS+=-L$static_ffmpeg/libavformat -L$static_ffmpeg/libavcodec" >> config.mak
56                 else
57                         echo "avformat: Invalid path specified: $static_ffmpeg"
58                         touch ../disable-avformat
59                         echo 0
60                 fi
61         else 
62                 if [ -d "$shared_ffmpeg/include/ffmpeg" -a -f "$shared_ffmpeg/lib/libavformat.so" ]
63                 then
64                         echo "CFLAGS+=-I$shared_ffmpeg/include/ffmpeg " >> config.mak
65                         echo "LDFLAGS+=-L$shared_ffmpeg" >> config.mak
66                 else
67                         echo "avformat: No build environment found. "
68                         echo "          Try configuring mlt with --avformat-cvs."
69                         touch ../disable-avformat
70                         exit 0
71                 fi
72         fi
73
74         echo "EXTRA_LIBS=$extra_libs" >> config.mak
75
76 cat << EOF >> ../producers.dat
77 avformat                libmltavformat.so
78 EOF
79
80 cat << EOF >> ../filters.dat
81 avdeinterlace   libmltavformat.so
82 avresample              libmltavformat.so
83 avcolour_space  libmltavformat.so
84 EOF
85
86 cat << EOF >> ../consumers.dat
87 avformat                libmltavformat.so
88 EOF
89
90 fi
91