X-Git-Url: https://git.distorted.org.uk/~mdw/tig/blobdiff_plain/c692b4e4a2fcddbde05187d2d37c228f91d36274..abc10a73a9d05a8d3c697e83fc4c71f39f4c2e80:/configure.ac diff --git a/configure.ac b/configure.ac index f60d43e..65b5af3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,54 +1,22 @@ 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 +AC_SEARCH_LIBS([wclear], [ncursesw ncurses curses], [], + [AC_ERROR([curses not found])]) -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]) +if test "${ac_cv_prog_GIT_CONFIG}" = ""; then + AC_CHECK_PROGS(GIT, [git]) + GIT_CONFIG="${ac_cv_prog_GIT} config" +fi AC_DEFINE_UNQUOTED(GIT_CONFIG,"$GIT_CONFIG",[git config program]) AC_CHECK_PROGS(ASCIIDOC, [asciidoc false]) AC_CHECK_PROGS(XMLTO, [xmlto false]) @@ -56,3 +24,9 @@ AC_CHECK_PROGS(DOCBOOK2PDF, [docbook2pdf false]) AC_CONFIG_FILES([config.make]) AC_OUTPUT + +case "$LIBS" in +*-lncursesw*) ;; +*) AC_MSG_RESULT([NOTE: The found ncurses library does not support wide-char.]) + AC_MSG_RESULT([NOTE: This means that tig will not correctly render UTF-8]) +esac