Use correct count length in string split
[mono-project.git] / libgc / autogen.sh
blobceea56c962f81f09757d3dece2921baf0e3f7db1
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3 # Ripped off from GNOME macros version
5 DIE=0
7 srcdir=`dirname $0`
8 test -z "$srcdir" && srcdir=.
10 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
11 echo
12 echo "**Error**: You must have \`autoconf' installed to compile Mono."
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
18 if [ -z "$LIBTOOL" ]; then
19 LIBTOOL=`which glibtool 2>/dev/null`
20 if [ ! -x "$LIBTOOL" ]; then
21 LIBTOOL=`which libtool`
25 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
26 ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
27 echo
28 echo "**Error**: You must have \`libtool' installed to compile Mono."
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
35 grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
36 grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
37 (gettext --version) < /dev/null > /dev/null 2>&1 || {
38 echo
39 echo "**Error**: You must have \`gettext' installed to compile Mono."
40 echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
41 echo "(or a newer version if it is available)"
42 DIE=1
46 (automake --version) < /dev/null > /dev/null 2>&1 || {
47 echo
48 echo "**Error**: You must have \`automake' installed to compile Mono."
49 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
50 echo "(or a newer version if it is available)"
51 DIE=1
52 NO_AUTOMAKE=yes
56 # if no automake, don't bother testing for aclocal
57 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
58 echo
59 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
60 echo "installed doesn't appear recent enough."
61 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
62 echo "(or a newer version if it is available)"
63 DIE=1
66 if test "$DIE" -eq 1; then
67 exit 1
70 if test x$NOCONFIGURE = x && test -z "$*"; then
71 echo "**Warning**: I am going to run \`configure' with no arguments."
72 echo "If you wish to pass any to it, please specify them on the"
73 echo \`$0\'" command line."
74 echo
77 case $CC in
78 xlc )
79 am_opt=--include-deps;;
80 esac
83 if grep "^AC_PROG_LIBTOOL" configure.in >/dev/null; then
84 if test -z "$NO_LIBTOOLIZE" ; then
85 echo "Running libtoolize..."
86 ${LIBTOOL}ize --force --copy
90 echo "Running aclocal $ACLOCAL_FLAGS ..."
91 aclocal $ACLOCAL_FLAGS || {
92 echo
93 echo "**Error**: aclocal failed. This may mean that you have not"
94 echo "installed all of the packages you need, or you may need to"
95 echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
96 echo "for the prefix where you installed the packages whose"
97 echo "macros were not found"
98 exit 1
101 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
102 echo "Running autoheader..."
103 autoheader || { echo "**Error**: autoheader failed."; exit 1; }
106 echo "Running automake --gnu $am_opt ..."
107 automake --add-missing --gnu $am_opt ||
108 { echo "**Error**: automake failed."; exit 1; }
109 echo "Running autoconf ..."
110 autoconf || { echo "**Error**: autoconf failed."; exit 1; }
113 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
115 if test x$NOCONFIGURE = x; then
116 echo Running $srcdir/configure $conf_flags "$@" ...
117 $srcdir/configure $conf_flags "$@" \
118 && echo Now type \`make\' to compile $PKG_NAME || exit 1
119 else
120 echo Skipping configure process.