README.rdoc in rake-compiler-0.5.0 vs README.rdoc in rake-compiler-0.6.0
- old
+ new
@@ -1,14 +1,14 @@
= rake-compiler
rake-compiler aims to help Gem developers while dealing with Ruby C
-extensions, simplifiying the code and reducing the duplication.
+extensions, simplifying the code and reducing the duplication.
-It follows *convention over configuration* and set an standarized
+It follows *convention over configuration* and set an standardized
structure to build and package C extensions in your gems.
-This is the result of expriences dealing with several Gems that required
+This is the result of experiences dealing with several Gems that required
native extensions across platforms and different user configurations
where details like portability and clarity of code were lacking.
== An Overview
@@ -158,27 +158,27 @@
# will be used to based on.
end
== Future is now: Cross compilation
-rake-compiler provides now an standarized way to generate, from Linux or OSX
+rake-compiler provides now an standardized way to generate, from Linux or OSX
both extensions and gem binaries for Windows!
It takes advantages from GCC host/target to build binaries (for target) on
different OS (hosts).
=== How I enjoy this?
Besides having the development tool chain installed (GCC), you should install
also <tt>mingw32</tt> cross compilation package.
-Dependending on your operating system distribution, a simple <tt>apt-get install mingw32</tt>
-will be enough.
+This depends on your operating system distribution, a simple
+<tt>apt-get install mingw32</tt> will be enough.
Please check OSX documentation about installing mingw32 from macports.
-=== I have my toolchain, now what?
+=== I have my tool-chain, now what?
You need to build Ruby for Windows.
Relax, no need to freak out. rake-compiler do it for you:
@@ -192,11 +192,11 @@
rake-compiler cross-ruby VERSION=1.8.6-p114
=== Let's build some gems!
-Now, you only need to use additional options in your extension defintion:
+Now, you only need to use additional options in your extension definition:
Rake::ExtensionTask.new('my_extension', gem_spec) do |ext|
ext.cross_compile = true # enable cross compilation (requires cross compile toolchain)
ext.cross_platform = 'i386-mswin32' # forces the Windows platform instead of the default one
# configure options only for cross compile
@@ -223,14 +223,29 @@
=== Take it even further
You can specify against with version of Ruby you want to build the extension:
- rake cross compile RUBY_CC_VERSION=1.8
+ rake cross compile RUBY_CC_VERSION=1.8.6
If you installed <tt>1.9.1</tt>, you can do:
- rake cross compile RUBY_CC_VERSION=1.9
+ rake cross compile RUBY_CC_VERSION=1.9.1
+
+Even more, you can target multiple versions (ie. 1.8.6 and 1.9.1):
+
+ rake cross compile RUBY_CC_VERSION=1.8.6:1.9.1
+
+And more exiting, bundle both binaries in one "fat" Gem:
+
+ rake cross native gem RUBY_CC_VERSION=1.8.6:1.9.1
+
+That will place binaries for 1.8 and 1.9 versions of ruby inside <tt>lib_dir</tt>
+
+ lib/1.8/my_extension.so
+ lib/1.9/my_extension.so
+
+Now is up to you to make your gem load the proper one ;-)
== Future
rake-compiler is a work in progress and we will appreciate feedback during the
development of it! (and contributions too!)