When Ruby is compiled for a particular architecture, all of the
relevant settings used to build it (including the architecture of the
machine on which it was compiled, compiler options, source code
directory, and so on) are written to the module
Config
within the
library file ``
rbconfig.rb
''.
After installation, any Ruby program can use this module to get
details on how Ruby was compiled.
require "rbconfig.rb"
|
include Config
|
CONFIG["host"]
|
� |
"i686-pc-linux"
|
CONFIG["LDFLAGS"]
|
� |
"-rdynamic"
|
Extension libraries use this configuration file in order to compile
and link properly on any given architecture. See Chapter
17 beginning on page 169, and the reference
for
mkmf
beginning on page 451 for details.