diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-10-25 09:23:10 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-10-25 09:23:10 +0000 |
commit | 0e531f5e6a964d4b2a234e17052f4a254227af41 (patch) | |
tree | 74a64cf5dd0f8e944d377c120859931e06eecf7d | |
parent | c2f4bdd0fcd17a270ae58a59cf4c4705801a6333 (diff) | |
download | weechat-0e531f5e6a964d4b2a234e17052f4a254227af41.zip |
Added auto-detection of ncursesw/ncurses lib in configure.in, fall back to ncurses if ncursesw is not found (auto-detect ncurses.h location too)
-rw-r--r-- | configure.in | 19 | ||||
-rw-r--r-- | src/gui/curses/gui-display.c | 5 | ||||
-rw-r--r-- | src/gui/curses/gui-input.c | 5 | ||||
-rw-r--r-- | weechat/configure.in | 19 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-display.c | 5 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-input.c | 5 |
6 files changed, 48 insertions, 10 deletions
diff --git a/configure.in b/configure.in index bff83cb97..8cf84e7e2 100644 --- a/configure.in +++ b/configure.in @@ -34,7 +34,8 @@ ALL_LINGUAS="fr es cs" AM_GNU_GETTEXT # Checks for libraries -AC_CHECK_LIB(ncursesw, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0) +AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0) +AC_CHECK_LIB(ncursesw, initscr, LIBNCURSESW_FOUND=1, LIBNCURSESW_FOUND=0) # Checks for header files AC_HEADER_STDC @@ -103,12 +104,20 @@ AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes") # ------------------------------------------------------------------------------ if test "x$enable_ncurses" = "xyes" ; then - if test "$LIBNCURSES_FOUND" = "0" ; then - AC_MSG_ERROR([ -*** ncursesw library not found! + if test "$LIBNCURSESW_FOUND" = "0" ; then + if test "$LIBNCURSES_FOUND" = "0" ; then + AC_MSG_ERROR([ +*** ncurses library not found! *** Please install ncurses library or run ./configure with --disable-ncurses parameter.]) + fi + AC_MSG_WARN([ +*** ncursesw library not found! Falling back to "ncurses" +*** Be careful, UTF-8 display will not work properly.]) + NCURSES_LIBS="-lncurses" + else + NCURSES_LIBS="-lncursesw" + AC_CHECK_HEADERS(ncursesw/curses.h) fi - NCURSES_LIBS="-lncursesw" AC_SUBST(NCURSES_LIBS) fi diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index 8f0d57389..895f3c2bd 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -31,7 +31,12 @@ #include <signal.h> #include <time.h> #include <ctype.h> + +#ifdef HAVE_NCURSESW_CURSES_H #include <ncursesw/ncurses.h> +#else +#include <ncurses.h> +#endif #include "../../common/weechat.h" #include "../gui.h" diff --git a/src/gui/curses/gui-input.c b/src/gui/curses/gui-input.c index 90ffc97be..3993f7ad7 100644 --- a/src/gui/curses/gui-input.c +++ b/src/gui/curses/gui-input.c @@ -31,7 +31,12 @@ #include <signal.h> #include <time.h> #include <sys/socket.h> + +#ifdef HAVE_NCURSESW_CURSES_H #include <ncursesw/ncurses.h> +#else +#include <ncurses.h> +#endif #include "../../common/weechat.h" #include "../gui.h" diff --git a/weechat/configure.in b/weechat/configure.in index bff83cb97..8cf84e7e2 100644 --- a/weechat/configure.in +++ b/weechat/configure.in @@ -34,7 +34,8 @@ ALL_LINGUAS="fr es cs" AM_GNU_GETTEXT # Checks for libraries -AC_CHECK_LIB(ncursesw, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0) +AC_CHECK_LIB(ncurses, initscr, LIBNCURSES_FOUND=1, LIBNCURSES_FOUND=0) +AC_CHECK_LIB(ncursesw, initscr, LIBNCURSESW_FOUND=1, LIBNCURSESW_FOUND=0) # Checks for header files AC_HEADER_STDC @@ -103,12 +104,20 @@ AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes") # ------------------------------------------------------------------------------ if test "x$enable_ncurses" = "xyes" ; then - if test "$LIBNCURSES_FOUND" = "0" ; then - AC_MSG_ERROR([ -*** ncursesw library not found! + if test "$LIBNCURSESW_FOUND" = "0" ; then + if test "$LIBNCURSES_FOUND" = "0" ; then + AC_MSG_ERROR([ +*** ncurses library not found! *** Please install ncurses library or run ./configure with --disable-ncurses parameter.]) + fi + AC_MSG_WARN([ +*** ncursesw library not found! Falling back to "ncurses" +*** Be careful, UTF-8 display will not work properly.]) + NCURSES_LIBS="-lncurses" + else + NCURSES_LIBS="-lncursesw" + AC_CHECK_HEADERS(ncursesw/curses.h) fi - NCURSES_LIBS="-lncursesw" AC_SUBST(NCURSES_LIBS) fi diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c index 8f0d57389..895f3c2bd 100644 --- a/weechat/src/gui/curses/gui-display.c +++ b/weechat/src/gui/curses/gui-display.c @@ -31,7 +31,12 @@ #include <signal.h> #include <time.h> #include <ctype.h> + +#ifdef HAVE_NCURSESW_CURSES_H #include <ncursesw/ncurses.h> +#else +#include <ncurses.h> +#endif #include "../../common/weechat.h" #include "../gui.h" diff --git a/weechat/src/gui/curses/gui-input.c b/weechat/src/gui/curses/gui-input.c index 90ffc97be..3993f7ad7 100644 --- a/weechat/src/gui/curses/gui-input.c +++ b/weechat/src/gui/curses/gui-input.c @@ -31,7 +31,12 @@ #include <signal.h> #include <time.h> #include <sys/socket.h> + +#ifdef HAVE_NCURSESW_CURSES_H #include <ncursesw/ncurses.h> +#else +#include <ncurses.h> +#endif #include "../../common/weechat.h" #include "../gui.h" |