2002-05-28 07:13:40 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2009-04-25 23:57:19 +08:00
|
|
|
# This script does all the magic calls to automake/autoconf and
|
|
|
|
# friends that are needed to configure a git clone. As described in
|
2002-05-28 07:13:40 +08:00
|
|
|
# the file HACKING you need a couple of extra tools to run this script
|
|
|
|
# successfully.
|
|
|
|
#
|
|
|
|
# If you are compiling from a released tarball you don't need these
|
|
|
|
# tools and you shouldn't use this script. Just call ./configure
|
|
|
|
# directly.
|
1998-02-26 19:55:07 +08:00
|
|
|
|
2011-04-15 03:03:11 +08:00
|
|
|
ACLOCAL=${ACLOCAL-aclocal-1.11}
|
2005-12-07 09:15:01 +08:00
|
|
|
AUTOCONF=${AUTOCONF-autoconf}
|
|
|
|
AUTOHEADER=${AUTOHEADER-autoheader}
|
2011-04-15 03:03:11 +08:00
|
|
|
AUTOMAKE=${AUTOMAKE-automake-1.11}
|
2005-12-07 09:15:01 +08:00
|
|
|
LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
|
1998-12-15 11:13:46 +08:00
|
|
|
|
2003-08-17 06:54:37 +08:00
|
|
|
AUTOCONF_REQUIRED_VERSION=2.54
|
2011-04-15 03:03:11 +08:00
|
|
|
AUTOMAKE_REQUIRED_VERSION=1.10.0
|
2009-01-14 05:09:06 +08:00
|
|
|
INTLTOOL_REQUIRED_VERSION=0.40.1
|
2007-11-21 17:30:21 +08:00
|
|
|
LIBTOOL_REQUIRED_VERSION=1.5
|
2009-08-11 06:00:22 +08:00
|
|
|
LIBTOOL_WIN32_REQUIRED_VERSION=2.2
|
2006-03-02 18:20:06 +08:00
|
|
|
|
2006-03-02 22:10:53 +08:00
|
|
|
|
2006-03-02 18:20:06 +08:00
|
|
|
PROJECT="GNU Image Manipulation Program"
|
|
|
|
TEST_TYPE=-d
|
|
|
|
FILE=plug-ins
|
1998-02-26 19:55:07 +08:00
|
|
|
|
|
|
|
|
2002-05-28 07:13:40 +08:00
|
|
|
srcdir=`dirname $0`
|
|
|
|
test -z "$srcdir" && srcdir=.
|
|
|
|
ORIGDIR=`pwd`
|
|
|
|
cd $srcdir
|
|
|
|
|
2006-03-02 22:10:53 +08:00
|
|
|
|
2002-08-19 11:35:20 +08:00
|
|
|
check_version ()
|
2002-05-28 23:43:24 +08:00
|
|
|
{
|
2006-03-02 21:58:04 +08:00
|
|
|
VERSION_A=$1
|
|
|
|
VERSION_B=$2
|
|
|
|
|
|
|
|
save_ifs="$IFS"
|
|
|
|
IFS=.
|
|
|
|
set dummy $VERSION_A 0 0 0
|
|
|
|
MAJOR_A=$2
|
|
|
|
MINOR_A=$3
|
|
|
|
MICRO_A=$4
|
|
|
|
set dummy $VERSION_B 0 0 0
|
|
|
|
MAJOR_B=$2
|
|
|
|
MINOR_B=$3
|
|
|
|
MICRO_B=$4
|
|
|
|
IFS="$save_ifs"
|
|
|
|
|
|
|
|
if expr "$MAJOR_A" = "$MAJOR_B" > /dev/null; then
|
|
|
|
if expr "$MINOR_A" \> "$MINOR_B" > /dev/null; then
|
|
|
|
echo "yes (version $VERSION_A)"
|
|
|
|
elif expr "$MINOR_A" = "$MINOR_B" > /dev/null; then
|
|
|
|
if expr "$MICRO_A" \>= "$MICRO_B" > /dev/null; then
|
|
|
|
echo "yes (version $VERSION_A)"
|
|
|
|
else
|
|
|
|
echo "Too old (version $VERSION_A)"
|
|
|
|
DIE=1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Too old (version $VERSION_A)"
|
|
|
|
DIE=1
|
|
|
|
fi
|
|
|
|
elif expr "$MAJOR_A" \> "$MAJOR_B" > /dev/null; then
|
|
|
|
echo "Major version might be too new ($VERSION_A)"
|
2002-05-28 23:43:24 +08:00
|
|
|
else
|
2006-03-02 21:58:04 +08:00
|
|
|
echo "Too old (version $VERSION_A)"
|
2002-05-28 23:43:24 +08:00
|
|
|
DIE=1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2002-05-28 07:13:40 +08:00
|
|
|
echo
|
2006-03-02 18:20:06 +08:00
|
|
|
echo "I am testing that you have the tools required to build the"
|
2009-04-25 23:57:19 +08:00
|
|
|
echo "$PROJECT from git. This test is not foolproof,"
|
2002-02-23 01:35:07 +08:00
|
|
|
echo "so if anything goes wrong, see the file HACKING for more information..."
|
1999-11-13 06:31:57 +08:00
|
|
|
echo
|
|
|
|
|
2002-05-28 07:13:40 +08:00
|
|
|
DIE=0
|
|
|
|
|
2009-08-11 06:00:22 +08:00
|
|
|
OS=`uname -s`
|
|
|
|
case $OS in
|
|
|
|
*YGWIN* | *INGW*)
|
|
|
|
echo "Looks like Win32, you will need libtool $LIBTOOL_WIN32_REQUIRED_VERSION or newer."
|
|
|
|
echo
|
|
|
|
LIBTOOL_REQUIRED_VERSION=$LIBTOOL_WIN32_REQUIRED_VERSION
|
|
|
|
;;
|
|
|
|
esac
|
2003-09-04 01:36:49 +08:00
|
|
|
|
2002-05-28 07:13:40 +08:00
|
|
|
echo -n "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... "
|
2005-12-07 01:18:14 +08:00
|
|
|
if ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1; then
|
|
|
|
LIBTOOLIZE=$LIBTOOLIZE
|
2004-07-29 02:52:40 +08:00
|
|
|
elif (glibtoolize --version) < /dev/null > /dev/null 2>&1; then
|
|
|
|
LIBTOOLIZE=glibtoolize
|
2002-05-28 07:13:40 +08:00
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo " You must have libtool installed to compile $PROJECT."
|
|
|
|
echo " Install the appropriate package for your distribution,"
|
|
|
|
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
2004-07-20 18:06:46 +08:00
|
|
|
echo
|
2004-07-29 02:52:40 +08:00
|
|
|
DIE=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$LIBTOOLIZE != x; then
|
|
|
|
VER=`$LIBTOOLIZE --version \
|
|
|
|
| grep libtool | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
|
|
|
|
check_version $VER $LIBTOOL_REQUIRED_VERSION
|
2001-08-28 22:59:42 +08:00
|
|
|
fi
|
|
|
|
|
2005-01-21 02:21:41 +08:00
|
|
|
# check if gtk-doc is explicitely disabled
|
|
|
|
for ag_option in $AUTOGEN_CONFIGURE_ARGS $@
|
|
|
|
do
|
|
|
|
case $ag_option in
|
|
|
|
-disable-gtk-doc | --disable-gtk-doc)
|
|
|
|
enable_gtk_doc=no
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if test x$enable_gtk_doc = xno; then
|
|
|
|
echo "skipping test for gtkdocize"
|
2004-12-14 06:51:55 +08:00
|
|
|
else
|
2005-01-21 02:21:41 +08:00
|
|
|
echo -n "checking for gtkdocize ... "
|
|
|
|
if (gtkdocize --version) < /dev/null > /dev/null 2>&1; then
|
|
|
|
echo "yes"
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo " You must have gtk-doc installed to compile $PROJECT."
|
|
|
|
echo " Install the appropriate package for your distribution,"
|
|
|
|
echo " or get the source tarball at"
|
|
|
|
echo " http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/"
|
|
|
|
echo " You can also use the option --disable-gtk-doc to skip"
|
|
|
|
echo " this test but then you will not be able to generate a"
|
|
|
|
echo " configure script that can build the API documentation."
|
|
|
|
DIE=1
|
|
|
|
fi
|
2004-12-14 06:51:55 +08:00
|
|
|
fi
|
|
|
|
|
2002-05-28 07:13:40 +08:00
|
|
|
echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
|
2005-12-07 01:18:14 +08:00
|
|
|
if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1; then
|
2006-01-31 17:35:51 +08:00
|
|
|
VER=`$AUTOCONF --version | head -n 1 \
|
2002-05-28 07:13:40 +08:00
|
|
|
| grep -iw autoconf | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
|
2002-05-28 23:43:24 +08:00
|
|
|
check_version $VER $AUTOCONF_REQUIRED_VERSION
|
2002-05-28 07:13:40 +08:00
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo " You must have autoconf installed to compile $PROJECT."
|
|
|
|
echo " Download the appropriate package for your distribution,"
|
2004-01-25 21:53:23 +08:00
|
|
|
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/"
|
2004-07-20 18:06:46 +08:00
|
|
|
echo
|
2002-05-28 07:13:40 +08:00
|
|
|
DIE=1;
|
1999-11-13 06:31:57 +08:00
|
|
|
fi
|
|
|
|
|
2004-07-29 02:52:40 +08:00
|
|
|
|
2002-05-28 07:13:40 +08:00
|
|
|
echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
|
2005-12-07 09:15:01 +08:00
|
|
|
if ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1; then
|
|
|
|
AUTOMAKE=$AUTOMAKE
|
|
|
|
ACLOCAL=$ACLOCAL
|
2009-06-28 17:02:26 +08:00
|
|
|
elif (automake-1.11 --version) < /dev/null > /dev/null 2>&1; then
|
|
|
|
AUTOMAKE=automake-1.11
|
|
|
|
ACLOCAL=aclocal-1.11
|
2007-05-22 00:54:31 +08:00
|
|
|
elif (automake-1.10 --version) < /dev/null > /dev/null 2>&1; then
|
|
|
|
AUTOMAKE=automake-1.10
|
|
|
|
ACLOCAL=aclocal-1.10
|
2002-05-28 07:13:40 +08:00
|
|
|
else
|
|
|
|
echo
|
2005-06-12 05:10:43 +08:00
|
|
|
echo " You must have automake $AUTOMAKE_REQUIRED_VERSION or newer installed to compile $PROJECT."
|
2004-01-25 21:53:23 +08:00
|
|
|
echo " Download the appropriate package for your distribution,"
|
|
|
|
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
|
2004-07-20 18:06:46 +08:00
|
|
|
echo
|
2002-05-28 07:13:40 +08:00
|
|
|
DIE=1
|
1999-11-13 06:31:57 +08:00
|
|
|
fi
|
|
|
|
|
2002-11-18 20:23:05 +08:00
|
|
|
if test x$AUTOMAKE != x; then
|
|
|
|
VER=`$AUTOMAKE --version \
|
|
|
|
| grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
|
|
|
|
check_version $VER $AUTOMAKE_REQUIRED_VERSION
|
|
|
|
fi
|
|
|
|
|
2004-07-29 02:52:40 +08:00
|
|
|
|
2002-05-28 07:13:40 +08:00
|
|
|
echo -n "checking for intltool >= $INTLTOOL_REQUIRED_VERSION ... "
|
|
|
|
if (intltoolize --version) < /dev/null > /dev/null 2>&1; then
|
|
|
|
VER=`intltoolize --version \
|
|
|
|
| grep intltoolize | sed "s/.* \([0-9.]*\)/\1/"`
|
2002-05-28 23:43:24 +08:00
|
|
|
check_version $VER $INTLTOOL_REQUIRED_VERSION
|
2002-05-28 07:13:40 +08:00
|
|
|
else
|
|
|
|
echo
|
2002-11-18 20:23:05 +08:00
|
|
|
echo " You must have intltool installed to compile $PROJECT."
|
|
|
|
echo " Get the latest version from"
|
|
|
|
echo " ftp://ftp.gnome.org/pub/GNOME/sources/intltool/"
|
2004-07-20 18:06:46 +08:00
|
|
|
echo
|
2002-05-28 07:13:40 +08:00
|
|
|
DIE=1
|
2002-02-23 01:35:07 +08:00
|
|
|
fi
|
2002-05-06 19:04:39 +08:00
|
|
|
|
2004-07-29 02:52:40 +08:00
|
|
|
|
2004-06-17 22:33:29 +08:00
|
|
|
echo -n "checking for xsltproc ... "
|
|
|
|
if (xsltproc --version) < /dev/null > /dev/null 2>&1; then
|
|
|
|
echo "yes"
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo " You must have xsltproc installed to compile $PROJECT."
|
|
|
|
echo " Get the latest version from"
|
|
|
|
echo " ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/"
|
2004-07-20 18:06:46 +08:00
|
|
|
echo
|
2004-06-17 22:33:29 +08:00
|
|
|
DIE=1
|
|
|
|
fi
|
2004-03-22 14:47:50 +08:00
|
|
|
|
1998-02-26 19:55:07 +08:00
|
|
|
if test "$DIE" -eq 1; then
|
2002-05-28 07:13:40 +08:00
|
|
|
echo
|
|
|
|
echo "Please install/upgrade the missing tools and call me again."
|
|
|
|
echo
|
|
|
|
exit 1
|
1998-02-26 19:55:07 +08:00
|
|
|
fi
|
|
|
|
|
2002-05-28 07:13:40 +08:00
|
|
|
|
1998-12-15 11:13:46 +08:00
|
|
|
test $TEST_TYPE $FILE || {
|
2002-05-28 07:13:40 +08:00
|
|
|
echo
|
|
|
|
echo "You must run this script in the top-level $PROJECT directory."
|
|
|
|
echo
|
|
|
|
exit 1
|
1998-02-26 19:55:07 +08:00
|
|
|
}
|
|
|
|
|
2002-05-28 07:13:40 +08:00
|
|
|
|
2004-10-23 19:02:07 +08:00
|
|
|
echo
|
|
|
|
echo "I am going to run ./configure with the following arguments:"
|
|
|
|
echo
|
|
|
|
echo " --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS $@"
|
|
|
|
echo
|
|
|
|
|
1998-02-26 19:55:07 +08:00
|
|
|
if test -z "$*"; then
|
2004-10-23 19:02:07 +08:00
|
|
|
echo "If you wish to pass additional arguments, please specify them "
|
|
|
|
echo "on the $0 command line or set the AUTOGEN_CONFIGURE_ARGS "
|
|
|
|
echo "environment variable."
|
|
|
|
echo
|
1998-02-26 19:55:07 +08:00
|
|
|
fi
|
|
|
|
|
2004-07-29 02:52:40 +08:00
|
|
|
|
1998-12-24 09:11:03 +08:00
|
|
|
if test -z "$ACLOCAL_FLAGS"; then
|
|
|
|
|
2002-11-18 20:23:05 +08:00
|
|
|
acdir=`$ACLOCAL --print-ac-dir`
|
2005-01-21 02:21:41 +08:00
|
|
|
m4list="glib-2.0.m4 glib-gettext.m4 gtk-2.0.m4 intltool.m4 pkg.m4"
|
2002-05-28 07:13:40 +08:00
|
|
|
|
|
|
|
for file in $m4list
|
|
|
|
do
|
|
|
|
if [ ! -f "$acdir/$file" ]; then
|
|
|
|
echo
|
|
|
|
echo "WARNING: aclocal's directory is $acdir, but..."
|
|
|
|
echo " no file $acdir/$file"
|
|
|
|
echo " You may see fatal macro warnings below."
|
2005-01-21 02:21:41 +08:00
|
|
|
echo " If these files are installed in /some/dir, set the "
|
|
|
|
echo " ACLOCAL_FLAGS environment variable to \"-I /some/dir\""
|
|
|
|
echo " or install $acdir/$file."
|
2002-05-28 07:13:40 +08:00
|
|
|
echo
|
|
|
|
fi
|
|
|
|
done
|
1998-12-24 09:11:03 +08:00
|
|
|
fi
|
1998-12-15 11:13:46 +08:00
|
|
|
|
2004-10-17 02:20:23 +08:00
|
|
|
rm -rf autom4te.cache
|
2004-07-29 02:52:40 +08:00
|
|
|
|
2003-07-22 00:47:52 +08:00
|
|
|
$ACLOCAL $ACLOCAL_FLAGS
|
|
|
|
RC=$?
|
|
|
|
if test $RC -ne 0; then
|
2002-09-06 09:00:33 +08:00
|
|
|
echo "$ACLOCAL gave errors. Please fix the error conditions and try again."
|
2004-03-04 22:47:37 +08:00
|
|
|
exit $RC
|
2002-09-06 09:00:33 +08:00
|
|
|
fi
|
1998-09-07 03:52:22 +08:00
|
|
|
|
2004-07-29 02:52:40 +08:00
|
|
|
$LIBTOOLIZE --force || exit $?
|
2005-01-21 02:21:41 +08:00
|
|
|
|
|
|
|
if test x$enable_gtk_doc = xno; then
|
|
|
|
if test -f gtk-doc.make; then :; else
|
|
|
|
echo "EXTRA_DIST = missing-gtk-doc" > gtk-doc.make
|
|
|
|
fi
|
|
|
|
echo "WARNING: You have disabled gtk-doc."
|
|
|
|
echo " As a result, you will not be able to generate the API"
|
|
|
|
echo " documentation and 'make dist' will not work."
|
|
|
|
echo
|
|
|
|
else
|
|
|
|
gtkdocize || exit $?
|
|
|
|
fi
|
2003-02-26 20:48:48 +08:00
|
|
|
|
2001-08-28 21:04:47 +08:00
|
|
|
# optionally feature autoheader
|
2005-12-07 01:18:14 +08:00
|
|
|
($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 && $AUTOHEADER || exit 1
|
1999-01-10 14:53:30 +08:00
|
|
|
|
2004-03-04 22:47:37 +08:00
|
|
|
$AUTOMAKE --add-missing || exit $?
|
2005-12-07 01:18:14 +08:00
|
|
|
$AUTOCONF || exit $?
|
1999-01-10 14:53:30 +08:00
|
|
|
|
2008-08-12 00:15:25 +08:00
|
|
|
intltoolize --automake || exit $?
|
2002-02-23 01:35:07 +08:00
|
|
|
|
2004-07-29 02:52:40 +08:00
|
|
|
|
1999-01-10 14:53:30 +08:00
|
|
|
cd $ORIGDIR
|
1999-01-08 03:54:45 +08:00
|
|
|
|
2004-03-04 22:47:37 +08:00
|
|
|
$srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@"
|
|
|
|
RC=$?
|
|
|
|
if test $RC -ne 0; then
|
2002-11-12 11:34:11 +08:00
|
|
|
echo
|
|
|
|
echo "Configure failed or did not finish!"
|
2004-03-04 22:47:37 +08:00
|
|
|
exit $RC
|
2002-11-12 11:34:11 +08:00
|
|
|
fi
|
1998-02-26 19:55:07 +08:00
|
|
|
|
2004-03-04 22:47:37 +08:00
|
|
|
echo
|
2005-09-19 21:15:31 +08:00
|
|
|
echo "Now type 'make' to compile the $PROJECT."
|