diff --git a/configure.ac b/configure.ac
index 0e06af5136804f192caa7df371fbdfc9c5c3d956..b179389febd36f351cad70e0cd26e313ecc55a16 100644 (file)
--- a/configure.ac
+++ b/configure.ac
-AC_INIT([tig], [0],
- [Jonas Fonseca <fonseca@diku.dk>],
- [tig])
+AC_INIT([tig], [0], [Jonas Fonseca <fonseca@diku.dk>], [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 <iconv.h>]],
- [[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_PROG(GIT, [git], [git], [AC_ERROR([git not found])])
+AC_MSG_CHECKING([which config subcommand git supports])
+GIT_CONFIG="repo-config"
+git config --list >/dev/null && GIT_CONFIG="config"
+AC_MSG_RESULT([$GIT_CONFIG])
+AC_DEFINE_UNQUOTED(GIT_CONFIG,"$GIT_CONFIG",[git config subcommand])
+
+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