2 # Run this to generate all the initial makefiles, etc.
8 # Make sure we have common
9 if test ! -f common/gst-autogen.sh;
11 echo "+ Setting up common submodule"
15 # only update if the submodule is tracking master at some version,
16 # which means there is no branch name
18 branch=`git branch | grep ^* | cut -c 3-`
21 if test "x$branch" == "x(no branch)"
23 echo "+ Updating common submodule"
24 git submodule update common
26 echo "+ Not updating common submodule on branch $branch"
29 # source helper functions
30 if test ! -f common/gst-autogen.sh;
32 echo There is something wrong with your source tree.
33 echo You are missing common/gst-autogen.sh
36 . common/gst-autogen.sh
38 # install pre-commit hook for doing clean commits
39 if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
41 rm -f .git/hooks/pre-commit
42 ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
47 CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-failing-tests --enable-poisoning --enable-gtk-doc --enable-docbook'
51 echo -n "+ check for build tools"
52 if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi
53 version_check "autoconf" "$AUTOCONF autoconf autoconf259 autoconf257 autoconf-2.54 autoconf-2.53 autoconf253 autoconf-2.52 autoconf252" \
54 "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
55 version_check "automake" "$AUTOMAKE automake automake-1.9 automake19 automake-1.8 automake18 automake-1.7 automake17 automake-1.6 automake16" \
56 "ftp://ftp.gnu.org/pub/gnu/automake/" 1 7 || DIE=1
57 version_check "autopoint" "autopoint" \
58 "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 11 5 || DIE=1
59 version_check "libtoolize" "libtoolize libtoolize15 glibtoolize" \
60 "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
61 version_check "pkg-config" "" \
62 "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
66 autoconf_2_52d_check || DIE=1
67 aclocal_check || DIE=1
68 autoheader_check || DIE=1
69 libtool_2_2_gettext_check || DIE=1
73 # if no arguments specified then this will be printed
75 echo "+ checking for autogen.sh options"
76 echo " This autogen script will automatically run ./configure as:"
77 echo " ./configure $CONFIGURE_DEF_OPT"
78 echo " To pass any additional options, please specify them on the $0"
82 toplevel_check $srcfile
85 # older autopoint (< 0.12) has a tendency to complain about mkinstalldirs
86 if test -x mkinstalldirs; then rm mkinstalldirs; fi
87 # first remove patch if necessary, then run autopoint, then reapply
88 if test -f po/Makefile.in.in;
90 patch -p0 -R --forward < common/gettext.patch
92 tool_run "$autopoint" "--force" "patch -p0 < common/gettext.patch"
93 patch -p0 < common/gettext.patch
96 if test -f acinclude.m4; then rm acinclude.m4; fi
98 tool_run "$libtoolize" "--copy --force"
99 tool_run "$aclocal" "-I common/m4 $ACLOCAL_FLAGS"
100 tool_run "$autoheader"
102 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
103 echo timestamp > stamp-h.in 2> /dev/null
106 debug "automake: $automake"
107 tool_run "$automake" "--add-missing --copy"
109 test -n "$NOCONFIGURE" && {
110 echo "skipping configure stage for package $package, as requested."
111 echo "autogen.sh done."
115 echo "+ running configure ... "
116 test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
117 test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
120 echo ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
121 ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
122 echo " configure failed"
126 echo "Now type 'make' to compile $package."