6 # Copyright (C) 2007, 2008 Francesco Salvestrini
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 AUTOHEADER
=`which autoheader 2>/dev/null`
26 ACLOCAL
=`which aclocal 2>/dev/null`
27 AUTOCONF
=`which autoconf 2>/dev/null`
28 AUTOMAKE
=`which automake 2>/dev/null`
29 AUTORECONF
=`which autoreconf 2>/dev/null`
30 LIBTOOL
=`( which glibtool || which libtool ) 2>/dev/null`
31 LIBTOOLIZE
=`( which glibtoolize || which libtoolize) 2>/dev/null`
32 GNULIBTOOL
=`which gnulib-tool 2>/dev/null`
35 # Dump some useful informations
37 echo "$ME: Dumping build-tools information ..."
49 if test -n "$tool" ; then
50 TOOLVER
=`$tool --version | head -1`
51 echo "$ME: $tool -> $TOOLVER"
56 # Remove files left from the previous run
58 echo "$ME: Removing autotools related files and directories ..."
59 rm -f `find ./ -name "Makefile.in"` ||
exit 1
60 rm -f config.cache aclocal.
m4 config.h.
in configure ||
exit 1
61 rm -f config.guess config.sub ltmain.sh ||
exit 1
62 rm -rf autom4te.cache ||
exit 1
63 rm -rf `find ./ -name ".deps"` ||
exit 1
68 echo "$ME: Building configure.ac from configure.ac.in"
70 VERSION
=`git tag -l | sort -s -t '.' -k 1,1n -k 2,2n -k 3,3n | tail -n 1`
71 cat configure.ac.
in |
sed -e 's,[@]VERSION[@],'$VERSION',' > configure.ac || \
72 { rm -f configure.ac
; exit 1 ; }
73 chmod a-w configure.ac
78 if test -n "$GNULIBTOOL" ; then
79 $GNULIBTOOL --lgpl --no-changelog --aux-dir .
/tools
/autotools
--m4-base .
/tools
/autotools
/m4 --source-base=.
/src
/gnulib
--macro-prefix GNULIB
--no-vc-files --import crypto
/md5
crypto
/sha1 getopt ||
exit 1
85 echo "$ME: Handling autotools bootstrap ..."
87 echo "$ME: Running autoreconf ..."
88 $ACLOCAL --force --install -I .
/tools
/autotools
/m4 && \
89 $AUTORECONF --verbose --force --install -Wall ||
{