Cleanup comments etc. in src
[gimp-lqr-plugin.git] / autogen.sh
blob350050a58ec4bc4f5e338c414c4b1de3018c1556
1 #!/bin/sh
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.
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.
11 PROJECT="GIMP Liquid Rescale Plug-In"
12 TEST_TYPE=-f
13 FILE=src/render.c
15 AUTOCONF_REQUIRED_VERSION=2.54
16 AUTOMAKE_REQUIRED_VERSION=1.6
17 GLIB_REQUIRED_VERSION=2.0.0
18 INTLTOOL_REQUIRED_VERSION=0.17
20 srcdir=`dirname $0`
21 test -z "$srcdir" && srcdir=.
22 ORIGDIR=`pwd`
23 cd $srcdir
25 check_version ()
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
35 echo
36 echo "I am testing that you have the required versions of autoconf,"
37 echo "automake, glib-gettextize and intltoolize..."
38 echo
40 DIE=0
42 echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
43 if (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
47 else
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;
55 echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
56 if (automake-1.7 --version) < /dev/null > /dev/null 2>&1; then
57 AUTOMAKE=automake-1.7
58 ACLOCAL=aclocal-1.7
59 elif (automake-1.8 --version) < /dev/null > /dev/null 2>&1; then
60 AUTOMAKE=automake-1.8
61 ACLOCAL=aclocal-1.8
62 elif (automake-1.9 --version) < /dev/null > /dev/null 2>&1; then
63 AUTOMAKE=automake-1.9
64 ACLOCAL=aclocal-1.9
65 elif (automake-1.10 --version) < /dev/null > /dev/null 2>&1; then
66 AUTOMAKE=automake-1.10
67 ACLOCAL=aclocal-1.10
68 elif (automake-1.11 --version) < /dev/null > /dev/null 2>&1; then
69 AUTOMAKE=automake-1.11
70 ACLOCAL=aclocal-1.11
71 elif (automake-1.6 --version) < /dev/null > /dev/null 2>&1; then
72 AUTOMAKE=automake-1.6
73 ACLOCAL=aclocal-1.6
74 else
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
82 if 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
88 echo -n "checking for glib-gettextize >= $GLIB_REQUIRED_VERSION ... "
89 if (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
93 else
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
101 echo -n "checking for intltool >= $INTLTOOL_REQUIRED_VERSION ... "
102 if (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
106 else
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
114 if test "$DIE" -eq 1; then
115 echo
116 echo "Please install/upgrade the missing tools and call me again."
117 echo
118 exit 1
122 test $TEST_TYPE $FILE || {
123 echo
124 echo "You must run this script in the top-level $PROJECT directory."
125 echo
126 exit 1
130 echo
131 echo "I am going to run ./configure with the following arguments:"
132 echo
133 echo " --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS $@"
134 echo
136 if 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
143 if test -z "$ACLOCAL_FLAGS"; then
145 acdir=`$ACLOCAL --print-ac-dir`
146 m4list="glib-gettext.m4 intltool.m4"
148 for file in $m4list
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
160 done
163 rm -rf autom4te.cache
165 $ACLOCAL $ACLOCAL_FLAGS
166 RC=$?
167 if test $RC -ne 0; then
168 echo "$ACLOCAL gave errors. Please fix the error conditions and try again."
169 exit 1
172 # optionally feature autoheader
173 (autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader || exit 1
175 $AUTOMAKE --add-missing || exit 1
176 autoconf || exit 1
178 glib-gettextize --copy --force || exit 1
179 intltoolize --copy --force --automake || exit 1
181 cd $ORIGDIR
183 $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@"
184 RC=$?
185 if test $RC -ne 0; then
186 echo
187 echo "Configure failed or did not finish!"
188 exit $RC
191 echo
192 echo "Now type 'make' to compile $PROJECT."