Thursday, August 4, 2011

Build libffi and libyaml on MinGW for Ruby 1.9.3

This article is for overwriting installation. If you want to do clean installation, check phosphorescence: Clean installation Ruby 1.9.3 preview1 with MinGW and MSYS.

Since Ruby 1.9.3, Ruby will become to depend on both libffi and libyaml. If you are Mac user or Linux user, that's easy. But, if you are windows user, it's difficult. In this post, I introduce building both libffi, libyaml and ruby 1.9.3 preview1 on MinGW. If you want to use cygwin or VisualStudio, see other articles with google.

libffi

It's better to build in dynamic with --enable-shared option.
$ tar -zxvf libffi-3.0.9.tar.gz
$ cd libffi-3.0.9
$ ./configure --enable-shared
$ make
$ make install

libyaml

On MinGW, libyaml does not support building in dynamic. We need to build in static with YAML_DECLARE_STATIC option.
$ tar -zxvf yaml-0.1.4.tar.gz
$ cd yaml-0.1.4
$ ./configure CFLAGS="-DYAML_DECLARE_STATIC"
$ make
$ make install

ruby 1.9.3 preview1

If you install both libffi and libyaml in /usr/local, we just do like below:
$ tar -jxvf ruby-1.9.3-preview1.tar.bz2
$ cd ruby-1.9.3-preview1
$ ./configure --with-opt-dir=/usr/local --enable-shared --prefix=C:/ruby-1.9.1
$ make
$ make install

No comments:

Post a Comment