From 17e7768e3393eaac91ebfa7467be3d1cabd7659a Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 21 Jun 2015 19:56:13 +0200 Subject: added XCurses support * enabled via --with-interface=xcurses, so we can configure it automatically via xcurses-config. This also adds XCURSES_CFLAGS and XCURSES_LIBS. * The X11 window class name is set to "SciTECO". X11 resource overrides can currently not be set via sciteco's command line. The user may use .Xdefaults though. * interruptions via CTRL+C are currently not supported. Apparently, XCurses also does send SIGINT in cbreak() mode. An XCurses-specific hack would be cumbersome. * ~InterfaceCurses() should probably be rewritten. Curses cleanup should be completely in restore_batch() as the destructor may be called after Curses-cleanup handlers. E.g. isendwin() SEGFAULTs on XCurses when called from the destructor. --- configure.ac | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9e0cc29..f952d44 100644 --- a/configure.ac +++ b/configure.ac @@ -142,7 +142,7 @@ SCINTERM_PATH=`canonicalize $SCINTERM_PATH` AC_SUBST(SCINTERM_PATH) AC_ARG_WITH(interface, - AS_HELP_STRING([--with-interface=ncurses|pdcurses|gtk], + AS_HELP_STRING([--with-interface=ncurses|xcurses|pdcurses|gtk], [Specify user interface [default=ncurses]]), [INTERFACE=$withval], [INTERFACE=ncurses]) @@ -162,6 +162,38 @@ case $INTERFACE in AC_CHECK_FUNCS([tigetstr]) ;; + xcurses) + AC_CHECK_PROG(XCURSES_CONFIG, xcurses-config, xcurses-config) + + AC_ARG_VAR(XCURSES_CFLAGS, [ + C compiler flags for XCurses, + overriding the autoconf check + ]) + if [[ "x$XCURSES_CFLAGS" = "x" -a "x$XCURSES_CONFIG" != "x" ]]; then + XCURSES_CFLAGS=`$XCURSES_CONFIG --cflags` + fi + CFLAGS="$CFLAGS $XCURSES_CFLAGS" + CXXFLAGS="$CXXFLAGS $XCURSES_CFLAGS" + + AC_ARG_VAR(XCURSES_LIBS, [ + linker flags for XCurses, + overriding the autoconf check + ]) + AC_MSG_CHECKING([checking for XCurses]) + if [[ "x$XCURSES_LIBS" = "x" -a "x$XCURSES_CONFIG" != "x" ]]; then + XCURSES_LIBS=`$XCURSES_CONFIG --libs` + fi + if [[ "x$XCURSES_LIBS" = "x" ]]; then + AC_MSG_ERROR([libXCurses not configured correctly! + xcurses-config must be present or XCURSES_LIBS must be specified.]) + fi + AC_MSG_RESULT([$XCURSES_LIBS]) + LIBS="$LIBS $XCURSES_LIBS" + + # This is also used by the curses.h itself: + AC_DEFINE(XCURSES, , [Enable PDCurses/XCurses extensions]) + ;; + pdcurses) AC_ARG_VAR(PDCURSES_CFLAGS, [ C compiler flags for PDCurses, -- cgit v1.2.3