X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=configure.ac;h=27a78b12b5bc8e0a1ab8ecaee149cce850b4aae7;hb=104cc85bbcb9d2f6b7ebff4f3740756f614100e9;hp=f60d43eab2424a50f64bf3478762117dbe8016c9;hpb=c692b4e4a2fcddbde05187d2d37c228f91d36274;p=tig.git diff --git a/configure.ac b/configure.ac index f60d43e..27a78b1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,55 +1,28 @@ -AC_INIT([tig], [0], - [Jonas Fonseca ], - [tig]) +AC_INIT([tig], [0], [Jonas Fonseca ], [tig]) + AC_LANG([C]) AC_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR(tig.c) -AC_ARG_WITH(libiconv, - AC_HELP_STRING([--with-libiconv=DIRECTORY],[base directory for libiconv])) -if test "$with_libiconv" != "" -then - CFLAGS="$CFLAGS -I$with_libiconv/include" - LDFLAGS="$LDFLAGS -L$with_libiconv/lib" -fi - -dnl -dnl See if we need to link with -liconv to get the iconv() function. -dnl -AC_SEARCH_LIBS([wclear], [ncurses curses]) -AC_SEARCH_LIBS([iconv], [iconv]) - -if test "$ac_cv_search_iconv" = "no" -then - AC_MSG_FAILURE([iconv() not found. Please install libiconv.],[1]) -fi - -dnl -dnl See if iconv() requires a const char ** for the input buffer. -dnl -if test "$GCC" = "yes" -then - OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror" - AC_MSG_CHECKING([whether iconv needs const char **]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[char **buf; - size_t *size; - iconv_t cd; - iconv(cd, buf, size, buf, size);]])], - [AC_DEFINE([ICONV_INBUF_TYPE],[char *], - [Type of iconv() input buffer]) - AC_MSG_RESULT([no])], - [AC_DEFINE([ICONV_INBUF_TYPE],[const char *], - [Type of iconv() input buffer]) - AC_MSG_RESULT([yes])]) - CFLAGS="$OLD_CFLAGS" -fi +cursed=no +AC_CHECK_HEADERS([ncursesw/ncurses.h], + [AC_SEARCH_LIBS([initscr], [ncursesw], [cursed=yes])]) +case "$cursed" in "no") + AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h], + [AC_SEARCH_LIBS([wclear], [ncurses], [cursed=yes])]) + + case "$cursed" in "no") + AC_ERROR([ncurses not found]) + esac + + AC_MSG_WARN([The found ncurses library does not support wide-char.]) + AC_MSG_WARN([This means that tig will not correctly render UTF-8.]) +esac + +AM_ICONV AC_PROG_CC -AC_CHECK_PROGS(GIT_CONFIG, [git-config git-repo-config]) -AC_DEFINE_UNQUOTED(GIT_CONFIG,"$GIT_CONFIG",[git config program]) + AC_CHECK_PROGS(ASCIIDOC, [asciidoc false]) AC_CHECK_PROGS(XMLTO, [xmlto false]) AC_CHECK_PROGS(DOCBOOK2PDF, [docbook2pdf false])