forked from craigcabrey/luminance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·58 lines (44 loc) · 1.51 KB
/
autogen.sh
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
51
52
53
54
55
56
57
58
#!/bin/sh
set -e
chmod +x $0
AUTORECONF=${AUTORECONF:-autoreconf}
ACLOCAL=${ACLOCAL:-aclocal}
AUTOCONF=${AUTOCONF:-autoconf}
AUTOHEADER=${AUTOHEADER:-autoheader}
AUTOMAKE=${AUTOMAKE:-automake}
# Check we have all tools installed
check_command() {
command -v "${1}" > /dev/null 2>&1 || {
>&2 echo "autogen.sh: could not find \`$1'. \`$1' is required to run autogen.sh."
exit 1
}
}
check_command "$AUTORECONF"
check_command "$ACLOCAL"
check_command "$AUTOCONF"
check_command "$AUTOHEADER"
check_command "$AUTOMAKE"
# Absence of pkg-config or misconfiguration can make some odd error
# messages, we check if it is installed correctly. See:
# https://blogs.oracle.com/mandy/entry/autoconf_weirdness
#
# We cannot just check for pkg-config command, we need to check for
# PKG_* macros. The pkg-config command can be defined in ./configure,
# we cannot tell anything when not present.
check_pkg_config() {
grep -q '^AC_DEFUN.*PKG_CHECK_MODULES' aclocal.m4 || {
cat <<EOF >&2
autogen.sh: could not find PKG_CHECK_MODULES macro.
Either pkg-config is not installed on your system or
\`pkg.m4' is missing or not found by aclocal.
If \`pkg.m4' is installed at an unusual location, re-run
\`autogen.sh' by setting \`ACLOCAL_FLAGS':
ACLOCAL_FLAGS="-I <prefix>/share/aclocal" ./autogen.sh
EOF
exit 1
}
}
echo "autogen.sh: reconfigure with autoreconf"
${AUTORECONF} -vif -I m4 || echo "autogen.sh: autoreconf has failed ($?)!"
echo "autogen.sh: for the next step, run ./configure"
exit 0