mirror of
https://github.com/Tha14/toxic.git
synced 2024-12-24 02:23:25 +01:00
Let user disable native colours with ./configure
This commit is contained in:
parent
82027a5b4f
commit
b9290c8a83
22
configure.ac
22
configure.ac
@ -451,6 +451,28 @@ fi
|
||||
|
||||
AM_CONDITIONAL(BUILD_AV, test "x$BUILD_AV" = "xyes")
|
||||
|
||||
# check for ncurses default colour capabilities
|
||||
NATIVE_COLOURS="yes"
|
||||
AC_ARG_ENABLE([native-colours],
|
||||
[AC_HELP_STRING(
|
||||
[--disable-native-colours], [use terminal-default fg/bg colours])
|
||||
],
|
||||
[
|
||||
if test "x$enableval" = "xno"; then
|
||||
NATIVE_COLOURS="no"
|
||||
elif test "x$enableval" = "xyes"; then
|
||||
NATIVE_COLOURS="yes"
|
||||
fi
|
||||
]
|
||||
)
|
||||
if test "x$NATIVE_COLOURS" = "xyes"; then
|
||||
AC_CHECK_LIB([ncurses], [assume_default_colors],
|
||||
[AC_DEFINE(
|
||||
[TOXIC_NATIVE_COLOURS], [1], [use terminal-default fg/bg colours])
|
||||
],
|
||||
[AC_MSG_WARN([curses library does not support native colours])]
|
||||
)
|
||||
fi
|
||||
|
||||
TOXIC_VERSION="$PACKAGE_VERSION"
|
||||
AC_PATH_PROG([GIT], [git], [no])
|
||||
|
@ -108,7 +108,7 @@ static void init_term(void)
|
||||
if (has_colors()) {
|
||||
short bg_color = COLOR_BLACK;
|
||||
start_color();
|
||||
#ifdef NCURSES_EXT_FUNCS
|
||||
#ifdef TOXIC_NATIVE_COLOURS
|
||||
if (assume_default_colors(-1,-1) == OK)
|
||||
bg_color = -1;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user