If you don't already have it, then you need to install the Developer Tools that are packaged on your Mac OS X disc. You can also download the latest version.
You should now be able to run make
in the root of the pinmame directory.
- Run
gem update --system
to make sure that you are using the latest version of RubyGems. - Run
gem install rake
to make sure that you have rake installed. - Run
gem install ffi
.
After you have run make
and with Ruby FFI installed, you can test your configuration by running ruby test.rb
. If you see a 0
on the next line then you are all set.
Grab a copy of Cygwin. Make sure that you select the following packages for installation.
Under 'Devel'
- ruby
- gcc
Under 'Lib'
- libffi
Under 'Mingw'
- mingw-libz
With this much installed you should be able to run make
in the root of the directory. This will build libpinmame.dll
. But you won't be able to use Ruby FFI to make calls into the library. Since this is how most future work will be developed, you need to get your ruby environment up and running.
You need to use ruby from Cygwin in order to use it to make calls into libpinmame
. So the first thing that you need to do is install RubyGems.
- Grab the RubyGems source
- Unzip with
tar -zxvf rubygems-X.X.X.tgz
- Switch to the RubyGems directory
- Run
/usr/bin/ruby setup.rb
. Note this needs to be run from a Cygwin console window. - Run
/usr/bin/gem update --system
. - Run
/usr/bin/gem install rake
.
Now you have a working copy of Ruby with RubyGems support. Congrats!
This part is really easy. Just run /usr/bin/gem install ffi
. That's it. Wasn't that easy?
Now you should be able to run /usr/bin/ruby test.rb
. If you see 0
on the next line then it worked.