X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=configure.in;h=1b1df6b5cb711b914539a11fd295ae34c54c4bcf;hp=85e5181bc457124c03c5a0cefde88333254fc1f8;hb=4c24408bdff496a631709326b0d07a4e12fa9277;hpb=70c52ecdc4230a7c3a1051234f786d988997b622 diff --git a/configure.in b/configure.in index 85e5181..1b1df6b 100644 --- a/configure.in +++ b/configure.in @@ -445,7 +445,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 +547,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 --------------