Help needed: fix build issue with xdxf_makedict in older platforms

Ken Cunningham ken.cunningham.webuse at gmail.com
Tue Nov 7 18:46:23 UTC 2017


On 2017-11-07, at 2:13 AM, Joshua Root wrote:
> 
> 
> There is an indirect dependency via glib2. The issue really is the macro
> in the gettext header causing unintended changes to the C++ headers.
> 
> - Josh


totally get it now. It builds easily with libc++, but fails with libstdc++ or macports-libstdc++ with the same errors noted on the buildbots.

This is another example of how this libc++/clang-3.9 setup I have on 10.6 is consistent with newer systems -- if we standardized on that somehow we'd see fewer errors like this. I would have never seen this error.



Leonardo, I find you can reproduce this build error on any system (I just did it on high sierra) if you do this:

install clang-5.0 and libgcc as normally from the prebuilt packages

sudo port install libgcc clang-5.0

then run

sudo port -v -s destroot xdxf_makedict configure.cxx_stdlib=macports-libstdc++ configure.compiler=macports-clang-5.0

and you duplicate the errors promptly.

It's totally a gcc vs libc++ header thing, as our knowledgable Joshua saw right away.

Looking in:

/opt/local/include/libintl.h

that definition is guarded by a flag

#ifndef GNULIB_defined_setlocale /* don't override gnulib */
#undef setlocale
#define setlocale libintl_setlocale
extern char *setlocale (int, const char *);
#endif


and sure enough, adding this to the portfile fixes the build:

configure.cxxflags-append -DGNULIB_defined_setlocale

I presume this workaround was made for this very error.

Best,

Ken


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20171107/7a1a1b52/attachment.html>


More information about the macports-dev mailing list