# Mkmf-lite 0.1.0

**URL:** <https://www.ruby-forum.com/t/mkmf-lite-0-1-0/189125>\
**Category:** Ruby\
**Created:** [May 25, 2010, 3:34am UTC](https://www.ruby-forum.com/t/mkmf-lite-0-1-0/189125 "2010-05-25T03:34:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [May 25, 2010, 3:34am UTC](https://www.ruby-forum.com/t/mkmf-lite-0-1-0/189125/1 "2010-05-25T03:34:21Z")

</div>

Greetings,

I’m happy to announce the release of mkmf-lite 0.1.0. This is the  
initial release of this library.

= What is it?

A very lite version of mkmf. Unlike mkmf it is designed to be a library,  
rather than a Makefile generator.

= How do you use it?

require ‘mkmf/lite’  
require ‘ffi’

class Foo  
include Mkmf::Lite  
extend FFI::Library

# No Makefile generation, no output, just true or false

if have\_struct(‘struct stat’, ‘st\_uid’, ‘sys/stat.h’)  
# Do something funky with FFI  
end  
end

= What functions does it offer?

- have\_header
- have\_func
- have\_struct\_member

= Ok, but why this instead of just mkmf?

First, mkmf is meant to be used as a Makefile generator, run from the  
command line. It is NOT designed to be used as an independent library.

The mkmf-lite library does not generate a Makefile, nor does it create  
an mkmf.log file. It does not emit anything to standard output, either.

What it does have are a few handy methods that you can use for C  
extensions, FFI libraries, and tests. You can simply mix it into your  
class or tests, and use the methods for handy C related construct  
checks.

= How do I get it?

gem install mkmf-lite

Enjoy!

Dan
