2006-05-20 Aaron Bockover <aaron@abock.org>
[platform/upstream/gstreamer.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3 # Ripped off from GNOME macros version
4
5 DIE=0
6
7 srcdir=`dirname $0`
8 test -z "$srcdir" && srcdir=.
9
10 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
11   echo
12   echo "**Error**: You must have \`autoconf' installed to compile Gst#."
13   echo "Download the appropriate package for your distribution,"
14   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
15   DIE=1
16 }
17
18 if [ -z "$LIBTOOL" ]; then
19   LIBTOOL=`which glibtool 2>/dev/null` 
20   if [ ! -x "$LIBTOOL" ]; then
21     LIBTOOL=`which libtool`
22   fi
23 fi
24
25 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
26   ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
27     echo
28     echo "**Error**: You must have \`libtool' installed to compile Gst#."
29     echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
30     echo "(or a newer version if it is available)"
31     DIE=1
32   }
33 }
34
35 (automake --version) < /dev/null > /dev/null 2>&1 || {
36   echo
37   echo "**Error**: You must have \`automake' installed to compile Gst#."
38   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
39   echo "(or a newer version if it is available)"
40   DIE=1
41   NO_AUTOMAKE=yes
42 }
43
44
45 # if no automake, don't bother testing for aclocal
46 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
47   echo
48   echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
49   echo "installed doesn't appear recent enough."
50   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
51   echo "(or a newer version if it is available)"
52   DIE=1
53 }
54
55 if test "$DIE" -eq 1; then
56   exit 1
57 fi
58
59 if test -z "$*"; then
60   echo "**Warning**: I am going to run \`configure' with no arguments."
61   echo "If you wish to pass any to it, please specify them on the"
62   echo \`$0\'" command line."
63   echo
64 fi
65
66 case $CC in
67 xlc )
68   am_opt=--include-deps;;
69 esac
70
71
72 if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
73   if test -z "$NO_LIBTOOLIZE" ; then 
74     echo "Running libtoolize..."
75     libtoolize --force --copy
76   fi
77 fi
78
79 echo "Running aclocal $ACLOCAL_FLAGS ..."
80 aclocal $ACLOCAL_FLAGS || {
81   echo
82   echo "**Error**: aclocal failed. This may mean that you have not"
83   echo "installed all of the packages you need, or you may need to"
84   echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
85   echo "for the prefix where you installed the packages whose"
86   echo "macros were not found"
87   exit 1
88 }
89
90 if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
91   echo "Running autoheader..."
92   autoheader || { echo "**Error**: autoheader failed."; exit 1; }
93 fi
94
95 echo "Running automake --gnu $am_opt ..."
96 automake --add-missing --gnu $am_opt ||
97   { echo "**Error**: automake failed."; exit 1; }
98 echo "Running autoconf ..."
99 autoconf || { echo "**Error**: autoconf failed."; exit 1; }
100
101
102 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
103
104 if test x$NOCONFIGURE = x; then
105   echo Running $srcdir/configure $conf_flags "$@" ...
106   $srcdir/configure $conf_flags "$@" \
107   && echo Now type \`make\' to compile $PKG_NAME || exit 1
108 else
109   echo Skipping configure process.
110 fi