summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorJames Dominic P. Guana <guana.histark@gmail.com>2020-05-26 18:53:49 +0800
committerRobert Roth <robert.roth.off@gmail.com>2020-11-04 13:38:03 +0000
commit7396970afe2290488fd072612a650353dd13a16d (patch)
tree4600f2a3144f25a578138164f85ef91c70aecfc3 /autogen.sh
parent9cbb3b91f11ad0c4944a1428d609201c054cffab (diff)
downloadlibgtop-7396970afe2290488fd072612a650353dd13a16d.tar.gz
Code clean up and add example
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
index 9d394bff..ab75b974 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,5 +1,33 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+
+case "$(uname -s)" in
+ Linux)
+ if ! [ -x "$(command -v lsblk)" ]; then
+ echo '' >&2
+ echo -e "${RED}*** ERROR:${NC} lsblk cannot be found. Try installing util-linux or util-linux-ng ${RED}***${NC}" >&2
+ echo '' >&2
+ exit 1
+ fi
+ if ! [ -x "$(command -v sed)" ]; then
+ echo '' >&2
+ echo -e "${RED}*** ERROR:${NC} sed cannot be found. ***" >&2
+ echo '' >&2
+ exit 1
+ fi
+ if ! [ -x "$(command -v tr)" ]; then
+ echo '' >&2
+ echo -e "${RED}*** ERROR:${NC} tr cannot be found. ***" >&2
+ echo '' >&2
+ exit 1
+ fi
+ ;;
+ *)
+ ;;
+esac
+
test -n "$srcdir" || srcdir=$(dirname "$0")
test -n "$srcdir" || srcdir=.