From 1526cb77eea9895239218f0b73b33388524f1153 Mon Sep 17 00:00:00 2001
From: "Austin S. Hemmelgarn" <austin@netdata.cloud>
Date: Tue, 8 Dec 2020 11:51:46 -0500
Subject: [PATCH] Use `glibtoolize` on macOS instead of regular `libtoolize`.
 (#10346)

* Use `glibtoolize` on macOS instead of regular `libtoolize`.

This ensures we get the version from Homebrew instead of the version
from XCode.

* Update install documentation for macOS.
---
 netdata-installer.sh                 | 7 ++++++-
 packaging/installer/methods/macos.md | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/netdata-installer.sh b/netdata-installer.sh
index 3eb9b433a6..c812b36ca4 100755
--- a/netdata-installer.sh
+++ b/netdata-installer.sh
@@ -716,13 +716,18 @@ bundle_libwebsockets
 
 build_judy() {
   local env_cmd=''
+  local libtoolize="libtoolize"
 
   if [ -z "${DONT_SCRUB_CFLAGS_EVEN_THOUGH_IT_MAY_BREAK_THINGS}" ]; then
     env_cmd="env CFLAGS=-fPIC CXXFLAGS= LDFLAGS="
   fi
 
+  if [ "$(uname)" = "Darwin" ]; then
+    libtoolize="glibtoolize"
+  fi
+
   pushd "${1}" > /dev/null || return 1
-  if run ${env_cmd} libtoolize --force --copy &&
+  if run ${env_cmd} ${libtoolize} --force --copy &&
     run ${env_cmd} aclocal &&
     run ${env_cmd} autoheader &&
     run ${env_cmd} automake --add-missing --force --copy --include-deps &&
diff --git a/packaging/installer/methods/macos.md b/packaging/installer/methods/macos.md
index 1225dc38b1..d8eb94333e 100644
--- a/packaging/installer/methods/macos.md
+++ b/packaging/installer/methods/macos.md
@@ -53,7 +53,7 @@ Click **Install** on the Software Update popup window that appears. Then, use th
 to install some of Netdata's prerequisites.
 
 ```bash
-brew install ossp-uuid autoconf automake pkg-config libuv lz4 json-c openssl@1.1
+brew install ossp-uuid autoconf automake pkg-config libuv lz4 json-c openssl@1.1 libtool
 ```
 
 If you want to use the [database engine](/database/engine/README.md) to store your metrics, you need to download