From: Alex Young Date: 2011-04-14T00:20:27+09:00 Subject: Re: Building extensions into static libraries Luis Lavena wrote in post #992376: > On Apr 12, 5:21pm, Alex Young wrote: >> I am delving into the wonder that is mkmf.rb. I'm trying to tell >> extconf.rb that I want to build an extension into a static library, but >> I can't see how to tell it to generate the static target in the >> Makefile. Has anyone else tried this? > > So you want to statically link against the Ruby library? > > In that way it will not depend on the libruby shared library? > > If that is the case, then --enable-static option that you can supply > your extconf.rb will already do that for you. > > mkmf will handle that automatically for you. That doesn't seem to be doing what I'm after: $ gem unpack mongrel Unpacked gem: '/home/zander/projects/scratch/mongrel/mongrel-1.1.5' $ cd mongrel-1.1.5 $ ruby ext/http11/extconf.rb --enable-static checking for main() in -lc... yes creating Makefile $ grep -i static Makefile LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static EXTSTATIC = STATIC_LIB = static: $(STATIC_LIB) I'm expecting there to be *something* present for STATIC_LIB, which I want to give me a .a rather than a .so. To be perfectly clear, I simply don't know if what I'm trying to do here is actually possible, but neither do I know where else to look. -- Alex -- Posted via http://www.ruby-forum.com/.