X-Git-Url: https://git.tokkee.org/?p=tig.git;a=blobdiff_plain;f=configure.ac;h=236d5f93dd876f34ad338fe35ecb1d669c69ad1b;hp=f60d43eab2424a50f64bf3478762117dbe8016c9;hb=43fec2264a6cdffc083123ef412d79c95ec44371;hpb=c692b4e4a2fcddbde05187d2d37c228f91d36274 diff --git a/configure.ac b/configure.ac index f60d43e..236d5f9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,58 +1,26 @@ -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]) +AX_WITH_CURSES +case "$ax_cv_ncurses" in "no") + AC_ERROR([ncurses not found]) +esac +case "$ax_cv_ncursesw" in "no") + 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 +AC_SUBST(CURSES_LIB) -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 +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]) + +AC_CHECK_PROGS(ASCIIDOC, [asciidoc], [false]) +AC_CHECK_PROGS(XMLTO, [xmlto], [false]) +AC_CHECK_PROGS(DOCBOOK2PDF, [docbook2pdf], [false]) AC_CONFIG_FILES([config.make]) AC_OUTPUT