[redland-dev] ruby interface on mac os x

Dave Beckett dave.beckett at bristol.ac.uk
Wed Apr 9 15:41:48 BST 2003


>>>Seth Ladd said:
> I thought I'd give the ruby interface a whirl, and ran into a small 
> snag.  I'm on a OS X box (latest and greatest version).
> 
> When running make build-ruby, I encounter:
> 
> gcc -shared Redland_wrap.o -o Redland.so `../redland-src-config --libs`
> gcc: unrecognized option `-shared'
> ld: Undefined symbols:
> _main
> _rb_cFalseClass
> _rb_cFixnum
> _rb_cNilClass
> _rb_cObject
> .... more ....
> 
> The bundled gcc3 compiler w/ OS X does not support -shared.
> 
> Is the proper way to solve this to wrap w/ libtool?

Yes.

The ruby and java interfaces are less-loved than the Perl and Python
ones :)

The solution would be something like that used in php (php/Makefile.am):

  $(LIBTOOL) --mode=link $(CC) -shared $(PHP_PACKAGE)_wrap.lo $(top_builddir)/librdf/librdf.la $(top_builddir)/raptor/libraptor.la -o $@


Guessing, you need to replace the two compile (-c -fpic) and link
(-o) targets with ones like these (NOT TESTED)

$(RUBY_PACKAGE)_wrap.lo:  $(RUBY_PACKAGE)_wrap.c
  $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(RUBY_PACKAGE)_wrap.c -prefer-pic -c -o $@

$(RUBY_PACKAGE)_wrap.so: $(RUBY_PACKAGE)_wrap.lo $(top_builddir)/librdf/librdf.la $(top_builddir)/raptor/libraptor.la
  $(LIBTOOL) --mode=link $(CC) -shared $(RUBY_PACKAGE)_wrap.lo $(top_builddir)/librdf/librdf.la $(top_builddir)/raptor/libraptor.la -o $@


the redland-src-config isn't needed when libtool's magic is used,
when it works!

Cheers

Dave



More information about the redland-dev mailing list