On Sun, May 2, 2010 at 8:27 PM, Bruno Haible <br...@clisp.org> wrote: > Hi, > > Michael Goffioul wrote: >> When trying to compile gnulib (from octave), it fails at compiling >> mbsinit.c. It seems this is due to the fact that on my system (MSVC) >> mbsinit is declared inlined in wchar.h. The configure script fails to >> detect the system mbsinit, because of link error, and the compiler >> fails to compile the replacement, because of duplicate body for the >> same function (the inlined one in wchar.h and the replacement one). >> >> Can this problem be solved at gnulib level? > > You are free to submit a patch to this list, if you also explain > the compilation errors ("because of link error" is too vague - show > the error) and verify that with your patch, the error goes away.
Sorry, I should probably have been clearer. But the problem is quite generic in the sense that AC_CHECK_FUNCS will fail to detect inlined function, as the target function does not exist in any library that you can link to. So in m4/mbsinit.m4, AC_CHECK_FUNCS_ONCE([mbsinit]) fails and brings in compilation of mbsinit.c replacement. Compilation of that replacement fails, because the replacement code clashes with the inlined system version. For completeness, I attached the relevant parts from the configure step (extracted from config.log) and the compilation step. Michael.
mbsinit_configure.log
Description: Binary data
mbsinit_compile.log
Description: Binary data