dnl Some implementations make the second argument of iconv non-const for no dnl sane reason AC_MSG_CHECKING([whether iconv uses const]) OLDCFLAGS="$CFLAGS" # This is a gcc-ism but autoconf provides no other way of doing this. CFLAGS="$CFLAGS -Werror" AC_COMPILE_IFELSE(AC_LANG_SOURCE( [#include int main() { iconv_t i; char *a="a"; size_t s; iconv(i,(const char**)&a,&s,&a,&s); return 0; } ]), [AC_DEFINE(iconv_arg2_t,[const char **],[Second argument of iconv()]) AC_MSG_RESULT(yes)], [AC_DEFINE(iconv_arg2_t,[char **]) AC_MSG_RESULT(no)]) CFLAGS="$OLDCFLAGS"