ts wrote:
> D> What about adding these configure option, so plruby.so doesn't need 
> D> libruby.so at all? But sorry, I'm still not sure how to modify 
> D> extconf.rb to accomplish this. In the Makefile I just replace LIBS= 
> D> $(LIBRUBYARG_SHARED) with $(LIBRUBYARG_STATIC).
> 
>  What is your version of plruby and ruby ?

plruby 0.3.9, ruby 1.8.1 (using Ian's binary RPM).

$ ruby -v extconf.rb --with-pgsql-include=/usr/include/pgsql
ruby 1.8.1 (2004-01-01) [i686-linux-gnu]
checking for ruby_init() in -lruby-static... yes
checking for catalog/pg_proc.h... yes
checking for PQsetdbLogin() in -lpq... yes
checking for rb_hash_delete()... yes
checking for server/utils/array.h... yes
creating Makefile

  ========================================================================
  After the installation use something like this to create the language
  plruby


    create function plruby_call_handler() returns language_handler
    as '/usr/lib/ruby/site_ruby/1.8/i686-linux-gnu/plruby.so'
    language 'C';

    create trusted  language 'plruby'
    handler plruby_call_handler
    lancompiler 'PL/Ruby';

  ========================================================================

$ make
/home/dave/usr/src/plruby-0.3.9/src
make[1]: Entering directory `/home/dave/usr/src/plruby-0.3.9/src'
gcc -fPIC -g -O2  -fPIC -I/usr/include/pgsql/server -DPG_PL_VERSION=74 
-DPLRUBY_CALL_HANDLER=plruby_call_handler  -I. 
-I/usr/lib/ruby/1.8/i686-linux-gnu -I/usr/lib/ruby/1.8/i686-linux-gnu 
-I. -DHAVE_CATALOG_PG_PROC_H -DHAVE_RB_HASH_DELETE 
-DHAVE_SERVER_UTILS_ARRAY_H -I/usr/include/pgsql -I/usr/kerberos/include 
-c plruby.c
gcc -shared  -L"/usr/lib" -L"/usr/local/pgsql/lib" -o plruby.so plruby.o 
  -lruby -lpq -lruby-static  -ldl -lcrypt -lm   -lc
make[1]: Leaving directory `/home/dave/usr/src/plruby-0.3.9/src'

$ grep LIBS src/Makefile
LOCAL_LIBS =
LIBS = $(LIBRUBYARG_SHARED) -lpq -lruby-static  -ldl -lcrypt -lm   -lc
CLEANLIBS     = "$(TARGET).{lib,exp,il?,tds,map}" $(DLLIB)
                 @$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
         $(LDSHARED) $(DLDFLAGS) $(LIBPATH) -o $(DLLIB) $(OBJS) 
$(LOCAL_LIBS) $(LIBS)

$ ldd src/plruby.so | grep ruby
         libruby.so.1.8 => /usr/lib/libruby.so.1.8 (0x40025000)
$ du -b src/plruby.so
233472  src/plruby.so



If I create with -lruby-static (no -lruby):

$ ldd src/plruby.so | grep ruby
$ du -b src/plruby.so
1904640 src/plruby.so


If I use a static ruby (ruby configured with --disable-shared), I can't 
get the resulting plruby.so to work (no ruby runtime linked).

Thanks,
-- 
dave