X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=configure.in;h=ea664e9c04c46064f0299fa5e2b4586c331a9509;hb=d2f54bbc4ef071a92508fa26d5d4641a3f2215c1;hp=85e5181bc457124c03c5a0cefde88333254fc1f8;hpb=adc954633908e3fc97dfa94c08f964e1bbb94086;p=mmh diff --git a/configure.in b/configure.in index 85e5181..ea664e9 100644 --- a/configure.in +++ b/configure.in @@ -4,6 +4,12 @@ dnl dnl $Id$ dnl +dnl 2.13 definitely chokes; 2.53 is the earliest version I've tested. +dnl 2.50 is the major breakpoint between the old autoconf and the new, +dnl so require that. If there are bug reports about 2.50-2.52 not working +dnl we can always move this up a little. +AC_PREREQ(2.50) + AC_INIT(h/nmh.h) AC_CONFIG_HEADER(config.h) @@ -445,7 +451,7 @@ AC_HEADER_STAT AC_CHECK_HEADERS(string.h memory.h stdlib.h unistd.h errno.h fcntl.h \ limits.h crypt.h termcap.h termio.h termios.h locale.h \ langinfo.h netdb.h sys/param.h sys/time.h sys/utsname.h \ - arpa/inet.h arpa/ftp.h) + iconv.h arpa/inet.h arpa/ftp.h) AC_CACHE_CHECK(POSIX termios, nmh_cv_sys_posix_termios, @@ -547,6 +553,46 @@ for lib in $termcap_curses_order; do done AC_SUBST(TERMLIB)dnl +dnl --------------- +dnl CHECK FOR ICONV +dnl --------------- + +dnl Find iconv. It may be in libiconv and may be iconv() or libiconv() +if test "x$ac_cv_header_iconv_h" = "xyes"; then + AC_CHECK_FUNC(iconv, ac_found_iconv=yes, ac_found_iconv=no) + if test "x$ac_found_iconv" = "xno"; then + AC_CHECK_LIB(iconv, iconv, ac_found_iconv=yes) + if test "x$ac_found_iconv" = "xno"; then + AC_CHECK_LIB(iconv, libiconv, ac_found_iconv=yes) + fi + if test "x$ac_found_iconv" != "xno"; then + LIBS="-liconv $LIBS" + fi + fi +fi +if test "x$ac_found_iconv" = xyes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) +fi + +dnl Check if iconv uses const in prototype declaration +if test "x$ac_found_iconv" = "xyes"; then + AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #include ]], + [[#ifdef __cplusplus + "C" + #endif + #if defined(__STDC__) || defined(__cplusplus) + size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); + #else + size_t iconv(); + #endif]])], + [ac_cv_iconv_const=], + [ac_cv_iconv_const=const])]) + AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const, + [Define as const if the declaration of iconv() needs const.]) +fi + dnl -------------- dnl CHECK FOR NDBM dnl --------------