summaryrefslogtreecommitdiffstats
path: root/netdata-installer.sh
diff options
context:
space:
mode:
authorPhilip Whineray <phil@firehol.org>2016-04-09 10:48:13 +0100
committerPhilip Whineray <phil@firehol.org>2016-04-09 10:48:13 +0100
commitbbde26d52a004172e9d95367cbc82ff5128e2bca (patch)
treeed8fe73b47802272ac94f4a999d279f29d31132d /netdata-installer.sh
parentae0c07c68e75f661d53f5129916abf87d84bb23c (diff)
Replace README info with detection of autotools
This will ensure people get informed about the necessary tools and how to get the package pre-configured without requiring the readme to be modified when packaged. In addition, the script will not run autoreconf unilaterally so when people have an old version it will not attempt to overwrite the pre-existing configure script. Should solve #131 and also #93 as well as recent comments on README.md
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-xnetdata-installer.sh61
1 files changed, 59 insertions, 2 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh
index c67b72d698..ab5a2bf9bd 100755
--- a/netdata-installer.sh
+++ b/netdata-installer.sh
@@ -127,6 +127,58 @@ if [ ! "${UID}" = 0 -o "$1" = "-h" -o "$1" = "--help" ]
exit 1
fi
+have_autotools=
+if [ "$(type autoreconf 2> /dev/null)" ]
+then
+ autoconf_maj_min() {
+ local maj min IFS=.-
+
+ maj=$1
+ min=$2
+
+ set -- $(autoreconf -V | sed -ne '1s/.* \([^ ]*\)$/\1/p')
+ eval $maj=\$1 $min=\$2
+ }
+ autoconf_maj_min AMAJ AMIN
+
+ if [ "$AMAJ" -gt 2 ]
+ then
+ have_autotools=Y
+ elif [ "$AMAJ" -eq 2 -a "$AMIN" -ge 60 ]
+ then
+ have_autotools=Y
+ else
+ echo "Found autotools $AMAJ.$AMIN"
+ fi
+else
+ echo "No autotools found"
+fi
+
+if [ ! "$have_autotools" ]
+then
+ if [ -f configure ]
+ then
+ echo "Will skip autoreconf step"
+ else
+ cat <<-"EOF"
+
+ Sorry, you do not seem to have autotools 2.60 or later, which is
+ required to build from the git sources of netdata.
+
+ You can either install a suitable version of autotools and automake
+ or download a netdata package which does not have these dependencies.
+
+ Source packages where autotools have already been run are available
+ here:
+ https://firehol.org/download/netdata/
+
+ The unsigned/master folder tracks the head of the git tree and released
+ packages are also available.
+ EOF
+ exit 1
+ fi
+fi
+
if [ ${DONOTWAIT} -eq 0 ]
then
if [ ! -z "${NETDATA_PREFIX}" ]
@@ -155,6 +207,8 @@ You many need to check these:
gcc make autoconf automake pkg-config
+ Autoconf version 2.60 or higher is required
+
3. If your system cannot find ZLIB, although it is installed
run me with the option: --zlib-is-really-here
@@ -189,8 +243,11 @@ fi
trap build_error EXIT
-echo >&2 "Running ./autogen.sh ..."
-run ./autogen.sh || exit 1
+if [ "$have_autotools" ]
+then
+ echo >&2 "Running ./autogen.sh ..."
+ run ./autogen.sh || exit 1
+fi
echo >&2 "Running ./configure ..."
run ./configure \