Seems to be even more complicated after looking through config.log...
It appears that illumos has the following in /usr/include/iconv.h
#ifdef _XPG6
extern size_t iconv(iconv_t, char **_RESTRICT_KYWD,
size_t *_RESTRICT_KYWD, char **_RESTRICT_KYWD,
size_t *_RESTRICT_KYWD);
#else
extern size_t iconv(iconv_t, const char **_RESTRICT_KYWD,
size_t *_RESTRICT_KYWD, char **_RESTRICT_KYWD,
size_t *_RESTRICT_KYWD);
#endif
whereas /opt/pkg/include/iconv.h has
extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
So there is a clash as apparently _XPG6 is not being defined and, even though pkgsrc iconv is installed, it seems to not occlude the system header.
Is there a "standard" workaround for this? defining _XPG6 or _XOPEN_SOURCE=600 ?
hints please, I'll be glad to test them.