014219982fec82f3448b9c5ed67d5a108730e5a2
[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/gstobject.h
7
8 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
9         echo
10         echo "You must have autoconf installed to compile $package."
11         echo "Download the appropriate package for your distribution,"
12         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/"
13         DIE=1
14 }
15
16 (automake --version) < /dev/null > /dev/null 2>&1 || {
17         echo
18         echo "You must have automake installed to compile $package."
19         echo "Download the appropriate package for your distribution,"
20         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
21         DIE=1
22 }
23 automakevermin=`(automake --version|head -n 1|sed 's/^.* //;s/\./ /g;';echo "1 5")|sort -n|head -n 1`
24 if test "x$automakevermin" != "x1 5"; then
25 # version is less than 1.5, the minimum suitable version
26         echo
27         echo "You must have automake version 1.5 or greater installed."
28         echo "Download the appropriate package for your distribution,"
29         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
30         DIE=1
31 fi
32
33 (pkg-config --version) < /dev/null > /dev/null 2>&1 || {
34         echo
35         echo "You must have pkg-config installed to compile $package."
36         echo "Download the appropriate package for your distribution,"
37         echo "or get the source tarball at:"
38         echo "http://www.freedesktop.org/software/pkgconfig/"
39         DIE=1
40 }
41
42
43 (libtool --version) < /dev/null > /dev/null 2>&1 || {
44         echo
45         echo "You must have libtool installed to compile $package."
46         echo "Get the latest version from ftp://alpha.gnu.org/gnu/libtool/"
47         DIE=1
48 }
49
50 libtool_version=`libtool --version | sed 's/^.* \([0-9a-z\.]*\) .*$/\1/'`
51 libtool_major=`echo $libtool_version | cut -d. -f1`
52 libtool_minor=`echo $libtool_version | cut -d. -f2`
53 libtool_micro=`echo $libtool_version | cut -d. -f3`
54 if [ x$libtool_micro = x ]; then
55         libtool_micro=0
56 fi
57 if [ $libtool_major -le 1 ]; then
58         if [ $libtool_major -lt 1 ]; then
59                 echo
60                 echo "You must have libtool 1.4.0 or greater to compile $package."
61                 echo "Get the latest version from ftp://alpha.gnu.org/gnu/libtool/"
62                 DIE=1
63         elif [ $libtool_minor -le 4 ]; then
64                 if [ $libtool_minor -lt 4 ]; then
65                         echo
66                         echo "You must have libtool 1.4.0 or greater to compile $package."
67                         echo "Get the latest version from ftp://alpha.gnu.org/gnu/libtool/"
68                         DIE=1
69                 elif [ $libtool_micro -lt 0 ]; then
70                         echo
71                         echo "You must have libtool 1.4.0 or greater to compile $package."
72                         echo "Get the latest version from ftp://alpha.gnu.org/gnu/libtool/"
73                         DIE=1
74                 fi
75         fi
76 fi
77
78 if test "$DIE" -eq 1; then
79         exit 1
80 fi
81
82 test -f $srcfile || {
83         echo "You must run this script in the top-level $package directory"
84         exit 1
85 }
86
87 if test -z "$*"; then
88         echo "I am going to run ./configure with no arguments - if you wish "
89         echo "to pass any to it, please specify them on the $0 command line."
90 fi
91
92
93 libtoolize --copy --force
94 aclocal $ACLOCAL_FLAGS || {
95         echo
96         echo "aclocal failed - check that all needed development files are present on system"
97         exit 1
98 }
99 autoheader || {
100         echo
101         echo "autoheader failed"
102         exit 1
103 }
104 autoconf || {
105         echo
106         echo "autoconf failed"
107         #exit 1
108 }
109 automake --add-missing || {
110         echo
111         echo "automake failed"
112         #exit 1
113 }
114
115 # now remove the cache, because it can be considered dangerous in this case
116 rm -f config.cache
117
118 CONFIGURE_OPT='--enable-maintainer-mode --enable-plugin-builddir --enable-debug --enable-DEBUG'
119
120 echo
121 echo "./configure default flags: $CONFIGURE_OPT"
122 echo "using: $CONFIGURE_OPT $@"
123 echo
124
125 ./configure $CONFIGURE_OPT "$@" || {
126         echo
127         echo "configure failed"
128         exit 1
129 }
130
131 echo 
132 echo "Now type 'make' to compile $package."