Browse Source

* src/caca.c:

+ Prefer the X11 driver if $DISPLAY is set.
    + The slang driver is now preferred over the ncurses driver.
  * configure.ac:
    + Autodetect conio.h.
tags/v0.99.beta14
Sam Hocevar sam 21 years ago
parent
commit
efbb33a9b6
2 changed files with 34 additions and 24 deletions
  1. +18
    -13
      configure.ac
  2. +16
    -11
      src/caca.c

+ 18
- 13
configure.ac View File

@@ -18,29 +18,34 @@ dnl now otherwise it might be set in an obscure if statement.
AC_EGREP_CPP(foo,foo)

AC_ARG_ENABLE(slang,
[ --enable-slang slang graphics support (default enabled)])
[ --enable-slang slang graphics support (autodetected)])
AC_ARG_ENABLE(ncurses,
[ --enable-ncurses ncurses graphics support (default enabled)])
[ --enable-ncurses ncurses graphics support (autodetected)])
AC_ARG_ENABLE(conio,
[ --enable-conio DOS conio.h graphics support (default disabled)])
AC_ARG_ENABLE(x11,
[ --enable-x11 X11 support (default disabled) (default enabled)])
[ --enable-x11 X11 support (autodetected)])

AC_CHECK_HEADERS(inttypes.h endian.h)
AC_CHECK_FUNCS(vsnprintf getenv putenv strcasecmp)

CACA_DRIVERS=""

if test "${enable_conio}" = "yes"; then
AC_CHECK_HEADERS(conio.h,:,AC_MSG_ERROR([cannot find conio.h header]))
AC_MSG_CHECKING(for ScreenUpdate in pc.h)
AC_EGREP_HEADER(ScreenUpdate,pc.h,
[AC_MSG_RESULT(yes)
AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
Define if <pc.h> defines ScreenUpdate.)],
[AC_MSG_RESULT(no)])
CACA_DRIVERS="${CACA_DRIVERS} conio"
AC_DEFINE(USE_CONIO, 1, Define to activate the conio.h backend driver)
if test "${enable_conio}" != "no"; then
AC_CHECK_HEADERS(conio.h,
[ac_cv_my_have_conio="yes"
AC_MSG_CHECKING(for ScreenUpdate in pc.h)
AC_EGREP_HEADER(ScreenUpdate,pc.h,
[AC_MSG_RESULT(yes)
AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
Define if <pc.h> defines ScreenUpdate.)],
[AC_MSG_RESULT(no)])
AC_DEFINE(USE_CONIO, 1, Define to activate the conio.h backend driver)
CACA_DRIVERS="${CACA_DRIVERS} conio"],
[ac_cv_my_have_conio="no"])
if test "${ac_cv_my_have_conio}" = "no" -a "${enable_conio}" = "yes"; then
AC_MSG_ERROR([cannot find conio.h])
fi
fi

if test "${enable_slang}" != "no"; then


+ 16
- 11
src/caca.c View File

@@ -380,9 +380,9 @@ static void caca_init_driver(void)
_caca_driver = CACA_DRIVER_CONIO;
else
#endif
#if defined(USE_NCURSES)
if(!strcasecmp(var, "ncurses"))
_caca_driver = CACA_DRIVER_NCURSES;
#if defined(USE_X11)
if(!strcasecmp(var, "x11"))
_caca_driver = CACA_DRIVER_X11;
else
#endif
#if defined(USE_SLANG)
@@ -390,9 +390,9 @@ static void caca_init_driver(void)
_caca_driver = CACA_DRIVER_SLANG;
else
#endif
#if defined(USE_X11)
if(!strcasecmp(var, "x11"))
_caca_driver = CACA_DRIVER_X11;
#if defined(USE_NCURSES)
if(!strcasecmp(var, "ncurses"))
_caca_driver = CACA_DRIVER_NCURSES;
else
#endif
_caca_driver = CACA_DRIVER_NONE;
@@ -405,16 +405,21 @@ static void caca_init_driver(void)
_caca_driver = CACA_DRIVER_CONIO;
return;
#endif
#if defined(USE_NCURSES)
_caca_driver = CACA_DRIVER_NCURSES;
return;
#if defined(USE_X11)
#if defined(HAVE_GETENV)
if(getenv("DISPLAY"))
#endif
{
_caca_driver = CACA_DRIVER_X11;
return;
}
#endif
#if defined(USE_SLANG)
_caca_driver = CACA_DRIVER_SLANG;
return;
#endif
#if defined(USE_X11)
_caca_driver = CACA_DRIVER_X11;
#if defined(USE_NCURSES)
_caca_driver = CACA_DRIVER_NCURSES;
return;
#endif
_caca_driver = CACA_DRIVER_NONE;


Loading…
Cancel
Save