~tangerine-developers/tangerine/trunk

« back to all changes in this revision

Viewing changes to autogen.sh

  • Committer: Alex Launi
  • Date: 2009-08-06 05:04:25 UTC
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: alex.launi@gmail.com-20090806050425-nqr1aukzkcokjc2m
modify autogen.sh and configure.ac for autofoo update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
 
3
 
# Ok, simple script to do this.
 
1
#! /bin/bash
 
2
 
 
3
function check_autotool_version () {
 
4
        which $1 &>/dev/null || {
 
5
                error "$1 is not installed, and is required to configure $PACKAGE"
 
6
        }
 
7
 
 
8
        version=$($1 --version | head -n 1 | cut -f4 -d' ')
 
9
        major=$(echo $version | cut -f1 -d.)
 
10
        minor=$(echo $version | cut -f2 -d.)
 
11
        major_check=$(echo $2 | cut -f1 -d.)
 
12
        minor_check=$(echo $2 | cut -f2 -d.)
 
13
 
 
14
        if [ $major -lt $major_check ]; then
 
15
                do_bail=yes
 
16
        elif [[ $minor -lt $minor_check && $major = $major_check ]]; then
 
17
                do_bail=yes
 
18
        fi
 
19
 
 
20
        if [ x"$do_bail" = x"yes" ]; then
 
21
                error "$1 version $2 or better is required to configure $PROJECT"
 
22
        fi
 
23
}
 
24
 
 
25
function run () {
 
26
        echo "Running $@ ..."
 
27
        $@ 2>.autogen.log || {
 
28
                cat .autogen.log 1>&2
 
29
                rm .autogen.log
 
30
                error "Could not run $1, which is required to configure $PROJECT"
 
31
        }
 
32
        rm .autogen.log
 
33
}
 
34
 
 
35
 
 
36
PROJECT=Tangerine
 
37
FILE=
 
38
CONFIGURE=configure.ac
4
39
 
5
40
: ${AUTOCONF=autoconf}
6
41
: ${AUTOHEADER=autoheader}
14
49
 
15
50
ORIGDIR=`pwd`
16
51
cd $srcdir
17
 
PROJECT=tangerine
18
52
TEST_TYPE=-f
19
 
FILE=src/EntryPoint.cs
20
 
CONFIGURE=configure.ac
21
 
aclocalinclude="-I . $ACLOCAL_FLAGS"
 
53
aclocalinclude="-I . -I m4/shamrock $ACLOCAL_FLAGS"
22
54
 
23
55
DIE=0
24
56
 
 
57
 
25
58
($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
26
59
        echo
27
60
        echo "You must have autoconf installed to compile $PROJECT."
38
71
        DIE=1
39
72
}
40
73
 
41
 
test $TEST_TYPE $FILE || {
42
 
        echo "You must run this script in the top-level $PROJECT directory"
 
74
(grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && {
 
75
  ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
 
76
    echo
 
77
    echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
 
78
    echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
 
79
    echo "(or a newer version if it is available)"
 
80
    DIE=1
 
81
  }
 
82
}
 
83
 
 
84
if test "$DIE" -eq 1; then
43
85
        exit 1
44
 
}
 
86
fi
 
87
                                                                                
 
88
#test $TEST_TYPE $FILE || {
 
89
#        echo "You must run this script in the top-level $PROJECT directory"
 
90
#        exit 1
 
91
#}
45
92
 
46
93
if test -z "$*"; then
47
94
        echo "I am going to run ./configure with no arguments - if you wish "
52
99
*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
53
100
esac
54
101
 
55
 
(grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null) && {
 
102
(grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && {
56
103
    echo "Running $LIBTOOLIZE ..."
57
104
    $LIBTOOLIZE --force --copy
58
105
}
60
107
echo "Running $ACLOCAL $aclocalinclude ..."
61
108
$ACLOCAL $aclocalinclude
62
109
 
63
 
echo "Running $AUTOMAKE --foreign $am_opt ..."
64
 
$AUTOMAKE --foreign --add-missing $am_opt
 
110
echo "Running $AUTOMAKE --gnu $am_opt ..."
 
111
$AUTOMAKE --add-missing --gnu $am_opt
65
112
 
66
113
echo "Running $AUTOCONF ..."
67
114
$AUTOCONF
68
115
 
 
116
check_autotool_version intltoolize 0.35
 
117
run intltoolize --force --copy --automake
 
118
 
69
119
echo Running $srcdir/configure $conf_flags "$@" ...
70
 
$srcdir/configure --enable-maintainer-mode $conf_flags "$@" \
71
 
 
 
120
$srcdir/configure $conf_flags "$@" \