git ssb

0+

dangerousbeans / %aPBe2k3ugtjBr4rrsU1…



Tree: 72661e5717074c43c5e090b82cc6006d86be7cfe

Files: 72661e5717074c43c5e090b82cc6006d86be7cfe / ext / mri / extconf.rb

968 bytesRaw
1if RUBY_PLATFORM == "java"
2 # Don't do anything when run in JRuby; this allows gem installation to pass.
3 # We need to write a dummy Makefile so that RubyGems doesn't think compilation
4 # failed.
5 File.open('Makefile', 'w') do |f|
6 f.puts "all:"
7 f.puts "\t@true"
8 f.puts "install:"
9 f.puts "\t@true"
10 end
11 exit 0
12elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == "maglev"
13 # Maglev doesn't support C extensions, fall back to compiling an FFI usable
14 # library
15 File.open('Makefile', 'w') do |f|
16 f.puts <<-MAKEFILE
17CFLAGS = -fPIC
18OBJS = bcrypt.o blowfish.o
19DLIB = bcrypt_ext.so
20OS ?= $(strip $(shell uname -s | tr '[:upper:]' '[:lower:]'))
21ifeq ($(OS),darwin)
22 DLIB = bcrypt_ext.dylib
23 CFLAGS += -dynamiclib
24endif
25
26all: $(OBJS)
27 cc -shared -o $(DLIB) $(OBJS)
28install:
29 install $(DLIB) "../../lib/"
30clean:
31 $(RM) $(OBJS) bcrypt_ext.so
32 MAKEFILE
33 end
34 exit 0
35else
36 require "mkmf"
37 dir_config("bcrypt_ext")
38 create_makefile("bcrypt_ext")
39end
40

Built with git-ssb-web