cf715e
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
cf715e
index 54f5c23..ee85c23 100644
cf715e
--- a/bindings/Makefile.am
cf715e
+++ b/bindings/Makefile.am
cf715e
@@ -35,8 +35,9 @@ install-data-local:
cf715e
                 && $(MAKE) install ) \
cf715e
            || true
cf715e
 	$(AM_V_GEN)test -f ${builddir}/ruby/Makefile \
cf715e
-           && ( cd ${builddir}/ruby \
cf715e
-                && $(MAKE) EPREFIX=$(DESTDIR)$(exec_prefix) $(RUBY_MAKE_OPTIONS) install ) \
cf715e
+           && ( $(MKDIR_P) $(DESTDIR)$(libdir)/ruby/vendor_ruby && cd ${builddir}/ruby \
cf715e
+                && $(MAKE) EPREFIX=$(DESTDIR)$(exec_prefix) $(RUBY_MAKE_OPTIONS) \
cf715e
+                hdrdir="$(includedir)" rubyhdrdir="$(includedir)" includedir="$(includedir)" install ) \
cf715e
            || true
cf715e
 	$(AM_V_GEN)test -d ${builddir}/python/build \
cf715e
            && ( cd ${builddir}/python \
cf715e
@@ -57,7 +58,8 @@ ruby:
cf715e
              EPREFIX=$(exec_prefix) \
cf715e
              ABS_TOP_SRCDIR=${abs_top_srcdir} \
cf715e
              ABS_TOP_BUILDDIR=${abs_top_builddir} \
cf715e
-             $(RUBY_MAKE_OPTIONS) RUBYARCHDIR= )
cf715e
+             $(RUBY_MAKE_OPTIONS) hdrdir="$(includedir)" \
cf715e
+             rubyhdrdir="$(includedir)" includedir="$(includedir)" RUBYARCHDIR= )
cf715e
 
cf715e
 # rules for building the python module
cf715e
 python: