add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / autogen.sh
1 #! /bin/sh
2
3 # Copyright (c) 2006, The gtkmm Development Team
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19
20 # Be Bourne compatible. (stolen from autoconf)
21 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
22   emulate sh
23   NULLCMD=:
24   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
25   # is contrary to our usage.  Disable this feature.
26   alias -g '${1+"$@"}'='"$@"'
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 PROJECT=gtkmm
32 MIN_AUTOMAKE_VERSION=1.9
33
34 srcdir=`dirname "$0"`
35 test -n "$srcdir" || srcdir=.
36
37 origdir=`pwd`
38 cd "$srcdir"
39
40 LIBTOOLIZE_FLAGS="--automake $LIBTOOLIZE_FLAGS"
41 ACLOCAL_FLAGS="-I scripts $ACLOCAL_FLAGS"
42 AUTOMAKE_FLAGS="--add-missing $AUTOMAKE_FLAGS"
43
44 if test "x$*$AUTOGEN_SUBDIR_MODE" = x
45 then
46   echo "I am going to run ./configure with no arguments -- if you wish"
47   echo "to pass any to it, please specify them on the $0 command line."
48 fi
49
50 libtoolize=libtoolize
51 autoconf=autoconf
52 autoheader=autoheader
53 aclocal=
54 automake=
55 auto_version=0
56
57 # awk program to transform the output of automake --version
58 # into an integer value suitable for numeric comparison.
59 extract_version='{ printf "%.0f", 1000000 * v[split($1, v, " ")] + 1000 * $2 + $3; exit }'
60
61 for suffix in -1.7 -1.8 -1.9 ""
62 do
63   aclocal_version=`aclocal$suffix --version </dev/null 2>/dev/null | awk -F. "$extract_version"`
64   automake_version=`automake$suffix --version </dev/null 2>/dev/null | awk -F. "$extract_version"`
65
66   if test "$aclocal_version" -eq "$automake_version" 2>/dev/null \
67      && test "$automake_version" -ge "$auto_version" 2>/dev/null
68   then
69     auto_version=$automake_version
70     aclocal=aclocal$suffix
71     automake=automake$suffix
72   fi
73 done
74
75 min_version=`echo "$MIN_AUTOMAKE_VERSION" | awk -F. "$extract_version"`
76
77 if test "$auto_version" -ge "$min_version" 2>/dev/null
78 then :; else
79   echo "Sorry, at least automake $MIN_AUTOMAKE_VERSION is required to configure $PROJECT."
80   exit 1
81 fi
82
83 rm -f config.guess config.sub depcomp install-sh missing mkinstalldirs
84 rm -f config.cache acconfig.h
85 rm -rf autom4te.cache
86
87 #WARNINGS=all
88 #export WARNINGS
89
90 if (set -x && set +x) >/dev/null 2>&1
91 then
92   set_xtrace=set
93 else
94   set_xtrace=:
95 fi
96
97 $set_xtrace -x
98
99 "$libtoolize" $LIBTOOLIZE_FLAGS || exit 1
100 "$aclocal" $ACLOCAL_FLAGS       || exit 1
101 #"$autoheader"                  || exit 1
102 "$automake" $AUTOMAKE_FLAGS     || exit 1
103 "$autoconf"                     || exit 1
104 cd "$origdir"                   || exit 1
105
106 if test -z "$AUTOGEN_SUBDIR_MODE"
107 then
108   "$srcdir/configure" --enable-maintainer-mode ${1+"$@"} || exit 1
109   $set_xtrace +x
110   echo
111   echo "Now type 'make' to compile $PROJECT."
112 fi
113
114 exit 0