Don't redefine MAXHOSTNAMELEN
[gnash.git] / autogen.sh
blobccc316252d1ff17efcb3b536dbfead54d36a1e53
1 #!/bin/sh
3 #
4 # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 # Run this to generate all the initial makefiles, etc.
21 srcdir=`dirname $0`
22 test -z "$srcdir" && srcdir=.
24 DIE=0
26 #Always use our macros
27 #ACLOCAL_FLAGS="-I macros $ACLOCAL_FLAGS"
29 if test "`uname`" = "Darwin"; then
30 LIBTOOLIZE=glibtoolize
33 (test -f $srcdir/configure.ac) || {
34 echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
35 echo " top-level package directory"
36 exit 1
39 (${AUTOCONF:-autoconf} --version) < /dev/null > /dev/null 2>&1 || {
40 echo
41 echo "**Error**: You must have \`autoconf' installed."
42 echo "Download the appropriate package for your distribution,"
43 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
44 DIE=1
47 (grep "^AC_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && {
48 (${INTLTOOLIZE:-intltoolize} --version) < /dev/null > /dev/null 2>&1 || {
49 echo
50 echo "**Error**: You must have \`intltool' installed."
51 echo "You can get it from:"
52 echo " ftp://ftp.gnome.org/pub/GNOME/"
53 DIE=1
57 (grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && {
58 (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
59 echo
60 echo "**Error**: You must have \`xml-i18n-toolize' installed."
61 echo "You can get it from:"
62 echo " ftp://ftp.gnome.org/pub/GNOME/"
63 DIE=1
67 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
68 (${LIBTOOL:-libtool} --version) < /dev/null > /dev/null 2>&1 || {
69 echo
70 echo "**Error**: You must have \`libtool' installed."
71 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
72 DIE=1
76 (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && {
77 (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \
78 (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
79 echo
80 echo "**Error**: You must have \`glib' installed."
81 echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
82 DIE=1
86 (${AUTOMAKE:-automake} --version) < /dev/null > /dev/null 2>&1 || {
87 echo
88 echo "**Error**: You must have \`automake' installed."
89 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
90 DIE=1
91 NO_AUTOMAKE=yes
95 # if no automake, don't bother testing for aclocal
96 test -n "$NO_AUTOMAKE" || (${ACLOCAL:-aclocal} --version) < /dev/null > /dev/null 2>&1 || {
97 echo
98 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
99 echo "installed doesn't appear recent enough."
100 echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
101 DIE=1
104 if test "$DIE" -eq 1; then
105 exit 1
108 case $CC in
109 xlc )
110 am_opt=--include-deps;;
111 esac
113 if test -z "$NO_LIBTOOLIZE" ; then
114 libtoolflags="--force --copy"
115 echo "Running libtoolize ${libtoolflags} ..."
116 rm -fr macros/libtool.m4 macros/ltoptions.m4
117 rm -fr macros/ltsugar.m4 macros/ltversion.m4 macros/lt~obsolete.m4
118 if ! ${LIBTOOLIZE:-libtoolize} ${libtoolflags}; then
119 echo
120 echo "**Error**: libtoolize failed, do you have libtool and libltdl3-dev packages installed?"
121 exit 1
125 #for coin in `find $srcdir -name CVS -prune -o -name configure.ac -print`
126 for coin in configure.ac
128 dr=`dirname $coin`
129 if test -f $dr/NO-AUTO-GEN; then
130 echo skipping $dr -- flagged as no auto-gen
131 else
132 echo processing $dr
133 ( cd $dr
135 if test -d macros; then
136 aclocalinclude="-I macros $ACLOCAL_FLAGS"
137 else
138 aclocalinclude="$ACLOCAL_FLAGS"
141 if test -d cygnal; then
142 aclocalinclude="-I cygnal ${aclocalinclude}"
145 if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then
146 echo "Creating $dr/aclocal.m4 ..."
147 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
148 echo "Making $dr/aclocal.m4 writable ..."
149 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
151 if grep "^AC_PROG_INTLTOOL" configure.ac >/dev/null; then
152 echo "Running intltoolize --copy --force --automake ..."
153 ${INTLTOOLIZE:-intltoolize} --copy --force --automake
155 if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then
156 echo "Running xml-i18n-toolize --copy --force --automake..."
157 xml-i18n-toolize --copy --force --automake
159 # if grep "^AC_PROG_LIBTOOL" configure.ac >/dev/null; then
160 # if test -z "$NO_LIBTOOLIZE" ; then
161 # echo "Running libtoolize --force --copy ..."
162 # ${LIBTOOLIZE:-libtoolize} --force --copy
163 # fi
164 # fi
165 echo "Running aclocal $aclocalinclude ..."
166 ${ACLOCAL:-aclocal} ${aclocalinclude}
167 if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then
168 echo "Running autoheader..."
169 ${AUTOHEADER:-autoheader}
171 # This is a hack. Any command line arguments maens don't run Automake.
172 # This is to prevent regenerating and checking in a pile of Makefiles
173 # that haven't really changed. They clutter up the checkin messages.
174 if test x"$1" = x ; then
175 echo "Running automake --add-missing --copy $am_opt ..."
176 ${AUTOMAKE:-automake} --add-missing --copy $am_opt
178 echo "Running autoconf ..."
179 ${AUTOCONF:-autoconf}
182 done
184 conf_flags="--enable-maintainer-mode"