Removed inlines
[liblqr.git] / autogen.sh
blob32f5e20364ae2f3e1304e180239e6aecdfbd0b65
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="LiquidRescale library"
12 TEST_TYPE=-f
13 FILE=lqr/lqr_carver.c
15 AUTOCONF_REQUIRED_VERSION=2.54
16 AUTOMAKE_REQUIRED_VERSION=1.6
17 GLIB_REQUIRED_VERSION=2.0.0
18 LIBTOOL_REQUIRED_VERSION=1.5.24
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 and libtoolize..."
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.6 --version) < /dev/null > /dev/null 2>&1; then
69 AUTOMAKE=automake-1.6
70 ACLOCAL=aclocal-1.6
71 else
72 echo
73 echo " You must have automake 1.6 or newer installed to compile $PROJECT."
74 echo " Download the appropriate package for your distribution,"
75 echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
76 DIE=1
79 if test x$AUTOMAKE != x; then
80 VER=`$AUTOMAKE --version \
81 | grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
82 check_version $VER $AUTOMAKE_REQUIRED_VERSION
85 echo -n "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... "
86 if (libtoolize --version) < /dev/null > /dev/null 2>&1; then
87 VER=`libtoolize --version \
88 | grep libtoolize | sed "s/.* \([0-9.]*\)/\1/"`
89 check_version $VER $LIBTOOL_REQUIRED_VERSION
90 else
91 echo
92 echo " You must have libtool installed to compile $PROJECT."
93 echo " Get the latest version from"
94 echo " ???"
95 DIE=1
99 if test "$DIE" -eq 1; then
100 echo
101 echo "Please install/upgrade the missing tools and call me again."
102 echo
103 exit 1
107 test $TEST_TYPE $FILE || {
108 echo
109 echo "You must run this script in the top-level $PROJECT directory."
110 echo
111 exit 1
115 echo
116 echo "I am going to run ./configure with the following arguments:"
117 echo
118 echo " --enable-maintainer-mode --enable-install-man $AUTOGEN_CONFIGURE_ARGS $@"
119 echo
121 if test -z "$*"; then
122 echo "If you wish to pass additional arguments, please specify them "
123 echo "on the $0 command line or set the AUTOGEN_CONFIGURE_ARGS "
124 echo "environment variable."
125 echo
128 if test -z "$ACLOCAL_FLAGS"; then
130 acdir=`$ACLOCAL --print-ac-dir`
131 m4list="glib-gettext.m4 intltool.m4"
133 for file in $m4list
135 if [ ! -f "$acdir/$file" ]; then
136 echo
137 echo "WARNING: aclocal's directory is $acdir, but..."
138 echo " no file $acdir/$file"
139 echo " You may see fatal macro warnings below."
140 echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
141 echo " environment variable to \"-I /some/dir\", or install"
142 echo " $acdir/$file."
143 echo
145 done
148 rm -rf autom4te.cache
150 $ACLOCAL $ACLOCAL_FLAGS
151 RC=$?
152 if test $RC -ne 0; then
153 echo "$ACLOCAL gave errors. Please fix the error conditions and try again."
154 exit 1
157 # optionally feature autoheader
158 (autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader || exit 1
160 $AUTOMAKE --add-missing --copy || exit 1
161 autoconf || exit 1
163 libtoolize --force --copy --install || exit 1
165 cd $ORIGDIR
167 $srcdir/configure --enable-maintainer-mode --enable-install-man $AUTOGEN_CONFIGURE_ARGS "$@"
168 RC=$?
169 if test $RC -ne 0; then
170 echo
171 echo "Configure failed or did not finish!"
172 exit $RC
175 echo
176 echo "Now type 'make' to compile $PROJECT."