Forcing mkmf to use static libraries instead of dynamic ones

Discussion in 'Ruby' started by Wincent Colaiuta, Jun 9, 2007.

  1. I'm building a C extension on Mac OS X and I notice that the Makefile
    created by mkmf prefers dynamic libraries over static ones.

    For example, given this line in my extconf.rb file:

    have_library('antlr3c', 'antlr3ParserNew')

    And these installed libraries:

    libantlr3c.a
    libantlr3c.dylib
    libantlr3c.la

    The Makefile always choose s the "dylib" version... I can force it to
    choose the static version and link statically to it by deleting or
    moving the other libraries, but I'd like to know: is there a way to
    explicitly specify my preference for the static version of the library
    in my extconf.rb file?

    Cheers,
    Wincent
     
    Wincent Colaiuta, Jun 9, 2007
    #1
    1. Advertising

  2. Hi,

    At Sat, 9 Jun 2007 23:20:13 +0900,
    Wincent Colaiuta wrote in [ruby-talk:254934]:
    > The Makefile always choose s the "dylib" version... I can force it to
    > choose the static version and link statically to it by deleting or
    > moving the other libraries, but I'd like to know: is there a way to
    > explicitly specify my preference for the static version of the library
    > in my extconf.rb file?


    How can you tell your compiler and/or linker to use the static
    version, even if the dylib version is also available?

    --
    Nobu Nakada
     
    Nobuyoshi Nakada, Jun 11, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    193
  2. Replies:
    0
    Views:
    126
  3. Steven Hansen

    Using Mkmf to Verify Libraries

    Steven Hansen, Dec 6, 2006, in forum: Ruby
    Replies:
    2
    Views:
    106
    Steven Hansen
    Dec 6, 2006
  4. Replies:
    0
    Views:
    135
  5. Ben Pellegrini
    Replies:
    0
    Views:
    196
    Ben Pellegrini
    Nov 25, 2010
Loading...

Share This Page