removed comment
[mono.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 if [ -n "$MONO_PATH" ]; then
11         # from -> /mono/lib:/another/mono/lib
12         # to -> /mono /another/mono
13         for i in `echo ${MONO_PATH} | tr ":" " "`; do
14                 i=`dirname ${i}`
15                 if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
16                         ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
17                 fi
18                 if [ -n "{i}" -a -d "${i}/bin" ]; then
19                         PATH="${i}/bin:$PATH"
20                 fi
21         done
22         export PATH
23 fi
24
25 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
26   echo
27   echo "**Error**: You must have \`autoconf' installed to compile Mono."
28   echo "Download the appropriate package for your distribution,"
29   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
30   DIE=1
31 }
32
33 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
34   (libtool --version) < /dev/null > /dev/null 2>&1 || {
35     echo
36     echo "**Error**: You must have \`libtool' installed to compile Mono."
37     echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
38     echo "(or a newer version if it is available)"
39     DIE=1
40   }
41 }
42
43 grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
44   grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
45   (gettext --version) < /dev/null > /dev/null 2>&1 || {
46     echo
47     echo "**Error**: You must have \`gettext' installed to compile Mono."
48     echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
49     echo "(or a newer version if it is available)"
50     DIE=1
51   }
52 }
53
54 (automake --version) < /dev/null > /dev/null 2>&1 || {
55   echo
56   echo "**Error**: You must have \`automake' installed to compile Mono."
57   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
58   echo "(or a newer version if it is available)"
59   DIE=1
60   NO_AUTOMAKE=yes
61 }
62
63
64 # if no automake, don't bother testing for aclocal
65 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
66   echo
67   echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
68   echo "installed doesn't appear recent enough."
69   echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
70   echo "(or a newer version if it is available)"
71   DIE=1
72 }
73
74 if test "$DIE" -eq 1; then
75   exit 1
76 fi
77
78 if test -z "$*"; then
79   echo "**Warning**: I am going to run \`configure' with no arguments."
80   echo "If you wish to pass any to it, please specify them on the"
81   echo \`$0\'" command line."
82   echo
83 fi
84
85 case $CC in
86 xlc )
87   am_opt=--include-deps;;
88 esac
89
90
91 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
92   if test -z "$NO_LIBTOOLIZE" ; then 
93     echo "Running libtoolize..."
94     libtoolize --force --copy
95   fi
96 fi
97
98 echo "Running aclocal $ACLOCAL_FLAGS ..."
99 aclocal $ACLOCAL_FLAGS || {
100   echo
101   echo "**Error**: aclocal failed. This may mean that you have not"
102   echo "installed all of the packages you need, or you may need to"
103   echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
104   echo "for the prefix where you installed the packages whose"
105   echo "macros were not found"
106   exit 1
107 }
108
109 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
110   echo "Running autoheader..."
111   autoheader || { echo "**Error**: autoheader failed."; exit 1; }
112 fi
113
114 echo "Running automake --gnu $am_opt ..."
115 automake --add-missing --gnu $am_opt ||
116   { echo "**Error**: automake failed."; exit 1; }
117 echo "Running autoconf ..."
118 autoconf || { echo "**Error**: autoconf failed."; exit 1; }
119
120
121 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
122
123 if test x$NOCONFIGURE = x; then
124   echo Running $srcdir/configure $conf_flags "$@" ...
125   $srcdir/configure $conf_flags "$@" \
126   && echo Now type \`make\' to compile $PKG_NAME || exit 1
127 else
128   echo Skipping configure process.
129 fi