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