2 # Run this to generate all the initial makefiles, etc.
8 # FFMPEG specific properties
11 # a quick cvs co if necessary to alleviate the pain - may remove this
12 # when developers get a clue ;)
15 echo "+ getting common/ from cvs"
19 if test ! -f $FFMPEG_CO_DIR/configure
21 # checkout ffmpeg from its repository
23 echo "+ getting ffmpeg from svn"
24 svn -r $FFMPEG_REVISION co $FFMPEG_SVN $FFMPEG_CO_DIR
26 # update ffmpeg from its repository
27 echo "+ updating ffmpeg checkout"
28 svn -r $FFMPEG_REVISION up $FFMPEG_CO_DIR
32 # source helper functions
33 if test ! -f common/gst-autogen.sh;
35 echo There is something wrong with your source tree.
36 echo You are missing common/gst-autogen.sh
39 . common/gst-autogen.sh
41 # Let's check if we can disable the building of the ffmpeg binary
42 can_disable=`$FFMPEG_CO_DIR/configure --help | grep 'disable-ffmpeg' | wc -l`
44 if [ $can_disable != "0" ]
46 CONFIGURE_DEF_OPT="--disable-ffmpeg"
49 # Let's clear the 'exit 1' command when we post an Unknown option
50 echo "Patching ffmpeg ./configure"
51 sed -e '/Unknown option/ {
55 }' $FFMPEG_CO_DIR/configure > $FFMPEG_CO_DIR/configure.tmp
56 mv $FFMPEG_CO_DIR/configure.tmp $FFMPEG_CO_DIR/configure
57 chmod +x $FFMPEG_CO_DIR/configure
61 echo -n "+ check for build tools"
62 if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi
63 version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \
64 "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
65 version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.7 automake-1.6 automake-1.5" \
66 "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1
67 version_check "libtoolize" "$LIBTOOLIZE libtoolize libtoolize14 glibtoolize" \
68 "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1
69 version_check "pkg-config" "" \
70 "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
74 autoconf_2_52d_check || DIE=1
75 aclocal_check || DIE=1
76 autoheader_check || DIE=1
80 # if no arguments specified then this will be printed
82 echo "+ checking for autogen.sh options"
83 echo " This autogen script will automatically run ./configure as:"
84 echo " ./configure $CONFIGURE_DEF_OPT"
85 echo " To pass any additional options, please specify them on the $0"
89 toplevel_check $srcfile
91 tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
92 tool_run "$libtoolize" "--copy --force"
93 tool_run "$autoheader"
95 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
96 echo timestamp > stamp-h.in 2> /dev/null
99 tool_run "$automake" "-a -c"
101 # if enable exists, add an -enable option for each of the lines in that file
102 if test -f enable; then
103 for a in `cat enable`; do
104 CONFIGURE_FILE_OPT="--enable-$a"
108 # if disable exists, add an -disable option for each of the lines in that file
109 if test -f disable; then
110 for a in `cat disable`; do
111 CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
115 test -n "$NOCONFIGURE" && {
116 echo "+ skipping configure stage for package $package, as requested."
117 echo "+ autogen.sh done."
121 echo "+ running configure ... "
122 test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
123 test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
124 test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
127 ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
128 echo " configure failed"
133 echo "Now type 'make' to compile $package."