qtdemux: skip disabled tracks
[platform/upstream/gst-plugins-good.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 test -n "$srcdir" || srcdir=`dirname "$0"`
5 test -n "$srcdir" || srcdir=.
6
7 olddir=`pwd`
8 cd "$srcdir"
9
10 DIE=0
11 package=gst-plugins-good
12 srcfile=gst/law/alaw.c
13
14 echo "$(pwd)"
15 # Make sure we have common
16 if test ! -f common/gst-autogen.sh;
17 then
18   echo "+ Setting up common submodule"
19   git submodule init
20 fi
21 git submodule update
22
23 # source helper functions
24 if test ! -f common/gst-autogen.sh;
25 then
26   echo There is something wrong with your source tree.
27   echo You are missing common/gst-autogen.sh
28   exit 1
29 fi
30 . common/gst-autogen.sh
31
32 # install pre-commit hook for doing clean commits
33 if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
34 then
35     rm -f .git/hooks/pre-commit
36     ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
37 fi
38
39 # GNU gettext automake support doesn't get along with git.
40 # https://bugzilla.gnome.org/show_bug.cgi?id=661128
41 touch -t 200001010000 po/gst-plugins-good-0.10.pot
42
43 CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
44
45 autogen_options $@
46
47 printf "+ check for build tools"
48 if test ! -z "$NOCHECK"; then echo " skipped"; else  echo; fi
49 version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 autoconf267 autoconf266 autoconf265 autoconf264 autoconf263 autoconf262" \
50               "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 62 || DIE=1
51 version_check "automake" "$AUTOMAKE automake automake-1.11" \
52               "ftp://ftp.gnu.org/pub/gnu/automake/" 1 11 || DIE=1
53 version_check "autopoint" "autopoint" \
54               "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1
55 version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
56               "ftp://ftp.gnu.org/pub/gnu/libtool/" 2 2 6 || DIE=1
57 version_check "pkg-config" "" \
58               "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
59
60 die_check $DIE
61
62 aclocal_check || DIE=1
63 autoheader_check || DIE=1
64
65 die_check $DIE
66
67 # if no arguments specified then this will be printed
68 if test -z "$*"; then
69   echo "+ checking for autogen.sh options"
70   echo "  This autogen script will automatically run ./configure as:"
71   echo "  ./configure $CONFIGURE_DEF_OPT"
72   echo "  To pass any additional options, please specify them on the $0"
73   echo "  command line."
74 fi
75
76 toplevel_check $srcfile
77
78 # autopoint
79 #    older autopoint (< 0.12) has a tendency to complain about mkinstalldirs
80 if test -x mkinstalldirs; then rm mkinstalldirs; fi
81 #    first remove patch if necessary, then run autopoint, then reapply
82 if test -f po/Makefile.in.in;
83 then
84   patch -p0 -R < common/gettext.patch
85 fi
86 tool_run "$autopoint --force"
87 patch -p0 < common/gettext.patch
88
89 tool_run "$libtoolize" "--copy --force"
90 tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
91 tool_run "$autoheader"
92
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
95
96 tool_run "$autoconf"
97 tool_run "$automake" "-a -c"
98
99 # if enable exists, add an -enable option for each of the lines in that file
100 if test -f enable; then
101   for a in `cat enable`; do
102     CONFIGURE_FILE_OPT="--enable-$a"
103   done
104 fi
105
106 # if disable exists, add an -disable option for each of the lines in that file
107 if test -f disable; then
108   for a in `cat disable`; do
109     CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
110   done
111 fi
112
113 test -n "$NOCONFIGURE" && {
114   echo "+ skipping configure stage for package $package, as requested."
115   echo "+ autogen.sh done."
116   exit 0
117 }
118
119 cd "$olddir"
120
121 echo "+ running configure ... "
122 test ! -z "$CONFIGURE_DEF_OPT" && echo "  $srcdir/configure default flags: $CONFIGURE_DEF_OPT"
123 test ! -z "$CONFIGURE_EXT_OPT" && echo "  $srcdir/configure external flags: $CONFIGURE_EXT_OPT"
124 test ! -z "$CONFIGURE_FILE_OPT" && echo "  $srcdir/configure enable/disable flags: $CONFIGURE_FILE_OPT"
125 echo
126
127 "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
128         echo "  configure failed"
129         exit 1
130 }
131
132 echo "Now type 'make' to compile $package."