Commit 3e830b6d authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde Committed by Michael Niedermayer

configure: colorize warning messages

This patch introduces color warning messages (yellow).
They are enabled whenever available.
Tested with zsh, bash, and sh (bash under --posix).
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 1f1c1008
...@@ -416,6 +416,14 @@ EOF ...@@ -416,6 +416,14 @@ EOF
} }
quotes='""' quotes='""'
if test -t 1; then
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
bold_color=$(tput bold)
warn_color=$(tput setaf 3)
reset_color=$(tput sgr0)
fi
fi
log(){ log(){
echo "$@" >> $logfile echo "$@" >> $logfile
...@@ -6201,7 +6209,7 @@ echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH ...@@ -6201,7 +6209,7 @@ echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
cp_if_changed $TMPH libavutil/avconfig.h cp_if_changed $TMPH libavutil/avconfig.h
if test -n "$WARNINGS"; then if test -n "$WARNINGS"; then
printf "\n$WARNINGS" printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
enabled fatal_warnings && exit 1 enabled fatal_warnings && exit 1
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment