Sha256: ca00a1bef7e68b1cf4600841b3b02c3323712362762a5d32dead4b3ec56580a8
Contents?: true
Size: 968 Bytes
Versions: 52
Compression:
Stored size: 968 Bytes
Contents
if RUBY_PLATFORM == "java" # Don't do anything when run in JRuby; this allows gem installation to pass. # We need to write a dummy Makefile so that RubyGems doesn't think compilation # failed. File.open('Makefile', 'w') do |f| f.puts "all:" f.puts "\t@true" f.puts "install:" f.puts "\t@true" end exit 0 elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == "maglev" # Maglev doesn't support C extensions, fall back to compiling an FFI usable # library File.open('Makefile', 'w') do |f| f.puts <<-MAKEFILE CFLAGS = -fPIC OBJS = bcrypt.o blowfish.o DLIB = bcrypt_ext.so OS ?= $(strip $(shell uname -s | tr '[:upper:]' '[:lower:]')) ifeq ($(OS),darwin) DLIB = bcrypt_ext.dylib CFLAGS += -dynamiclib endif all: $(OBJS) cc -shared -o $(DLIB) $(OBJS) install: install $(DLIB) "../../lib/" clean: $(RM) $(OBJS) bcrypt_ext.so MAKEFILE end exit 0 else require "mkmf" dir_config("bcrypt_ext") create_makefile("bcrypt_ext") end
Version data entries
52 entries across 49 versions & 5 rubygems