go back to allowing gettext 0.11.5, but don't mix with libtool 2.2
[platform/upstream/gstreamer.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 DIE=0
5 package=gstreamer
6 srcfile=gst/gst.c
7
8 # Make sure we have common
9 if test ! -f common/gst-autogen.sh;
10 then
11   echo "+ Setting up common submodule"
12   git submodule init
13 fi
14
15 # only update if the submodule is tracking master at some version,
16 # which means there is no branch name
17 cd common
18 branch=`git branch | grep ^* | cut -c 3-`
19 cd ..
20
21 if test "x$branch" == "x(no branch)"
22 then
23   echo "+ Updating common submodule"
24   git submodule update common
25 else
26   echo "+ Not updating common submodule on branch $branch"
27 fi
28
29 # source helper functions
30 if test ! -f common/gst-autogen.sh;
31 then
32   echo There is something wrong with your source tree.
33   echo You are missing common/gst-autogen.sh
34   exit 1
35 fi
36 . common/gst-autogen.sh
37
38 # install pre-commit hook for doing clean commits
39 if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
40 then
41     rm -f .git/hooks/pre-commit
42     ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
43 fi
44
45
46
47 CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-failing-tests --enable-poisoning --enable-gtk-doc --enable-docbook'
48
49 autogen_options $@
50
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
63
64 die_check $DIE
65
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
70
71 die_check $DIE
72
73 # if no arguments specified then this will be printed
74 if test -z "$*"; then
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"
79   echo "  command line."
80 fi
81
82 toplevel_check $srcfile
83
84 # autopoint
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;
89 then
90   patch -p0 -R --forward < common/gettext.patch
91 fi
92 tool_run "$autopoint" "--force" "patch -p0 < common/gettext.patch"
93 patch -p0 < common/gettext.patch
94
95 # aclocal
96 if test -f acinclude.m4; then rm acinclude.m4; fi
97
98 tool_run "$libtoolize" "--copy --force"
99 tool_run "$aclocal" "-I common/m4 $ACLOCAL_FLAGS"
100 tool_run "$autoheader"
101
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
104
105 tool_run "$autoconf"
106 debug "automake: $automake"
107 tool_run "$automake" "--add-missing --copy"
108
109 test -n "$NOCONFIGURE" && {
110   echo "skipping configure stage for package $package, as requested."
111   echo "autogen.sh done."
112   exit 0
113 }
114
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"
118 echo
119
120 echo ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
121 ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
122         echo "  configure failed"
123         exit 1
124 }
125
126 echo "Now type 'make' to compile $package."
127