From 1d2114cbe023bfedaaaabe011938d71603039beb Mon Sep 17 00:00:00 2001 From: Simon Bauer Date: Thu, 30 Sep 2021 13:08:46 +0200 Subject: [PATCH] Updated warnroot and checkroot Commands Updated the Makefile.in to check if the `id` utility exists on the platform, otherwise skip the root check. --- Makefile.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index c7833265..259a4879 100644 --- a/Makefile.in +++ b/Makefile.in @@ -66,12 +66,18 @@ all: $(SUBDIRS2) warnroot @echo "\e[32mAfter 'make install' as euid root, build example app and test utils: 'make example'\e[0m" checkroot: - @if [ "$${DESTDIR}" = "" -a $$(id -u) != "0" ]; \ - then echo "\e[31mThis target must be made as euid root\e[0m"; exit 1; fi; + @if command -v id &> /dev/null; then \ + if [ "$${DESTDIR}" = "" -a $$(id -u) != "0" ]; then \ + echo "\e[31mThis target must be made as euid root\e[0m"; exit 1; \ + fi; \ + fi; warnroot: - @if [ $$(id -u) = 0 ]; \ - then echo "\e[36mWarning: You built this target as uid root\e[0m"; exit 0; fi; + @if command -v id &> /dev/null; then \ + if [ $$(id -u) = 0 ]; then \ + echo "\e[36mWarning: You built this target as uid root\e[0m"; exit 0; \ + fi; \ + fi; checkinstall: @if [ ! -f $(prefix)/include/clixon/clixon.h ]; then \