Update autogen.sh to latest version from common
[platform/upstream/gstreamer.git] / autogen.sh
1 #!/bin/sh
2 #
3 # gst-rtsp-server autogen.sh
4 #
5 # Run this to generate all the initial makefiles, etc.
6 #
7 # This file has been generated from common/autogen.sh.in via common/update-autogen
8
9
10 test -n "$srcdir" || srcdir=`dirname "$0"`
11 test -n "$srcdir" || srcdir=.
12
13 olddir=`pwd`
14 cd "$srcdir"
15
16 DIE=0
17 package=gst-rtsp-server
18 srcfile=gst-rtsp-server.doap
19
20 # Make sure we have common
21 if test ! -f common/gst-autogen.sh;
22 then
23   echo "+ Setting up common submodule"
24   git submodule init
25 fi
26 git submodule update
27
28 # source helper functions
29 if test ! -f common/gst-autogen.sh;
30 then
31   echo There is something wrong with your source tree.
32   echo You are missing common/gst-autogen.sh
33   exit 1
34 fi
35 . common/gst-autogen.sh
36
37 # install pre-commit hook for doing clean commits
38 if test ! \( -x .git/hooks/pre-commit -a -L .git/hooks/pre-commit \);
39 then
40     rm -f .git/hooks/pre-commit
41     ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit
42 fi
43
44 # GNU gettext automake support doesn't get along with git.
45 # https://bugzilla.gnome.org/show_bug.cgi?id=661128
46 if test -d po ; then
47   touch -t 200001010000 po/gst-rtsp-server-1.0.pot
48 fi
49
50 CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
51
52 if test "x$package" = "xgstreamer"; then
53   CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --enable-docbook --enable-failing-tests --enable-poisoning"
54 fi
55
56 autogen_options $@
57
58 printf "+ check for build tools"
59 if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else  echo; fi
60 version_check "autoreconf" "autoreconf " \
61               "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 68 || DIE=1
62 version_check "pkg-config" "" \
63               "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
64
65 die_check $DIE
66
67 # if no arguments specified then this will be printed
68 if test -z "$*" && test -z "$NOCONFIGURE"; 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 if test -d po ; then
80   tool_run "autopoint" "--force"
81 fi
82
83 # aclocal
84 if test -f acinclude.m4; then rm acinclude.m4; fi
85
86 autoreconf --force --install || exit 1
87
88 test -n "$NOCONFIGURE" && {
89   echo "+ skipping configure stage for package $package, as requested."
90   echo "+ autogen.sh done."
91   exit 0
92 }
93
94 cd "$olddir"
95
96 echo "+ running configure ... "
97 test ! -z "$CONFIGURE_DEF_OPT" && echo "  default flags:  $CONFIGURE_DEF_OPT"
98 test ! -z "$CONFIGURE_EXT_OPT" && echo "  external flags: $CONFIGURE_EXT_OPT"
99 echo
100
101 echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
102 "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
103         echo "  configure failed"
104         exit 1
105 }
106
107 echo "Now type 'make' to compile $package."