The source of RUBY_PLATFORM

How does Ruby get the information for RUBY_PLATFORM?

On my machine the value is `x86_64-linux`. I can use a shell command `arch`
to get "x86_64". Where does is get the "linux" part?

Probably from uname -o

This is in the source for ruby-1.8.7-p352:

$ grep RUBY_PLATFORM configure
#define RUBY_PLATFORM __ARCHITECTURE__ "-${target_os}"
#define RUBY_PLATFORM "${arch}"

And target_os is determined by autoconf. See
http://sources.redhat.com/autobook/autobook/autobook_261.html

autoconf is a mess of shell scripts and m4, have fun digging through
them :slight_smile:

···

--
Posted via http://www.ruby-forum.com/.

Look at e.g. ruby-1.9.3-p194/.ext/include/i686-linux/ruby/config.h

···

On Tue, Aug 7, 2012 at 7:54 AM, Intransition <transfire@gmail.com> wrote:

How does Ruby get the information for RUBY_PLATFORM?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

twitter: @hassan