On 07/31/11 01:11, Amit Kulkarni wrote: >> Hi, >> >> How do you use check for libintl? This small fragment doesn't work for me. > > > I forgot to mention, this doesn't work in 2.6[3|4|5|7|8] when I generate > using > #env AUTOCONF_VERSION=2.6X autoconf -i > > on amd64 > >> >> ------------- configure.ac -------------- >> AC_INIT >> >> AC_CHECK_LIB(intl,main) >> AC_CHECK_LIB(intl,ngettext) >> AC_CHECK_LIB(intl,dcgettext) >> AC_CHECK_LIB(intl,dcngettext) >> AC_CHECK_LIB(intl,libintl_dcigettext) >> AC_CHECK_LIB(intl,dngettext) >> AC_CHECK_LIB(intl,_nl_find_msg) >> AC_CHECK_LIB([intl],[gettext]) >> AC_CHECK_LIB(intl,libintl_gettextparse) >> AC_CHECK_LIB(intl,bindtextdomain) >> AC_CHECK_LIB(intl,setlocale) >> m4_unquote( >> _m4_defn([_m4_wrap_text])_m4_popdef([_m4_wrap_text])) >> >> ------------ end ------------------ >> > > Since the error wasn't provided, the guess the error was something like undefined reference to libiconv.....
extract from a config.log (this used autoconf 2.61) configure:22710: result: no configure:22846: checking if -liconv is needed to use gettext configure:22848: result: configure:22850: checking for ngettext in -lintl configure:22885: cc -o conftest -O2 -pipe -I/usr/local/include -L/usr/local/lib conftest.c -lintl -liconv >&5 configure:22891: $? = 0 configure:22909: result: yes configure:22912: checking for dcgettext in -lintl configure:22947: cc -o conftest -O2 -pipe -I/usr/local/include -L/usr/local/lib conftest.c -lintl -liconv >&5 conftest.c:50: warning: conflicting types for built-in function 'dcgettext' configure:22953: $? = 0 configure:22971: result: yes configure:22999: checking for bind_textdomain_codeset configure:23055: cc -o conftest -O2 -pipe -I/usr/local/include -L/usr/local/lib conftest.c -lintl -liconv >&5 configure:23061: $? = 0 configure:23079: result: yes configure:23119: checking for msgfmt configure:23146: result: /usr/local/bin/msgfmt configure:23159: checking for dcgettext The section of a config file as example of how it's done from a port... AC_MSG_CHECKING([if -liconv is needed to use gettext]) AC_MSG_RESULT([]) AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dcgettext, [gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv], :,-liconv)], :,-liconv)