Initial release including wifi display based on gst-rtsp-server-1.4.1
[platform/upstream/gstreamer.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4
5 test -n "$srcdir" || srcdir=`dirname "$0"`
6 test -n "$srcdir" || srcdir=.
7
8 olddir=`pwd`
9 cd "$srcdir"
10
11 DIE=0
12 package=gst-rtsp
13 srcfile=gst/rtsp-server/rtsp-server.c
14
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 NOCONFIGURE=1
40 CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc'
41
42 autogen_options $@
43
44 printf "+ check for build tools"
45 if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else  echo; fi
46 version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 " \
47               "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 68 || DIE=1
48 version_check "automake" "$AUTOMAKE automake automake-1.11" \
49               "ftp://ftp.gnu.org/pub/gnu/automake/" 1 11 || DIE=1
50 #version_check "autopoint" "autopoint" \
51 #              "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1
52 version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
53               "ftp://ftp.gnu.org/pub/gnu/libtool/" 2 2 6 || DIE=1
54 version_check "pkg-config" "" \
55               "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
56
57 die_check $DIE
58
59 aclocal_check || DIE=1
60 autoheader_check || DIE=1
61
62 die_check $DIE
63
64 # if no arguments specified then this will be printed
65 if test -z "$*" && test -z "$NOCONFIGURE"; then
66   echo "+ checking for autogen.sh options"
67   echo "  This autogen script will automatically run ./configure as:"
68   echo "  ./configure $CONFIGURE_DEF_OPT"
69   echo "  To pass any additional options, please specify them on the $0"
70   echo "  command line."
71 fi
72
73 toplevel_check $srcfile
74
75 # autopoint
76 #if test -d po ; then
77 #  tool_run "$autopoint" "--force"
78 #fi
79
80 # aclocal
81 # if test -f acinclude.m4; then rm acinclude.m4; fi
82
83 tool_run "$libtoolize" "--copy --force"
84 tool_run "$aclocal" "-I m4 -I common/m4 $ACLOCAL_FLAGS"
85 tool_run "$autoheader"
86
87 # touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode
88 echo timestamp > stamp-h.in 2> /dev/null
89
90 tool_run "$autoconf"
91 debug "automake: $automake"
92 tool_run "$automake" "--add-missing --copy"
93
94 test -n "$NOCONFIGURE" && {
95   echo "+ skipping configure stage for package $package, as requested."
96   echo "+ autogen.sh done."
97   exit 0
98 }
99
100 cd "$olddir"
101
102 echo "+ running configure ... "
103 test ! -z "$CONFIGURE_DEF_OPT" && echo "  default flags:  $CONFIGURE_DEF_OPT"
104 test ! -z "$CONFIGURE_EXT_OPT" && echo "  external flags: $CONFIGURE_EXT_OPT"
105 echo
106
107 echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
108 "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
109         echo "  configure failed"
110         exit 1
111 }
112
113 echo "Now type 'make' to compile $package."