94614553483ec5a1e18e0f3bf7a906d7553cca87
[platform/upstream/gstreamer.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 env
5
6
7 DIE=0
8 package=gstreamer
9 srcfile=gst/gst.c
10
11 # a quick cvs co to ease the transition
12 if test ! -d common; then
13   if test -f CVS/Tag; then
14     # get everything from CVS/Tag from second character on
15     TAG="-r `tail -c +2 CVS/Tag`"
16   fi
17   echo "+ getting common from cvs"; cvs co $TAG common
18 fi
19
20 # source helper functions
21 if test ! -f common/gst-autogen.sh;
22 then
23   echo There is something wrong with your source tree.
24   echo You are missing common/gst-autogen.sh
25   exit 1
26 fi
27 . common/gst-autogen.sh
28
29 CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-plugin-builddir --enable-failing-tests --enable-poisoning'
30
31 autogen_options $@
32
33 echo -n "+ check for build tools"
34 if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else  echo; fi
35 version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53 autoconf-2.52" \
36               "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 52 || DIE=1
37 version_check "automake" "$AUTOMAKE automake automake-1.7 automake17 automake-1.6" \
38               "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1
39 version_check "autopoint" "autopoint" \
40               "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 11 5 || DIE=1
41 version_check "libtoolize" "libtoolize" \
42               "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
43 version_check "pkg-config" "" \
44               "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
45
46 die_check $DIE
47
48 autoconf_2_52d_check || DIE=1
49 aclocal_check || DIE=1
50 autoheader_check || DIE=1
51
52 die_check $DIE
53
54 # if no arguments specified then this will be printed
55 if test -z "$*"; then
56   echo "+ checking for autogen.sh options"
57   echo "  This autogen script will automatically run ./configure as:"
58   echo "  ./configure $CONFIGURE_DEF_OPT"
59   echo "  To pass any additional options, please specify them on the $0"
60   echo "  command line."
61 fi
62
63 toplevel_check $srcfile
64
65 # autopoint
66 #    older autopoint (< 0.12) has a tendency to complain about mkinstalldirs
67 if test -x mkinstalldirs; then rm mkinstalldirs; fi
68 #    first remove patch if necessary, then run autopoint, then reapply
69 if test -f po/Makefile.in.in;
70 then
71   patch -p0 -R < common/gettext.patch
72 fi
73 tool_run "$autopoint --force"
74 patch -p0 < common/gettext.patch
75
76 # aclocal
77 if test -f acinclude.m4; then rm acinclude.m4; fi
78 tool_run "$aclocal" "-I common/m4 $ACLOCAL_FLAGS"
79
80 tool_run "$libtoolize" "--copy --force"
81 tool_run "$autoheader"
82
83 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
84 echo timestamp > stamp-h.in 2> /dev/null
85
86 tool_run "$autoconf"
87 debug "automake: $automake"
88 tool_run "$automake" "--add-missing --copy"
89
90 test -n "$NOCONFIGURE" && {
91   echo "skipping configure stage for package $package, as requested."
92   echo "autogen.sh done."
93   exit 0
94 }
95
96 echo "+ running configure ... "
97 test ! -z "$CONFIGURE_DEF_OPT" && echo "  ./configure default flags: $CONFIGURE_DEF_OPT"
98 test ! -z "$CONFIGURE_EXT_OPT" && echo "  ./configure external flags: $CONFIGURE_EXT_OPT"
99 echo
100
101 echo ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
102 ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
103         echo "  configure failed"
104         exit 1
105 }
106
107 echo "Now type 'make' to compile $package."
108