2 # Run this to generate all the initial makefiles, etc.
8 # FFMPEG specific properties
11 # make sure we have common
12 if test ! -f common/gst-autogen.sh;
14 echo "+ Setting up common submodule"
19 if test -x $have_svn && [ $have_svn ];
21 if test ! -f $FFMPEG_CO_DIR/configure
23 # checkout ffmpeg from its repository
25 echo "+ getting ffmpeg from svn"
26 svn -r $FFMPEG_REVISION co $FFMPEG_SVN $FFMPEG_CO_DIR
27 echo "+ updating externals"
28 sh -c "$FFMPEG_EXTERNALS_UPDATE"
30 # update ffmpeg from its repository
31 echo "+ updating ffmpeg checkout"
32 svn -r $FFMPEG_REVISION up $FFMPEG_CO_DIR
33 echo "+ updating externals"
34 sh -c "$FFMPEG_EXTERNALS_UPDATE"
37 echo "Subversion needed for ffmpeg checkout, please install and/or add to \$PATH"
41 # source helper functions
42 if test ! -f common/gst-autogen.sh;
44 echo There is something wrong with your source tree.
45 echo You are missing common/gst-autogen.sh
48 . common/gst-autogen.sh
50 # Let's check if we can disable the building of the ffmpeg binary
51 can_disable=`$FFMPEG_CO_DIR/configure --help | grep 'disable-ffmpeg' | wc -l`
53 if [ $can_disable != "0" ]
55 CONFIGURE_DEF_OPT="--disable-ffmpeg"
58 # Let's clear the 'exit 1' command when we post an Unknown option
59 echo "Patching ffmpeg ./configure"
60 sed -e '/Unknown option/ {
64 }' $FFMPEG_CO_DIR/configure > $FFMPEG_CO_DIR/configure.tmp
65 mv $FFMPEG_CO_DIR/configure.tmp $FFMPEG_CO_DIR/configure
66 chmod +x $FFMPEG_CO_DIR/configure
70 echo -n "+ check for build tools"
71 if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi
72 version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \
73 "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
74 version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.7 automake-1.6 automake-1.5" \
75 "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1
76 version_check "libtoolize" "$LIBTOOLIZE libtoolize libtoolize14 glibtoolize" \
77 "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 4 0 || DIE=1
78 version_check "pkg-config" "" \
79 "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
83 autoconf_2_52d_check || DIE=1
84 aclocal_check || DIE=1
85 autoheader_check || DIE=1
89 # if no arguments specified then this will be printed
91 echo "+ checking for autogen.sh options"
92 echo " This autogen script will automatically run ./configure as:"
93 echo " ./configure $CONFIGURE_DEF_OPT"
94 echo " To pass any additional options, please specify them on the $0"
98 toplevel_check $srcfile
100 tool_run "$aclocal" "-I common/m4 $ACLOCAL_FLAGS"
101 tool_run "$libtoolize" "--copy --force"
102 tool_run "$autoheader"
104 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
105 echo timestamp > stamp-h.in 2> /dev/null
108 tool_run "$automake" "-a -c -Wno-portability"
110 # if enable exists, add an -enable option for each of the lines in that file
111 if test -f enable; then
112 for a in `cat enable`; do
113 CONFIGURE_FILE_OPT="--enable-$a"
117 # if disable exists, add an -disable option for each of the lines in that file
118 if test -f disable; then
119 for a in `cat disable`; do
120 CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
124 test -n "$NOCONFIGURE" && {
125 echo "+ skipping configure stage for package $package, as requested."
126 echo "+ autogen.sh done."
130 echo "+ running configure ... "
131 test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
132 test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
133 test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
136 ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
137 echo " configure failed"
142 echo "Now type 'make' to compile $package."