summaryrefslogtreecommitdiff
path: root/ruby-config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ruby-config.rb')
-rw-r--r--ruby-config.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/ruby-config.rb b/ruby-config.rb
new file mode 100644
index 0000000..ab23d51
--- /dev/null
+++ b/ruby-config.rb
@@ -0,0 +1,15 @@
+require 'rbconfig'
+
+if ARGV.include?('--cflags')
+ if Config::CONFIG["rubyhdrdir"]
+ rubyhdrdir = Config::CONFIG["rubyhdrdir"]
+ arch = Config::CONFIG["arch"]
+ puts "-I#{rubyhdrdir} -I#{rubyhdrdir}/#{arch}"
+ else
+ puts '-I' + Config::CONFIG["archdir"]
+ end
+end
+
+if ARGV.include?('--libs')
+ puts Config::CONFIG["LIBRUBYARG"] || "-l" + Config::CONFIG["ruby_install_name"]
+end