3 # This script does all the magic calls to automake/autoconf and
4 # friends that are needed to configure a git clone. As described in
5 # the file HACKING you need a couple of extra tools to run this script
8 # If you are compiling from a released tarball you don't need these
9 # tools and you shouldn't use this script. Just call ./configure
12 ACLOCAL
=${ACLOCAL-aclocal-1.13}
13 AUTOCONF
=${AUTOCONF-autoconf}
14 AUTOHEADER
=${AUTOHEADER-autoheader}
15 AUTOMAKE
=${AUTOMAKE-automake-1.13}
16 LIBTOOLIZE
=${LIBTOOLIZE-libtoolize}
18 AUTOCONF_REQUIRED_VERSION
=2.54
19 AUTOMAKE_REQUIRED_VERSION
=1.13.0
20 INTLTOOL_REQUIRED_VERSION
=0.40.1
21 LIBTOOL_REQUIRED_VERSION
=1.5
22 LIBTOOL_WIN32_REQUIRED_VERSION
=2.2
25 PROJECT
="GNU Image Manipulation Program"
31 test -z "$srcdir" && srcdir
=.
43 set dummy
$VERSION_A 0 0 0
47 set dummy
$VERSION_B 0 0 0
53 if expr "$MAJOR_A" = "$MAJOR_B" > /dev
/null
; then
54 if expr "$MINOR_A" \
> "$MINOR_B" > /dev
/null
; then
55 echo "yes (version $VERSION_A)"
56 elif expr "$MINOR_A" = "$MINOR_B" > /dev
/null
; then
57 if expr "$MICRO_A" \
>= "$MICRO_B" > /dev
/null
; then
58 echo "yes (version $VERSION_A)"
60 echo "Too old (version $VERSION_A)"
64 echo "Too old (version $VERSION_A)"
67 elif expr "$MAJOR_A" \
> "$MAJOR_B" > /dev
/null
; then
68 echo "Major version might be too new ($VERSION_A)"
70 echo "Too old (version $VERSION_A)"
76 echo "I am testing that you have the tools required to build the"
77 echo "$PROJECT from git. This test is not foolproof,"
78 echo "so if anything goes wrong, see the file HACKING for more information..."
86 echo "Looks like Win32, you will need libtool $LIBTOOL_WIN32_REQUIRED_VERSION or newer."
88 LIBTOOL_REQUIRED_VERSION
=$LIBTOOL_WIN32_REQUIRED_VERSION
92 printf "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... "
93 if ($LIBTOOLIZE --version) < /dev
/null
> /dev
/null
2>&1; then
94 LIBTOOLIZE
=$LIBTOOLIZE
95 elif (glibtoolize
--version) < /dev
/null
> /dev
/null
2>&1; then
96 LIBTOOLIZE
=glibtoolize
99 echo " You must have libtool installed to compile $PROJECT."
100 echo " Install the appropriate package for your distribution,"
101 echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
106 if test x
$LIBTOOLIZE != x
; then
107 VER
=`$LIBTOOLIZE --version \
108 | grep libtool | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
109 check_version
$VER $LIBTOOL_REQUIRED_VERSION
112 # check if gtk-doc is explicitly disabled
113 for ag_option
in $AUTOGEN_CONFIGURE_ARGS $@
116 -disable-gtk-doc |
--disable-gtk-doc)
122 if test x
$enable_gtk_doc = xno
; then
123 echo "skipping test for gtkdocize"
125 printf "checking for gtkdocize ... "
126 if (gtkdocize
--version) < /dev
/null
> /dev
/null
2>&1; then
130 echo " You must have gtk-doc installed to compile $PROJECT."
131 echo " Install the appropriate package for your distribution,"
132 echo " or get the source tarball at"
133 echo " https://ftp.gnome.org/pub/GNOME/sources/gtk-doc/"
134 echo " You can also use the option --disable-gtk-doc to skip"
135 echo " this test but then you will not be able to generate a"
136 echo " configure script that can build the API documentation."
141 printf "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
142 if ($AUTOCONF --version) < /dev
/null
> /dev
/null
2>&1; then
143 VER
=`$AUTOCONF --version | head -n 1 \
144 | grep -iw autoconf | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
145 check_version
$VER $AUTOCONF_REQUIRED_VERSION
148 echo " You must have autoconf installed to compile $PROJECT."
149 echo " Download the appropriate package for your distribution,"
150 echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/"
156 printf "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
157 if ($AUTOMAKE --version) < /dev
/null
> /dev
/null
2>&1; then
160 elif (automake-1.16
--version) < /dev
/null
> /dev
/null
2>&1; then
161 AUTOMAKE
=automake-1.16
163 elif (automake-1.15
--version) < /dev
/null
> /dev
/null
2>&1; then
164 AUTOMAKE
=automake-1.15
166 elif (automake-1.14
--version) < /dev
/null
> /dev
/null
2>&1; then
167 AUTOMAKE
=automake-1.14
169 elif (automake-1.13
--version) < /dev
/null
> /dev
/null
2>&1; then
170 AUTOMAKE
=automake-1.13
172 elif (automake
--version) < /dev
/null
> /dev
/null
2>&1; then
177 echo " You must have automake $AUTOMAKE_REQUIRED_VERSION or newer installed to compile $PROJECT."
178 echo " Download the appropriate package for your distribution,"
179 echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
184 if test x
$AUTOMAKE != x
; then
185 VER
=`$AUTOMAKE --version \
186 | grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
187 check_version
$VER $AUTOMAKE_REQUIRED_VERSION
191 printf "checking for intltool >= $INTLTOOL_REQUIRED_VERSION ... "
192 if (intltoolize
--version) < /dev
/null
> /dev
/null
2>&1; then
193 VER
=`intltoolize --version \
194 | grep intltoolize | sed "s/.* \([0-9.]*\)/\1/"`
195 check_version
$VER $INTLTOOL_REQUIRED_VERSION
198 echo " You must have intltool installed to compile $PROJECT."
199 echo " Get the latest version from"
200 echo " ftp://ftp.gnome.org/pub/GNOME/sources/intltool/"
206 printf "checking for xsltproc ... "
207 if (xsltproc
--version) < /dev
/null
> /dev
/null
2>&1; then
211 echo " You must have xsltproc installed to compile $PROJECT."
212 echo " Get the latest version from"
213 echo " ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/"
218 if test "$DIE" -eq 1; then
220 echo "Please install/upgrade the missing tools and call me again."
226 test $TEST_TYPE $FILE ||
{
228 echo "You must run this script in the top-level $PROJECT directory."
234 if test -z "$NOCONFIGURE"; then
236 echo "I am going to run ./configure with the following arguments:"
238 echo " $AUTOGEN_CONFIGURE_ARGS $@"
241 if test -z "$*"; then
242 echo "If you wish to pass additional arguments, please specify them "
243 echo "on the $0 command line or set the AUTOGEN_CONFIGURE_ARGS "
244 echo "environment variable."
250 if test -z "$ACLOCAL_FLAGS"; then
252 acdir
=`$ACLOCAL --print-ac-dir`
253 m4list
="glib-2.0.m4 glib-gettext.m4 gtk-2.0.m4 intltool.m4 pkg.m4"
257 if [ ! -f "$acdir/$file" ]; then
259 echo "WARNING: aclocal's directory is $acdir, but..."
260 echo " no file $acdir/$file"
261 echo " You may see fatal macro warnings below."
262 echo " If these files are installed in /some/dir, set the "
263 echo " ACLOCAL_FLAGS environment variable to \"-I /some/dir\""
264 echo " or install $acdir/$file."
270 rm -rf autom4te.cache
272 $ACLOCAL $ACLOCAL_FLAGS
274 if test $RC -ne 0; then
275 echo "$ACLOCAL gave errors. Please fix the error conditions and try again."
279 $LIBTOOLIZE --force ||
exit $?
281 if test x
$enable_gtk_doc = xno
; then
282 if test -f gtk-doc.
make; then :; else
283 echo "EXTRA_DIST = missing-gtk-doc" > gtk-doc.
make
285 echo "WARNING: You have disabled gtk-doc."
286 echo " As a result, you will not be able to generate the API"
287 echo " documentation and 'make dist' will not work."
293 # optionally feature autoheader
294 ($AUTOHEADER --version) < /dev
/null
> /dev
/null
2>&1 && $AUTOHEADER ||
exit 1
296 $AUTOMAKE --add-missing ||
exit $?
299 intltoolize
--automake ||
exit $?
304 if test -z "$NOCONFIGURE"; then
305 $srcdir/configure
$AUTOGEN_CONFIGURE_ARGS "$@"
307 if test $RC -ne 0; then
309 echo "Configure failed or did not finish!"
314 echo "Now type 'make' to compile the $PROJECT."