Having trouble getting iconv-0.5 ... on OS X (actually extconf.rb bug)

Hi,

Note that it found /usr/local/include/iconv.h, but failed to find iconv(), and
yet still created the Makefile. Why?

Some platforms don’t need any additional libraries to use
iconv(), because they have it in libc.

Sure, but isn’t that what extconf.rb is checking, whether you need
-liconv?

Yes, on such systems, -liconv isn’t needed.

Anynow, I went back to having my iconv installed in /sw (kind of the
/opt of the OS X world). It allows iconv.h to be found, but the
extconf.rb still isn’t figuring out that it needs -liconv, but it works
when I specify -liconv in the USER_LIBS.

Can’t you show me the mkmf.log?

[ensemble] ~/p/ruby/download/iconv-0.5 $ ruby extconf.rb --with-iconv-dir=/sw

Sorry, I forgot `with’.

···

At Sun, 13 Apr 2003 15:31:34 +0900, Sam Roberts wrote:


Nobu Nakada

Quoteing nobu.nokada@softhome.net, on Sun, Apr 13, 2003 at 07:44:34PM +0900:

Anynow, I went back to having my iconv installed in /sw (kind of the
/opt of the OS X world). It allows iconv.h to be found, but the
extconf.rb still isn’t figuring out that it needs -liconv, but it works
when I specify -liconv in the USER_LIBS.

Can’t you show me the mkmf.log?

I think what is happening is that GNU iconv
(ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.7.tar.gz), when not
compiled as part of the system, is #defining iconv() to libiconv().

It appears that when extconf.rb looks for iconv(), the c file it
generates doesn’t include <iconv.h>, so it never sees the define.

What’s odd is that earlier in mkmf.log, I see references to libiconv().
What’s happening?

Attached is mkmf.log, and iconv.h.

Can you make sense of it?

Thanks,
Sam

mkmf.log (5.11 KB)

iconv.h (3.83 KB)