2 # Run this to generate all the initial makefiles, etc.
4 test -n "$srcdir" || srcdir=`dirname "$0"`
5 test -n "$srcdir" || srcdir=.
11 package=gst-plugins-base
12 srcfile=gst/audiotestsrc/gstaudiotestsrc.c
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
39 CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
43 printf "+ check for build tools"
44 if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi
45 version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 autoconf267 autoconf266 autoconf265 autoconf264 autoconf263 autoconf262 autoconf261 autoconf260" \
46 "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 60 || DIE=1
47 version_check "automake" "$AUTOMAKE automake automake-1.11 automake-1.10" \
48 "ftp://ftp.gnu.org/pub/gnu/automake/" 1 10 || DIE=1
49 version_check "autopoint" "autopoint" \
50 "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1
51 version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
52 "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
53 version_check "pkg-config" "" \
54 "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
58 aclocal_check || DIE=1
59 autoheader_check || DIE=1
63 # if no arguments specified then this will be printed
65 echo "+ checking for autogen.sh options"
66 echo " This autogen script will automatically run ./configure as:"
67 echo " ./configure $CONFIGURE_DEF_OPT"
68 echo " To pass any additional options, please specify them on the $0"
72 toplevel_check $srcfile
75 # older autopoint (< 0.12) has a tendency to complain about mkinstalldirs
76 if test -x mkinstalldirs; then rm mkinstalldirs; fi
77 # first remove patch if necessary, then run autopoint, then reapply
78 if test -f po/Makefile.in.in;
80 patch -p0 -R --forward < common/gettext.patch
82 tool_run "$autopoint --force"
83 patch -p0 < common/gettext.patch
85 tool_run "$libtoolize" "--copy --force"
86 tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
87 tool_run "$autoheader"
89 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode
90 echo timestamp > stamp-h.in 2> /dev/null
93 tool_run "$automake" "-a -c"
95 # if enable exists, add an -enable option for each of the lines in that file
96 if test -f enable; then
97 for a in `cat enable`; do
98 CONFIGURE_FILE_OPT="--enable-$a"
102 # if disable exists, add an -disable option for each of the lines in that file
103 if test -f disable; then
104 for a in `cat disable`; do
105 CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
109 test -n "$NOCONFIGURE" && {
110 echo "+ skipping configure stage for package $package, as requested."
111 echo "+ autogen.sh done."
117 echo "+ running configure ... "
118 test ! -z "$CONFIGURE_DEF_OPT" && echo " $srcdir/configure default flags: $CONFIGURE_DEF_OPT"
119 test ! -z "$CONFIGURE_EXT_OPT" && echo " $srcdir/configure external flags: $CONFIGURE_EXT_OPT"
120 test ! -z "$CONFIGURE_FILE_OPT" && echo " $srcdir/configure enable/disable flags: $CONFIGURE_FILE_OPT"
123 "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
124 echo " configure failed"
128 echo "Now type 'make' to compile $package."