1#!/bin/sh
2
3# This script does all the magic calls to automake/autoconf and
4# friends that are needed to configure a cvs checkout.  You need a
5# couple of extra tools to run this script successfully.
6#
7# If you are compiling from a released tarball you don't need these
8# tools and you shouldn't use this script.  Just call ./configure
9# directly.
10
11PROJECT="GIMP Liquid Rescale Plug-In"
12TEST_TYPE=-f
13FILE=src/render.c
14
15AUTOCONF_REQUIRED_VERSION=2.54
16AUTOMAKE_REQUIRED_VERSION=1.6
17GLIB_REQUIRED_VERSION=2.0.0
18INTLTOOL_REQUIRED_VERSION=0.17
19
20srcdir=`dirname $0`
21test -z "$srcdir" && srcdir=.
22ORIGDIR=`pwd`
23cd $srcdir
24
25check_version ()
26{
27    if expr $1 \>= $2 > /dev/null; then
28	echo "yes (version $1)"
29    else
30	echo "Too old (found version $1)!"
31	DIE=1
32    fi
33}
34
35echo
36echo "I am testing that you have the required versions of autoconf,"
37echo "automake, glib-gettextize and intltoolize..."
38echo
39
40DIE=0
41
42echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
43if (autoconf --version) < /dev/null > /dev/null 2>&1; then
44    VER=`autoconf --version \
45         | grep -iw autoconf | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
46    check_version $VER $AUTOCONF_REQUIRED_VERSION
47else
48    echo
49    echo "  You must have autoconf installed to compile $PROJECT."
50    echo "  Download the appropriate package for your distribution,"
51    echo "  or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
52    DIE=1;
53fi
54
55echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
56if (automake-1.7 --version) < /dev/null > /dev/null 2>&1; then
57   AUTOMAKE=automake-1.7
58   ACLOCAL=aclocal-1.7
59elif (automake-1.8 --version) < /dev/null > /dev/null 2>&1; then
60   AUTOMAKE=automake-1.8
61   ACLOCAL=aclocal-1.8
62elif (automake-1.9 --version) < /dev/null > /dev/null 2>&1; then
63   AUTOMAKE=automake-1.9
64   ACLOCAL=aclocal-1.9
65elif (automake-1.10 --version) < /dev/null > /dev/null 2>&1; then
66   AUTOMAKE=automake-1.10
67   ACLOCAL=aclocal-1.10
68elif (automake-1.11 --version) < /dev/null > /dev/null 2>&1; then
69   AUTOMAKE=automake-1.11
70   ACLOCAL=aclocal-1.11
71elif (automake-1.6 --version) < /dev/null > /dev/null 2>&1; then
72   AUTOMAKE=automake-1.6
73   ACLOCAL=aclocal-1.6
74else
75    echo
76    echo "  You must have automake 1.6 or newer installed to compile $PROJECT."
77    echo "  Download the appropriate package for your distribution,"
78    echo "  or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
79    DIE=1
80fi
81
82if test x$AUTOMAKE != x; then
83    VER=`$AUTOMAKE --version \
84         | grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
85    check_version $VER $AUTOMAKE_REQUIRED_VERSION
86fi
87
88echo -n "checking for glib-gettextize >= $GLIB_REQUIRED_VERSION ... "
89if (glib-gettextize --version) < /dev/null > /dev/null 2>&1; then
90    VER=`glib-gettextize --version \
91         | grep glib-gettextize | sed "s/.* \([0-9.]*\)/\1/"`
92    check_version $VER $GLIB_REQUIRED_VERSION
93else
94    echo
95    echo "  You must have glib-gettextize installed to compile $PROJECT."
96    echo "  glib-gettextize is part of glib-2.0, so you should already"
97    echo "  have it. Make sure it is in your PATH."
98    DIE=1
99fi
100
101echo -n "checking for intltool >= $INTLTOOL_REQUIRED_VERSION ... "
102if (intltoolize --version) < /dev/null > /dev/null 2>&1; then
103    VER=`intltoolize --version \
104         | grep intltoolize | sed "s/.* \([0-9.]*\)/\1/"`
105    check_version $VER $INTLTOOL_REQUIRED_VERSION
106else
107    echo
108    echo "  You must have intltool installed to compile $PROJECT."
109    echo "  Get the latest version from"
110    echo "  ftp://ftp.gnome.org/pub/GNOME/sources/intltool/"
111    DIE=1
112fi
113
114if test "$DIE" -eq 1; then
115    echo
116    echo "Please install/upgrade the missing tools and call me again."
117    echo
118    exit 1
119fi
120
121
122test $TEST_TYPE $FILE || {
123    echo
124    echo "You must run this script in the top-level $PROJECT directory."
125    echo
126    exit 1
127}
128
129
130echo
131echo "I am going to run ./configure with the following arguments:"
132echo
133echo "  --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS $@"
134echo
135
136if test -z "$*"; then
137    echo "If you wish to pass additional arguments, please specify them "
138    echo "on the $0 command line or set the AUTOGEN_CONFIGURE_ARGS "
139    echo "environment variable."
140    echo
141fi
142
143if test -z "$ACLOCAL_FLAGS"; then
144
145    acdir=`$ACLOCAL --print-ac-dir`
146    m4list="glib-gettext.m4 intltool.m4"
147
148    for file in $m4list
149    do
150	if [ ! -f "$acdir/$file" ]; then
151	    echo
152	    echo "WARNING: aclocal's directory is $acdir, but..."
153            echo "         no file $acdir/$file"
154            echo "         You may see fatal macro warnings below."
155            echo "         If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
156            echo "         environment variable to \"-I /some/dir\", or install"
157            echo "         $acdir/$file."
158            echo
159        fi
160    done
161fi
162
163rm -rf autom4te.cache
164
165$ACLOCAL $ACLOCAL_FLAGS
166RC=$?
167if test $RC -ne 0; then
168   echo "$ACLOCAL gave errors. Please fix the error conditions and try again."
169   exit 1
170fi
171
172# optionally feature autoheader
173(autoheader --version)  < /dev/null > /dev/null 2>&1 && autoheader || exit 1
174
175$AUTOMAKE --add-missing || exit 1
176autoconf || exit 1
177
178glib-gettextize --copy --force || exit 1
179intltoolize --copy --force --automake || exit 1
180
181cd $ORIGDIR
182
183$srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@"
184RC=$?
185if test $RC -ne 0; then
186  echo
187  echo "Configure failed or did not finish!"
188  exit $RC
189fi
190
191echo
192echo "Now type 'make' to compile $PROJECT."
193