Fix for segfault in top_name stuff.
[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-2010 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 # optional $1 = optional directory containing build tree or git working copy
28
29 AUTOCONF=${AUTOCONF:-autoconf}
30 AUTOMAKE=${AUTOMAKE:-automake}
31 ACLOCAL=${ACLOCAL:-aclocal}
32 AUTOHEADER=${AUTOHEADER:-autoheader}
33 LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
34
35 # identify a git revision similar to svn based on number of commits, if a git
36 # working copy.  the last svn commit was rev 1274, so we'll pick up from there
37 if test "$1" != "" && test -d "$1/.git"; then
38     revision=`git log --since=2008-12-06 --pretty=oneline | wc -l | awk '{print $1 + 1274}'`;
39 elif test -d ".git"; then
40     revision=`git log --since=2008-12-06 --pretty=oneline | wc -l | awk '{print $1 + 1274}'`;
41 else
42     revision="NONE"; fi
43
44 # generate configure.ac with substituted git revision
45 sed -e "s/@REVISION@/${revision}/g" < "configure.ac.in" > "configure.ac"
46
47 touch README # in case it doesn't exist
48 echo Running $ACLOCAL -I m4 ... && $ACLOCAL -I m4
49 echo Running $LIBTOOLIZE --force --copy ... && $LIBTOOLIZE --force --copy
50 echo Running $AUTOHEADER ... && $AUTOHEADER
51 echo Running $AUTOMAKE --add-missing --copy --gnu ... && $AUTOMAKE --add-missing --copy --gnu
52 echo Running $AUTOCONF ... && $AUTOCONF