From: Sam Roberts Date: 2003-04-13T15:31:34+09:00 Subject: Re: Having trouble getting iconv-0.5 ... on OS X (actually extconf.rb bug) Quoteing nobu.nokada@softhome.net, on Sun, Apr 13, 2003 at 02:15:54PM +0900: > > 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? > Rather, I'm curious why extconf.rb finds iconv.h in > /usr/local/include. /usr/local is in the default include and lib paths on OS X, it seems. 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. Cheers, Sam [ensemble] ~/p/ruby/download/iconv-0.5 $ ruby extconf.rb --with-iconv-dir=/sw checking for iconv.h... yes checking for iconv() in -liconv... no checking for rb_obj_freeze()... yes checking for rb_block_given_p()... yes checking for rb_str_buf_new()... no creating Makefile [ensemble] ~/p/ruby/download/iconv-0.5 $ touch iconv.c; make LOCAL_LIBS=; ruby -I. -r iconv -e Iconv.iconv gcc -fno-common -g -Os -pipe -no-cpp-precomp -pipe -pipe -no-precomp -I. -I/usr/lib/ruby/1.6/powerpc-darwin6.0 -I. -I/usr/include -DHAVE_ICONV_H -DHAVE_RB_OBJ_FREEZE -DHAVE_RB_BLOCK_GIVEN_P -I/sw/include -c -o iconv.o iconv.c gcc: unrecognized option `-no-precomp' cc1: warning: changing search order for system directory "/usr/include" cc1: warning: as it has already been specified as a non-system directory cc -dynamic -bundle -undefined suppress -flat_namespace -L/sw/lib -L/usr/lib/ruby/1.6/powerpc-darwin6.0 -L/usr/lib -o iconv.bundle iconv.o dyld: ruby Undefined symbols: _libiconv _libiconv_close _libiconv_open Trace/BPT trap [ensemble] ~/p/ruby/download/iconv-0.5 $ touch iconv.c; make LOCAL_LIBS=-liconv; ruby -I. -r iconv -e Iconv.iconv gcc -fno-common -g -Os -pipe -no-cpp-precomp -pipe -pipe -no-precomp -I. -I/usr/lib/ruby/1.6/powerpc-darwin6.0 -I. -I/usr/include -DHAVE_ICONV_H -DHAVE_RB_OBJ_FREEZE -DHAVE_RB_BLOCK_GIVEN_P -I/sw/include -c -o iconv.o iconv.c gcc: unrecognized option `-no-precomp' cc1: warning: changing search order for system directory "/usr/include" cc1: warning: as it has already been specified as a non-system directory cc -dynamic -bundle -undefined suppress -flat_namespace -L/sw/lib -L/usr/lib/ruby/1.6/powerpc-darwin6.0 -L/usr/lib -o iconv.bundle iconv.o -liconv -e:1:in `iconv': wrong # of arguments (0 for 2) (ArgumentError) from -e:1 [ensemble] ~/p/ruby/download/iconv-0.5 $