On Oct 29, 2007 4:10 PM, Wincent Colaiuta <win / wincent.com> wrote:
> Here's an excerpt from a simple extconf.rb:
>
>     have_header('antlr3.h')
>     have_library('antlr3c', 'antlr3ParserNew')
>
> The "have_library" line worked fine on the previous version of Mac OS
> X (Tiger), but under Leopard it can't find the library. Output is:
>
>     checking for antlr3ParserNew() in -lantlr3c... no
>
> The library is definitely present at "/usr/local/lib/libantlr3c.a" and
> inspection using the "nm" tool reveals that the "antlr3ParserNew"
> symbol is definitely present in the library.
>

Maybe this is because Leopard's Ruby builds its extensions universal
(for both i386 and ppc architectures), and that
"/usr/local/lib/libantlr3c.a" isn't universal.

You can verify this using:

$ file /usr/local/lib/libantlr3c.a

If the library is only compiled for your arch, the solution is to
appropriately set the ARCHFLAGS environment variable.

The following page has some information regarding ARCHFLAGS:

http://trac.macosforge.org/projects/ruby/wiki/WhatsNewInLeopard#Ruby

Laurent