D:\devel\lyx\trunk\intl\dcigettext.c:933: error: `ICONV_CONST'
undeclared (first use in this function)

This is the problem I try to solve. Now, do you have ICONV_CONST in
your src/config.h? If not, please paste here the portion of config.log
that look like this:


scons: Configure: Check if the declaration of iconv needs const...
.sconf_temp/conftest_85.c <-
 |
 |#include <stdlib.h>
 |#include <iconv.h>
 |extern
 |#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
 |extern size_t iconv(iconv_t cd, const char * *inbuf, size_t
*inbytesleft, char * *outbuf, size_t *outbytesleft);
 |int main()
 |{
 |  return 1;
 |}
 |
g++ -o .sconf_temp/conftest_85.o -c -I/usr/lib/qt-3.3/include
.sconf_temp/conftest_85.c
g++ -o .sconf_temp/conftest_85 .sconf_temp/conftest_85.o -Ldebug/libs
-L/usr/lib/qt-3.3/lib -L/usr/local/lib -lz -lqt-mt -lnsl -liconv -lc
scons: Configure: yes


Actually, I tried to translate the m4/iconv.m4

AC_DEFUN([AM_ICONV],
[
 AM_ICONV_LINK
 if test "$am_cv_func_iconv" = yes; then
   AC_MSG_CHECKING([for iconv declaration])
   AC_CACHE_VAL(am_cv_proto_iconv, [
     AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
extern
#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
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
     am_cv_proto_iconv="extern size_t iconv (iconv_t cd,
$am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char *
*outbuf, size_t *outbytesleft);"])
   am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed
-e 's/( /(/'`
   AC_MSG_RESULT([$]{ac_t:-
        }[$]am_cv_proto_iconv)
   AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
     [Define as const if the declaration of iconv() needs const.])
 fi
])


into python, but ended up with something I am not sure:

def checkIconvConst(conf):
 ''' check the declaration of iconv '''
 check_iconv_const = '''
#include <stdlib.h>
#include <iconv.h>
extern
#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
extern size_t iconv(iconv_t cd, const char * *inbuf, size_t
*inbytesleft, char * *outbuf, size_t *outbytesleft);
int main()
{
 return 1;
}
'''
 conf.Message('Check if the declaration of iconv needs const... ')
 ret = conf.TryLink(check_iconv_const, '.c')
 conf.Result(ret)
 return ret


m4 experts please tell me if the python code is doing the right thing.

Cheers,
Bo

Reply via email to