Rojj Rojj - 1 year ago 112
Ruby Question

Ruby C Extensions - Add System Frameworks

I am building a C extension that uses the Mac OSX Accelerate Framework.
When I compile normal C code I include the header

#include <Accelerate/Accelerate.h>

and compile with

llvm-gcc -framework Accelerate code.c -o code

The flag takes care of finding the right libraries.
Can I do something similar for a ruby C extension? I assume I need to include the framework in
but I don't know how.

Answer Source

To use a framework in a Ruby extension, you need to use the have_framework method in your extconf.rb. This will add the appropriate command line options in the Makefile.

In your case you want: