aboutsummaryrefslogtreecommitdiff
path: root/autogen.sh
blob: 34b69786a05babca9bd12a02007e895f0ca6138b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

DIE=0

(autoreconf --version) < /dev/null > /dev/null 2>&1 || {
	echo
	echo "You must have autoconf installed to compile this package."
	echo "Download the appropriate package for your distribution,"
	echo "or see http://www.gnu.org/software/autoconf"
	DIE=1
}

(libtoolize --version) < /dev/null > /dev/null 2>&1 ||
(glibtoolize --version) < /dev/null > /dev/null 2>&1 || {
	echo
	echo "You must have libtool installed to compile this package."
	echo "Download the appropriate package for your distribution,"
	echo "or see http://www.gnu.org/software/libtool"
	DIE=1
}

(automake --version) < /dev/null > /dev/null 2>&1 || {
	echo
	echo "You must have automake installed to compile this package."
	echo "Download the appropriate package for your distribution,"
	echo "or see http://www.gnu.org/software/automake"
	DIE=1
}

if ! test -f "$(aclocal --print-ac-dir)"/pkg.m4; then
	echo
	echo "You must have pkg-config installed to compile this package."
	echo "Download the appropriate package for your distribution,"
	echo "or see https://www.freedesktop.org/wiki/Software/pkg-config/"
	DIE=1
fi

if test "$DIE" -eq 1; then
	exit 1
fi

autoreconf --force --install --symlink

if ! grep -q pkg.m4 aclocal.m4; then
	cat <<EOF
Couldn't find pkg.m4 from pkg-config. Install the appropriate package for
your distribution or set ACLOCAL_PATH to the directory containing pkg.m4.
EOF
	exit 1
fi