2 # Run this to generate all the initial makefiles, etc.
4 test -n "$srcdir" || srcdir=`dirname "$0"`
5 test -n "$srcdir" || srcdir=.
14 # Make sure we have common
15 if test ! -f common/gst-autogen.sh;
17 echo "+ Setting up common submodule"
22 # source helper functions
23 if test ! -f common/gst-autogen.sh;
25 echo There is something wrong with your source tree.
26 echo You are missing common/gst-autogen.sh
29 . common/gst-autogen.sh
31 # install pre-commit hook for doing clean commits
32 if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
34 rm -f .git/hooks/pre-commit
35 ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
40 CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-failing-tests --enable-poisoning --enable-gtk-doc --enable-docbook'
44 printf "+ check for build tools"
45 if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi
46 version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 autoconf267 autoconf266 autoconf265 autoconf264 autoconf263 autoconf262 autoconf261 autoconf260" \
47 "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 60 || DIE=1
48 version_check "automake" "$AUTOMAKE automake automake-1.11 automake-1.10" \
49 "ftp://ftp.gnu.org/pub/gnu/automake/" 1 10 || DIE=1
50 version_check "autopoint" "autopoint" \
51 "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1
52 version_check "libtoolize" "libtoolize libtoolize15 glibtoolize" \
53 "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
54 version_check "pkg-config" "" \
55 "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
59 aclocal_check || DIE=1
60 autoheader_check || DIE=1
64 # if no arguments specified then this will be printed
65 if test -z "$*" && test -z "$NOCONFIGURE"; then
66 echo "+ checking for autogen.sh options"
67 echo " This autogen script will automatically run ./configure as:"
68 echo " ./configure $CONFIGURE_DEF_OPT"
69 echo " To pass any additional options, please specify them on the $0"
73 toplevel_check $srcfile
76 # older autopoint (< 0.12) has a tendency to complain about mkinstalldirs
77 if test -x mkinstalldirs; then rm mkinstalldirs; fi
78 # first remove patch if necessary, then run autopoint, then reapply
79 if test -f po/Makefile.in.in;
81 patch -p0 -R --forward < common/gettext.patch
83 tool_run "$autopoint" "--force" "patch -p0 < common/gettext.patch"
84 patch -p0 < common/gettext.patch
87 if test -f acinclude.m4; then rm acinclude.m4; fi
89 tool_run "$libtoolize" "--copy --force"
90 tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
91 tool_run "$autoheader"
93 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode
94 echo timestamp > stamp-h.in 2> /dev/null
97 debug "automake: $automake"
98 tool_run "$automake" "--add-missing --copy"
100 test -n "$NOCONFIGURE" && {
101 echo "skipping configure stage for package $package, as requested."
102 echo "autogen.sh done."
108 echo "+ running configure ... "
109 test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
110 test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
113 echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
114 "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
115 echo " configure failed"
119 echo "Now type 'make' to compile $package."