First commit to fresh new hip git repo for Conky.
[monky] / autogen.sh
1 #!/bin/sh
2 #
3 # Conky, a system monitor, based on torsmo
4 #
5 # Any original torsmo code is licensed under the BSD license
6 #
7 # All code written since the fork of torsmo is licensed under the GPL
8 #
9 # Please see COPYING for details
10 #
11 # Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
12 # Copyright (c) 2005-2007 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
13 # All rights reserved.
14 #
15 # This program is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU General Public License as published by
17 # the Free Software Foundation, either version 3 of the License, or
18 # (at your option) any later version.
19 #
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
26 #
27 # $Id$
28 #
29 # optional $1 = optional directory containing build tree or git working copy
30
31 AUTOCONF=${AUTOCONF:-autoconf}
32 AUTOMAKE=${AUTOMAKE:-automake}
33 ACLOCAL=${ACLOCAL:-aclocal}
34 AUTOHEADER=${AUTOHEADER:-autoheader}
35 LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
36
37 # identify a git revision similar to svn based on number of commits, if a git
38 # working copy.  the last svn commit was rev 1274, so we'll pick up from there
39 if test "$1" != "" && test -d "$1/.git"; then
40     revision=`git log --since=2008-12-06 --pretty=oneline | wc -l | awk '{print $1 + 1274}'`;
41 elif test -d ".git"; then
42     revision=`git log --since=2008-12-06 --pretty=oneline | wc -l | awk '{print $1 + 1274}'`;
43 else
44     revision="NONE"; fi
45
46 # generate configure.ac with substituted git revision
47 sed -e "s/@REVISION@/${revision}/g" < "configure.ac.in" > "configure.ac"
48
49 echo Running $ACLOCAL -I m4 ... && $ACLOCAL -I m4
50 echo Running $LIBTOOLIZE --force --copy ... && $LIBTOOLIZE --force --copy
51 echo Running $AUTOHEADER ... && $AUTOHEADER
52 echo Running $AUTOMAKE --add-missing --copy --gnu ... && $AUTOMAKE --add-missing --copy --gnu
53 echo Running $AUTOCONF ... && $AUTOCONF