4 # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
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.
22 test -z "$srcdir" && srcdir
=.
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"
39 (${AUTOCONF:-autoconf} --version) < /dev/null > /dev/null 2>&1 || {
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/"
47 (grep "^AC_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && {
48 (${INTLTOOLIZE:-intltoolize} --version) < /dev/null > /dev/null 2>&1 || {
50 echo "**Error**: You must have \`intltool' installed.
"
51 echo "You can get it from
:"
52 echo " ftp://ftp.gnome.org
/pub
/GNOME
/"
57 (grep "^AM_PROG_XML_I18N_TOOLS
" $srcdir/configure.ac >/dev/null) && {
58 (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
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/"
67 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
68 (${LIBTOOL:-libtool} --version) < /dev/null > /dev/null 2>&1 || {
70 echo "**Error**: You must have \`libtool
' installed."
71 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
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 || {
80 echo "**Error**: You must have \`glib' installed.
"
81 echo "You can get it from
: ftp://ftp.gtk.org
/pub
/gtk
"
86 (${AUTOMAKE:-automake} --version) < /dev/null > /dev/null 2>&1 || {
88 echo "**Error
**: You must have \
`automake' installed."
89 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
95 # if no automake, don't bother testing for aclocal
96 test -n "$NO_AUTOMAKE" || (${ACLOCAL:-aclocal} --version) < /dev/null > /dev/null 2>&1 || {
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/"
104 if test "$DIE" -eq 1; then
110 am_opt=--include-deps;;
113 # Rather than have libltdl run it's own configure
, the few tests
114 # libltdl needed were added to the main configure.ac. As we need to
115 # look at config.h in header files, which may conflict with other
116 # versions of config.h, this has been renamed to gnashconfig,h to be
117 # unique. As the files libtoolize copies insist on using config.h, we
118 # just edit the name, rather than adding a fixed copy to Gnash.
120 # This gets more interesting with libtool 2.x, which heavily changed
121 # how everything worked. Where libtool 1.5 installed only a header and
122 # had a single source file, libtool 2.x has an entire sub directory
123 # tree of headers and source files. So for libtool 1.5.x, we do
124 # everything the way this has always worked for Gnash. For libtool
125 # 2.x, we install in a subdirectory of libbase, because we have to
126 # hack the build directory, and everything configures tottally
127 # differernt than 1.5.x used to. For more fun, libtoolize has
128 # different command line arguments, but one thing that got fixed is
129 # for libtool 2.x there is an #define for the config file name, but
130 # for libtool 1.5 it expects config.h always, so we change this to
132 ltdlver
=`${LIBTOOLIZE:-libtoolize} --version | head -1 | sed -e 's/(.*) //' | cut -d ' ' -f 2`
133 ltdlmajor
=`echo $ltdlver | cut -d '.' -f 1`
134 if test -z "$NO_LIBTOOLIZE" ; then
136 libtoolflags
="--force --copy --ltdl"
137 if test $ltdlmajor -eq 2; then
138 libtoolflags
="${libtoolflags} ${ltbasedir} --quiet --recursive"
140 echo "Running libtoolize $ltdlver ${libtoolflags} ..."
141 # We have to remove the old libltdl sources, as it's entirely
142 # possible these files are being regenerated on a machine with a
143 # different version of libtoolize.
145 if ${LIBTOOLIZE:-libtoolize} ${libtoolflags}; then
146 # libtool insists on including config.h, but we use gnashconfig.h
147 # to avoid any problems, so we have to change this include
148 # so they all reference the right config header file.
149 if test -d libltdl
; then
150 for i
in libltdl
/*.c
; do
151 # echo "Fixing $i..."
153 sed -e 's/include <config.h>/include <gnashconfig.h>/' $i.orig
> $i
156 # mv libltdl/ltdl.c libltdl/ltdl.c.orig
157 # sed -e 's/include <config.h>/include <gnashconfig.h>/' libltdl/ltdl.c.orig > libltdl/ltdl.c
158 # for libtool 1.x, we don't build in libltdl, it's built in libbase instead. autoconf doesn't like
159 # conditional output files, so we nuke the original libltdl/Makefile.am and replace it with a zero
160 # sized one to keep autoconf happy.
161 if test $ltdlmajor -eq 1; then
162 mv libltdl
/Makefile.am Makefile.am.orig
163 touch libltdl
/Makefile.am
165 if test -f ${ltbasedir}/config-h.
in; then
166 chmod a
+w
${ltbasedir}/config-h.
in # Darwin needs this
170 echo "**Error**: libtoolize failed, do you have libtool and libltdl3-dev packages installed?"
175 #for coin in `find $srcdir -name CVS -prune -o -name configure.ac -print`
176 for coin
in configure.ac
179 if test -f $dr/NO-AUTO-GEN
; then
180 echo skipping
$dr -- flagged as no auto-gen
185 if test -d macros
; then
186 aclocalinclude
="-I macros $ACLOCAL_FLAGS"
188 aclocalinclude
="$ACLOCAL_FLAGS"
191 if test -d cygnal
; then
192 aclocalinclude
="-I cygnal ${aclocalinclude}"
195 if test -d libltdl
/m4; then
196 aclocalinclude
="-I libltdl/m4 -I macros $ACLOCAL_FLAGS"
199 if grep "^AM_GLIB_GNU_GETTEXT" configure.ac
>/dev
/null
; then
200 echo "Creating $dr/aclocal.m4 ..."
201 test -r $dr/aclocal.
m4 ||
touch $dr/aclocal.
m4
202 echo "Making $dr/aclocal.m4 writable ..."
203 test -r $dr/aclocal.
m4 && chmod u
+w
$dr/aclocal.
m4
205 if grep "^AC_PROG_INTLTOOL" configure.ac
>/dev
/null
; then
206 echo "Running intltoolize --copy --force --automake ..."
207 ${INTLTOOLIZE:-intltoolize} --copy --force --automake
209 if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac
>/dev
/null
; then
210 echo "Running xml-i18n-toolize --copy --force --automake..."
211 xml-i18n-toolize
--copy --force --automake
213 # if grep "^AC_PROG_LIBTOOL" configure.ac >/dev/null; then
214 # if test -z "$NO_LIBTOOLIZE" ; then
215 # echo "Running libtoolize --force --copy ..."
216 # ${LIBTOOLIZE:-libtoolize} --force --copy
219 echo "Running aclocal $aclocalinclude ..."
220 ${ACLOCAL:-aclocal} $aclocalinclude
221 if grep "^A[CM]_CONFIG_HEADER" configure.ac
>/dev
/null
; then
222 echo "Running autoheader..."
223 ${AUTOHEADER:-autoheader}
225 # This is a hack. Any command line arguments maens don't run Automake.
226 # This is to prevent regenerating and checking in a pile of Makefiles
227 # that haven't really changed. They clutter up the checkin messages.
228 if test x
"$1" = x
; then
229 echo "Running automake --add-missing --copy $am_opt ..."
230 ${AUTOMAKE:-automake} --add-missing --copy $am_opt
232 echo "Running autoconf ..."
233 ${AUTOCONF:-autoconf}
238 conf_flags
="--enable-maintainer-mode"