Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

UNOFFICIAL mirror of mkrf subversion repo

tree: f7c195fb7d

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 TODO
README
= mkrf -- making C extensions for Ruby a bit easier

<tt>mkrf</tt> is intended to replace <tt>mkmf</tt>, a library for building
Makefiles to build C extensions to Ruby. Its major goals are easy code reuse of
its <tt>Availability</tt> class and simple, well documented, use of the
<tt>Generator</tt> class for Rakefile generation for extensions.

== Basic Usage

<tt>mkrf</tt> works similarly to <tt>mkmf</tt> in that a user writes an
extension configuration (usually <tt>extconf.rb</tt>) and then runs it, which
generates a <tt>Rakefile</tt>. 

In general, <tt>extconf.rb</tt> should be placed in the root directory of the 
extension and it expects by default that files to be compiled have a <tt>.c</tt> 
extension and are in the <tt>lib/</tt> directory.

The most basic usage looks like this, with the name of the library to be linked
as the first argument to <tt>Mkrf::Generator.new</tt>:

  require 'mkrf'
  Mkrf::Generator.new('libtrivial')

Extra arguments may be passed to the generator in a block:
  
  Mkrf::Generator.new('libtrivial) do |g|
    g.logger.level = Logger::WARN
    g.include_library('z')
  end

If the extension does not follow the source in <tt>lib/</tt> / <tt>.c</tt> 
extension convention, it may be overridden in the constructor:

  Mkrf::Generator.new('libxml', '*.c') do |g|
    g.include_library('socket','socket')
    g.include_header('libxml/xmlversion.h', 
                     '/opt/include/libxml2', 
                     '/usr/local/include/libxml2', 
                     '/usr/include/libxml2')
  end


== Credits
* Jim Weirich for writing Rake

== Licence
mkrf is available under an MIT-style license.

Copyright (c) 2006 Kevin Clark

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.