Skip to content

Instantly share code, notes, and snippets.

@shulima
Created July 16, 2016 15:25
Show Gist options
  • Save shulima/c49728e1d1dd845b94ae566435ead7c1 to your computer and use it in GitHub Desktop.
Save shulima/c49728e1d1dd845b94ae566435ead7c1 to your computer and use it in GitHub Desktop.
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 0e9a868..e8e5e45 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+DLEXT := $(shell $(RUBY) -rrbconfig -e "puts RbConfig::CONFIG['DLEXT']")
+
EXTRA_DIST = \
Rakefile.in \
README.rdoc \
@@ -32,7 +34,7 @@ CLEANFILES = \
ext/hivex/*~ \
ext/hivex/extconf.h \
ext/hivex/_hivex.o \
- ext/hivex/_hivex.so \
+ ext/hivex/_hivex.$(DLEXT) \
ext/hivex/mkmf.log \
ext/hivex/Makefile
@@ -57,6 +59,6 @@ install:
$(MKDIR_P) $(DESTDIR)$(RUBY_LIBDIR)
$(MKDIR_P) $(DESTDIR)$(RUBY_ARCHDIR)
$(INSTALL) -p -m 0644 $(srcdir)/lib/hivex.rb $(DESTDIR)$(RUBY_LIBDIR)
- $(INSTALL) -p -m 0755 $(builddir)/ext/hivex/_hivex.so $(DESTDIR)$(RUBY_ARCHDIR)
+ $(INSTALL) -p -m 0755 $(builddir)/ext/hivex/_hivex.$(DLEXT) $(DESTDIR)$(RUBY_ARCHDIR)
endif
diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in
index cd99507..86f3195 100644
--- a/ruby/Rakefile.in
+++ b/ruby/Rakefile.in
@@ -40,9 +40,10 @@ end
PKG_NAME='@PACKAGE_NAME@'
PKG_VERSION='@PACKAGE_VERSION@'
+DLEXT=RbConfig::CONFIG['DLEXT']
EXT_CONF='@abs_srcdir@/ext/hivex/extconf.rb'
MAKEFILE='@builddir@/ext/hivex/Makefile'
-HIVEX_MODULE='@builddir@/ext/hivex/_hivex.so'
+HIVEX_MODULE="@builddir@/ext/hivex/_hivex.#{DLEXT}"
HIVEX_SRC='@abs_srcdir@/ext/hivex/_hivex.c'
CLEAN.include [ "@builddir@/ext/**/*.o", HIVEX_MODULE,
--
2.9.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment