Skip to content

Commit fda8c47

Browse files
saitohahpjansson
authored andcommitted
build: prevent literal "\e" from appearing
on shells that do not interpret echo -e (e.g., macos)
1 parent 234c7e0 commit fda8c47

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Makefile.am

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
SUBDIRS = chafa docs examples libnsgif lodepng tools tests
22

3+
SGR0=$$(tput sgr0 2>/dev/null)
4+
SETAF9=$$(tput setaf 9 2>/dev/null)
5+
SETAF11=$$(tput setaf 11 2>/dev/null)
6+
37
EXTRA_DIST = \
48
HACKING \
59
README.md \
@@ -16,6 +20,6 @@ all-local:
1620
@echo --- Success! You can now run tools/chafa/chafa, or install everything
1721
@echo --- using "make install" or "sudo make install".
1822
@echo ---
19-
@echo -e '--- \e[0;91mNOTE:\e[0m You may have to run \e[0;93msudo ldconfig\e[0m after installing.'
23+
@echo --- ${SETAF9}NOTE:${SGR0} You may have to run ${SETAF11}msudo ldconfig${SGR0} after installing.
2024
@echo ---
2125
@echo

autogen.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ MISSING_TOOLS=
1616
MY_ECHO=$(which echo)
1717
[ x$MY_ECHO = x ] && MY_ECHO=echo
1818

19+
SGR0=$(tput sgr0 2>/dev/null)
20+
SETAF1=$(tput setaf 1 2>/dev/null)
21+
SETAF3=$(tput setaf 3 2>/dev/null)
22+
1923
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
2024
MISSING_TOOLS="${MISSING_TOOLS}autoconf "
2125
DIE=1
@@ -38,8 +42,8 @@ MY_ECHO=$(which echo)
3842

3943
if test "$DIE" -eq 1; then
4044
${MY_ECHO}
41-
${MY_ECHO} -e "Missing mandatory tools:\e[1;31m $MISSING_TOOLS"
42-
${MY_ECHO} -e "\e[0m"
45+
${MY_ECHO} "Missing mandatory tools:${SETAF1} $MISSING_TOOLS"
46+
${MY_ECHO} "${SGR0}"
4347
${MY_ECHO} "These are required for building Chafa from its git repository."
4448
${MY_ECHO} "You should be able to install them using your operating system's"
4549
${MY_ECHO} "package manager (apt-get, yum, zypper or similar). Alternately"
@@ -78,8 +82,8 @@ ${LIBTOOLIZE} --force --copy
7882
GTKDOCIZE=$(which gtkdocize 2>/dev/null)
7983

8084
if test -z $GTKDOCIZE; then
81-
${MY_ECHO} -e "Missing optional tool:\e[1;33m gtk-doc"
82-
${MY_ECHO} -e "\e[0m"
85+
${MY_ECHO} "Missing optional tool:${SETAF3} gtk-doc"
86+
${MY_ECHO} "${SGR0}"
8387
${MY_ECHO} "Without this, no developer documentation will be generated."
8488
${MY_ECHO}
8589
rm -f gtk-doc.make

0 commit comments

Comments
 (0)