how to find ruby header file without platform dependency.

J

Jun Young Kim

Hello everyone.

Now I am wondering to have a way to find a location of the ruby header =
file in various platforms whenever I try to configure to compile my =
sources.

in case of python, it provide the 'python-config' executable file to =
find a location of python.h.

how about ruby?

Is there any possible way to get a location(path) of it.

thanks for all.=
 
S

Stefano Crocco

|Hello everyone.
|
|Now I am wondering to have a way to find a location of the ruby header
| file in various platforms whenever I try to configure to compile my
| sources.
|
|in case of python, it provide the 'python-config' executable file to find
| a location of python.h.
|
|how about ruby?
|
|Is there any possible way to get a location(path) of it.
|
|thanks for all.
|

You can look at the Config module and, in particular, at Config::CONFIG, which
is a hash containing a number of build-time settings.

For example (using ruby 1.9):

require 'rbconfig' #you don't need this line in ruby 1.8
puts Config::CONFIG.keys.sort

=>
["ALLOCA", "AR", "ARCHFILE", "ARCH_FLAG", "AS", "ASFLAGS", "BASERUBY",
"BUILTIN_TRANSSRCS", "CC", "CCDLFLAGS", "CFLAGS", "COMMON_HEADERS",
"COMMON_LIBS", "COMMON_MACROS", "COUTFLAG", "CP", "CPP", "CPPFLAGS",
"CPPOUTFILE", "CXX", "CXXFLAGS", "DEFS", "DESTDIR", "DLDFLAGS", "DLDLIBS",
"DLEXT", "DLEXT2", "DLLWRAP", "ECHO_C", "ECHO_N", "ECHO_T", "EGREP",
"ENABLE_SHARED", "EXEEXT", "EXPORT_PREFIX", "EXTOUT", "EXTSTATIC", "GNU_LD",
"GREP", "INSTALL", "INSTALL_DATA", "INSTALL_PROGRAM", "INSTALL_SCRIPT",
"LDFLAGS", "LDSHARED", "LDSHAREDXX", "LIBEXT", "LIBPATHENV", "LIBPATHFLAG",
"LIBRUBY", "LIBRUBYARG", "LIBRUBYARG_SHARED", "LIBRUBYARG_STATIC",
"LIBRUBY_A", "LIBRUBY_ALIASES", "LIBRUBY_DLDFLAGS", "LIBRUBY_LDSHARED",
"LIBRUBY_SO", "LIBS", "LINK_SO", "LN_S", "MAINLIBS", "MAJOR", "MAKEDIRS",
"MAKEFILES", "MANTYPE", "MINOR", "NM", "NROFF", "OBJCOPY", "OBJDUMP",
"OBJEXT", "OUTFLAG", "PACKAGE_BUGREPORT", "PACKAGE_NAME", "PACKAGE_STRING",
"PACKAGE_TARNAME", "PACKAGE_VERSION", "PATH_SEPARATOR", "PREP", "RANLIB",
"RDOCTARGET", "RM", "RMALL", "RMDIRS", "RPATHFLAG", "RUBYW_INSTALL_NAME",
"RUBY_INSTALL_NAME", "RUBY_SO_NAME", "SET_MAKE", "SHELL", "SOLIBS", "STATIC",
"STRIP", "TEENY", "THREAD_MODEL", "TRY_LINK", "WINDRES", "arch", "archdir",
"bindir", "build", "build_alias", "build_cpu", "build_os", "build_vendor",
"cflags", "configure_args", "cppflags", "datadir", "datarootdir",
"debugflags", "docdir", "dvidir", "exec_prefix", "host", "host_alias",
"host_cpu", "host_os", "host_vendor", "htmldir", "includedir", "infodir",
"libdir", "libexecdir", "localedir", "localstatedir", "mandir",
"oldincludedir", "optflags", "pdfdir", "prefix", "psdir", "ruby_install_name",
"ruby_version", "rubyhdrdir", "rubylibdir", "rubyw_install_name", "sbindir",
"setup", "sharedstatedir", "sitearch", "sitearchdir", "sitedir", "sitehdrdir",
"sitelibdir", "sysconfdir", "target", "target_alias", "target_cpu",
"target_os", "target_vendor", "topdir", "vendorarchdir", "vendordir",
"vendorhdrdir", "vendorlibdir", "warnflags"]

I hope this helps

Stefano
 
J

Jun Young Kim

