All pastes #22381 Raw Edit

Someone

public text v1 · immutable
#22381 ·published 2005-09-08 15:50 UTC
rendered paste body
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 <iconv.h>
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"






configure:24350: checking whether iconv uses const
configure:24367: i686-pc-linux-gnu-gcc -c -march=pentium3 -O2 -pipe -w -Werror  conftest.c >&5
configure:24373: $? = 0
configure:24376: test -z                         || test ! -s conftest.err
configure:24379: $? = 0
configure:24382: test -s conftest.o
configure:24385: $? = 0
configure:24392: result: yes