~haakan/do-plugins/sshfix

360 by Christopher Halse Rogers
Revert buildsystem to previously working autofoo
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=gnome-do-plugins
39.1.7 by Jason Smith
Make build system sane
37
FILE=
38
CONFIGURE=configure.ac
39
40
: ${AUTOCONF=autoconf}
41
: ${AUTOHEADER=autoheader}
42
: ${AUTOMAKE=automake}
43
: ${LIBTOOLIZE=libtoolize}
44
: ${ACLOCAL=aclocal}
45
: ${LIBTOOL=libtool}
46
47
srcdir=`dirname $0`
48
test -z "$srcdir" && srcdir=.
49
50
ORIGDIR=`pwd`
51
cd $srcdir
52
TEST_TYPE=-f
360 by Christopher Halse Rogers
Revert buildsystem to previously working autofoo
53
aclocalinclude="-I . -I m4/shamrock $ACLOCAL_FLAGS"
39.1.7 by Jason Smith
Make build system sane
54
55
DIE=0
56
360 by Christopher Halse Rogers
Revert buildsystem to previously working autofoo
57
39.1.7 by Jason Smith
Make build system sane
58
($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
59
        echo
60
        echo "You must have autoconf installed to compile $PROJECT."
61
        echo "Download the appropriate package for your distribution,"
62
        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
63
        DIE=1
64
}
65
66
($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
67
        echo
68
        echo "You must have automake installed to compile $PROJECT."
69
        echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz"
70
        echo "(or a newer version if it is available)"
71
        DIE=1
72
}
73
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
85
        exit 1
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
#}
92
93
if test -z "$*"; then
94
        echo "I am going to run ./configure with no arguments - if you wish "
95
        echo "to pass any to it, please specify them on the $0 command line."
96
fi
97
98
case $CC in
99
*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
100
esac
101
102
(grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && {
103
    echo "Running $LIBTOOLIZE ..."
104
    $LIBTOOLIZE --force --copy
105
}
106
107
echo "Running $ACLOCAL $aclocalinclude ..."
108
$ACLOCAL $aclocalinclude
109
110
echo "Running $AUTOMAKE --gnu $am_opt ..."
111
$AUTOMAKE --add-missing --gnu $am_opt
112
113
echo "Running $AUTOCONF ..."
114
$AUTOCONF
115
360 by Christopher Halse Rogers
Revert buildsystem to previously working autofoo
116
check_autotool_version intltoolize 0.35
117
run intltoolize --force --copy --automake
118
39.1.7 by Jason Smith
Make build system sane
119
echo Running $srcdir/configure $conf_flags "$@" ...
120
$srcdir/configure --enable-maintainer-mode $conf_flags "$@" \