thanks stefano. :)

2009. 11. 12., =BF=C0=C8=C4 6:53, Stefano Crocco =C0=DB=BC=BA:
|Hello everyone.
|
|Now I am wondering to have a way to find a location of the ruby = header
| file in various platforms whenever I try to configure to compile my
| sources.
|
|in case of python, it provide the 'python-config' executable file to = find
| a location of python.h.
|
|how about ruby?
|
|Is there any possible way to get a location(path) of it.
|
|thanks for all.
|
=20
You can look at the Config module and, in particular, at = Config::CONFIG, which=20
is a hash containing a number of build-time settings.
=20
For example (using ruby 1.9):
=20
require 'rbconfig' #you don't need this line in ruby 1.8
puts Config::CONFIG.keys.sort
=20
=3D>
["ALLOCA", "AR", "ARCHFILE", "ARCH_FLAG", "AS", "ASFLAGS", "BASERUBY",=20=
"BUILTIN_TRANSSRCS", "CC", "CCDLFLAGS", "CFLAGS", "COMMON_HEADERS",=20
"COMMON_LIBS", "COMMON_MACROS", "COUTFLAG", "CP", "CPP", "CPPFLAGS",=20=
"CPPOUTFILE", "CXX", "CXXFLAGS", "DEFS", "DESTDIR", "DLDFLAGS", = "DLDLIBS",=20
"DLEXT", "DLEXT2", "DLLWRAP", "ECHO_C", "ECHO_N", "ECHO_T", "EGREP",=20=
"ENABLE_SHARED", "EXEEXT", "EXPORT_PREFIX", "EXTOUT", "EXTSTATIC", = "GNU_LD",=20
"GREP", "INSTALL", "INSTALL_DATA", "INSTALL_PROGRAM", = "INSTALL_SCRIPT",=20
"LDFLAGS", "LDSHARED", "LDSHAREDXX", "LIBEXT", "LIBPATHENV", = "LIBPATHFLAG",=20
"LIBRUBY", "LIBRUBYARG", "LIBRUBYARG_SHARED", "LIBRUBYARG_STATIC",=20
"LIBRUBY_A", "LIBRUBY_ALIASES", "LIBRUBY_DLDFLAGS", = "LIBRUBY_LDSHARED",=20
"LIBRUBY_SO", "LIBS", "LINK_SO", "LN_S", "MAINLIBS", "MAJOR", = "MAKEDIRS",=20
"MAKEFILES", "MANTYPE", "MINOR", "NM", "NROFF", "OBJCOPY", "OBJDUMP",=20=
"OBJEXT", "OUTFLAG", "PACKAGE_BUGREPORT", "PACKAGE_NAME", = "PACKAGE_STRING",=20
"PACKAGE_TARNAME", "PACKAGE_VERSION", "PATH_SEPARATOR", "PREP", = "RANLIB",=20
"RDOCTARGET", "RM", "RMALL", "RMDIRS", "RPATHFLAG", = "RUBYW_INSTALL_NAME",=20
"RUBY_INSTALL_NAME", "RUBY_SO_NAME", "SET_MAKE", "SHELL", "SOLIBS", = "STATIC",=20
"STRIP", "TEENY", "THREAD_MODEL", "TRY_LINK", "WINDRES", "arch", = "archdir",=20
"bindir", "build", "build_alias", "build_cpu", "build_os", = "build_vendor",=20
"cflags", "configure_args", "cppflags", "datadir", "datarootdir",=20
"debugflags", "docdir", "dvidir", "exec_prefix", "host", "host_alias",=20=
"host_cpu", "host_os", "host_vendor", "htmldir", "includedir", = "infodir",=20
"libdir", "libexecdir", "localedir", "localstatedir", "mandir",=20
"oldincludedir", "optflags", "pdfdir", "prefix", "psdir", = "ruby_install_name",=20
"ruby_version", "rubyhdrdir", "rubylibdir", "rubyw_install_name", = "sbindir",=20
"setup", "sharedstatedir", "sitearch", "sitearchdir", "sitedir", = "sitehdrdir",=20
"sitelibdir", "sysconfdir", "target", "target_alias", "target_cpu",=20
"target_os", "target_vendor", "topdir", "vendorarchdir", "vendordir",=20=
"vendorhdrdir", "vendorlibdir", "warnflags"]
=20
I hope this helps
=20
Stefano
=20
=20
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top