1#! /bin/sh
2
3if glibtoolize --version >/dev/null 2>&1; then
4  LIBTOOLIZE='glibtoolize'
5else
6  LIBTOOLIZE='libtoolize'
7fi
8
9command -v command >/dev/null 2>&1 || {
10  echo "command is required, but wasn't found on this system"
11  exit 1
12}
13
14command -v $LIBTOOLIZE >/dev/null 2>&1 || {
15  echo "libtool is required, but wasn't found on this system"
16  exit 1
17}
18
19command -v autoconf >/dev/null 2>&1 || {
20  echo "autoconf is required, but wasn't found on this system"
21  exit 1
22}
23
24command -v automake >/dev/null 2>&1 || {
25  echo "automake is required, but wasn't found on this system"
26  exit 1
27}
28
29if autoreconf --version >/dev/null 2>&1; then
30  autoreconf -ivf
31else
32  $LIBTOOLIZE &&
33    aclocal &&
34    automake --add-missing --force-missing --include-deps &&
35    autoconf
36fi
37
38[ -z "$DO_NOT_UPDATE_CONFIG_SCRIPTS" ] &&
39  command -v curl >/dev/null 2>&1 && {
40  echo "Downloading config.guess and config.sub..."
41
42  curl -sL -o config.guess \
43    'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' &&
44    mv -f config.guess build-aux/config.guess
45
46  curl -sL -o config.sub \
47    'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' &&
48    mv -f config.sub build-aux/config.sub
49
50  echo "Done."
51}
52
53rm -f config.guess config.sub
54