User:Sam/Drafts/Colors
From Gentoo Wiki
< User:Sam
Jump to:navigation
Jump to:search
For make.conf:
FILE
/etc/portage/make.conf
# CLICOLOR is a general env var to tell applications to output colour
CLICOLOR=1
# Needed for ninja (e.g. z3) because of what it does with ttys
CLICOLOR_FORCE=1
# https://www.gnu.org/software/automake/manual/1.11.3/automake.html
AM_COLOR_TESTS=always
# These are needed in particular for Clang, as Clang doesn't
# have an -fdiagnostics-color=always option.
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6747
# https://github.com/ninja-build/ninja/issues/174
CMAKE_COMPILER_COLOR_DIAGNOSTICS=ON
CMAKE_COLOR_DIAGNOSTICS=ON
# Ask Meson to always output colour too (appends it to ebuild-provided args)
MYMESONARGS="-Db_colorout=always"
# Ask the compiler to always colourise with -fdiagnostics-color=always
COMMON_FLAGS="-O2 -pipe -march=native -fdiagnostics-color=always"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
# Use this to have plain text logs saved on disk (doesn't affect console colours)
# https://bugs.gentoo.org/892850, https://gitlab.com/saalen/ansifilter/-/issues/29
# still needs -fdiagnostics-urls=never too
#PORTAGE_LOG_FILTER_FILE_CMD="bash -c \"ansifilter -c; exec cat\""
FILE
/etc/dispatch-conf.conf
# We add --color=always here
diff="diff --color=always -Nu '%s' '%s'"
# We add -R here
less-opts="--no-init --quit-if-one-screen -R"