nobu.nokada / softhome.net wrote:
> Hi,
> 
> At Tue, 11 Mar 2003 03:40:22 +0900,
> Joel VanderWerf wrote:
...
>>I tried ldd ./iconv.so in the source dir:
>>
>>         libdl.so.1 =>    /usr/lib/libdl.so.1
>>         libcrypt_i.so.1 =>       /usr/lib/libcrypt_i.so.1
>>         libm.so.1 =>     /usr/lib/libm.so.1
>>         libc.so.1 =>     /usr/lib/libc.so.1
>>         libgen.so.1 =>   /usr/lib/libgen.so.1
>>         /usr/platform/SUNW,Ultra-Enterprise/lib/libc_psr.so.1
>>
>>I'm a little surprised not to see libiconv here...
> 
> 
> Me too.  What commands to compile/link, and the content of
> mkmf.log?

Just ./extconf.rb; make

Now that I look at it (duh!), the output of extconf.rb seems to be 
trying to tell me there is a problem:

==============
checking for iconv.h... yes
checking for iconv() in -liconv... no
checking for rb_obj_freeze()... no
checking for rb_block_given_p()... no
checking for rb_str_buf_new()... no
creating Makefile
==============

The output of make is:

===============
gcc -fPIC -I/usr/path/include -I. 
-I/usr/path/lib/ruby/1.7/sparc-solaris2.7 
-I/usr/path/lib/ruby/1.7/sparc-solaris2.7 -I. -DHAVE_ICONV_H 
-I/usr/path/include -DHAVE_OBJECT_ALLOCATE -c iconv.c
iconv.c: In function `iconv_try':
iconv.c:187: warning: passing arg 2 of `libiconv' from incompatible 
pointer typegcc -Wl,-G -shared -Wl,-E    -o iconv.so iconv.o  -ldl 
-lcrypt -lm  -lc
================

This is the part of mkmf.log that seems to be related to iconv:

================
have_header: checking for iconv.h...
gcc -E -I/usr/path/lib/ruby/1.7/sparc-solaris2.7 
-I/usr/path/lib/ruby/1.7/sparc-solaris2.7 -I/usr/path/include 
-I/usr/path/include -o conftest.i conftest.c
checked program was:
/* begin */
#include <iconv.h>
/* end */

have_library: checking for iconv() in -liconv...
gcc -o conftest -I/usr/path/lib/ruby/1.7/sparc-solaris2.7 
-I/usr/path/lib/ruby/1.7/sparc-solaris2.7 -I/usr/path/include 
-I/usr/path/include conftest.c -Wl,-E -lruby-static -liconv -ldl -lcrypt 
-lm -lc
/usr/local/sparc-sun-solaris2.6/bin/ld: cannot find -lruby-static
collect2: ld returned 1 exit status
checked program was:
/* begin */


int main() { return 0; }
int t() { iconv(); return 0; }
/* end */

gcc -o conftest -I/usr/path/lib/ruby/1.7/sparc-solaris2.7 
-I/usr/path/lib/ruby/1.7/sparc-solaris2.7 -I/usr/path/include 
-I/usr/path/include conftest.c -Wl,-E -lruby-static -liconv -ldl -lcrypt 
-lm -lc
conftest.c: In function `t':
conftest.c:4: `iconv' undeclared (first use in this function)
conftest.c:4: (Each undeclared identifier is reported only once
conftest.c:4: for each function it appears in.)
checked program was:
/* begin */


int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))iconv; return 0; }
/* end */
==================