summaryrefslogtreecommitdiff
path: root/template/verconf.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'template/verconf.h.in')
-rw-r--r--template/verconf.h.in55
1 files changed, 55 insertions, 0 deletions
diff --git a/template/verconf.h.in b/template/verconf.h.in
new file mode 100644
index 0000000..a97cf30
--- /dev/null
+++ b/template/verconf.h.in
@@ -0,0 +1,55 @@
+% require './rbconfig'
+% C = RbConfig::MAKEFILE_CONFIG
+%
+% verconf =
+#define RUBY_BASE_NAME "${RUBY_BASE_NAME}"
+#define RUBY_VERSION_NAME RUBY_BASE_NAME"-"RUBY_LIB_VERSION
+% if C["RUBY_LIB_VERSION_STYLE"]
+#define RUBY_LIB_VERSION_STYLE ${RUBY_LIB_VERSION_STYLE}
+% else
+#define RUBY_LIB_VERSION ${RUBY_LIB_VERSION}
+% end
+#define RUBY_EXEC_PREFIX "${RUBY_EXEC_PREFIX}"
+#define RUBY_LIB_PREFIX "${rubylibprefix}"
+% unless C["sitearch"] == '$(arch)'
+#define RUBY_SITEARCH "${sitearch}"
+% end
+#define RUBY_ARCH_PREFIX_FOR(arch) "${rubyarchprefix}"
+#define RUBY_SITEARCH_PREFIX_FOR(arch) "${rubysitearchprefix}"
+#define RUBY_LIB "${rubylibdir}"
+#define RUBY_ARCH_LIB_FOR(arch) "${rubyarchdir}"
+% if C["sitedir"] == "no"
+#define NO_RUBY_SITE_LIB 1
+% else
+#define RUBY_SITE_LIB "${sitedir}"
+#define RUBY_SITE_ARCH_LIB_FOR(arch) "${sitearchdir}"
+% end
+% if C["vendordir"] == "no"
+#define NO_RUBY_VENDOR_LIB 1
+% else
+#define RUBY_VENDOR_LIB "${vendordir}"
+#define RUBY_VENDOR_ARCH_LIB_FOR(arch) "${vendorarchdir}"
+% end
+% unless C["RUBY_SEARCH_PATH"] == ""
+#define RUBY_SEARCH_PATH "${RUBY_SEARCH_PATH}"
+% end
+%
+% R = {}
+% R["ruby_version"] = '"RUBY_LIB_VERSION"'
+% R["arch"] = '"arch"'
+% R["sitearch"] = '"arch"'
+% R["vendorlibdir"] = '"RUBY_VENDOR_LIB2"'
+% R["sitelibdir"] = '"RUBY_SITE_LIB2"'
+% R["vendordir"] = '"RUBY_VENDOR_LIB"'
+% R["sitedir"] = '"RUBY_SITE_LIB"'
+% R["rubylibdir"] = '"RUBY_LIB"'
+% R["rubylibprefix"] = '"RUBY_LIB_PREFIX"'
+% R["rubyarchprefix"] = '"RUBY_ARCH_PREFIX_FOR(arch)"'
+% R["rubysitearchprefix"] = '"RUBY_SITEARCH_PREFIX_FOR(arch)"'
+% R["exec_prefix"] = '"RUBY_EXEC_PREFIX"'
+% verconf.gsub!(/^(#define\s+(\S+)\s+)(.*)/) {
+% pre, name, repl = $1, $2, $3
+% pat = %["#{name}"]
+% c = C.merge(R.reject {|key, value| key == name or value.include?(pat)})
+% pre + RbConfig.expand(repl, c).gsub(/^""(?!$)|(.)""$/, '\1')
+% }