From: "Iñaki Baz Castillo" Date: 2012-06-02T04:25:06+09:00 Subject: Re: [C exten] extconf.rg and #ifdef 2012/5/31 Eric Hodel : > On May 28, 2012, at 03:57, Iñaki Baz Castillo wrote: > >> Hi, depending whether my Ruby C extension is being compiled on *nix or >> Windows, I need some #defines (i.e: OS_UNIX or OS_WIN). >> >> I see no way in MKMF documentation to generate a #define (based on >> RbConfig["host_os"] for example). > > Do not use host_* values from rbconfig.rb. > > Use target_* values from rbconfig.rb. > > Using host_* is wrong. > > The host_* values come from host that compiled ruby.  When ruby is cross-compiled these values won't match the target and your gem will fail to compile. > > You should use target_* values as these values match the target ruby was compiled for. > > See: http://sources.redhat.com/autobook/autobook/autobook_261.html Good to know. Thanks a lot. -- Iñaki Baz Castillo