Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2770

Re: Building extensions into static libraries

From Alex Young <alex@blackkettle.org>
Newsgroups comp.lang.ruby
Subject Re: Building extensions into static libraries
Date 2011-04-13 10:20 -0500
Organization Service de news de lacave.net
Message-ID <f59d2b5fa81e0f30c120e6895341fb14@ruby-forum.com> (permalink)
References <d91d62db0fd3fffefa35dd68d23c2939@ruby-forum.com> <e7d092f7-8ede-40d2-9cdf-4d556af6a729@17g2000prr.googlegroups.com>

Show all headers | View raw


Luis Lavena wrote in post #992376:
> On Apr 12, 5:21pm, Alex Young <a...@blackkettle.org> 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/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Building extensions into static libraries Alex Young <alex@blackkettle.org> - 2011-04-12 15:21 -0500
  Re: Building extensions into static libraries Luis Lavena <luislavena@gmail.com> - 2011-04-12 13:34 -0700
    Re: Building extensions into static libraries Alex Young <alex@blackkettle.org> - 2011-04-13 10:20 -0500
      Re: Building extensions into static libraries Luis Lavena <luislavena@gmail.com> - 2011-04-13 14:54 -0700
        Re: Building extensions into static libraries Alex Young <alex@blackkettle.org> - 2011-04-14 00:38 -0500

csiph-web