Files: 72661e5717074c43c5e090b82cc6006d86be7cfe / ext / mri / extconf.rb
968 bytesRaw
1 | if 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 |
12 | elsif 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 |
17 | CFLAGS = -fPIC |
18 | OBJS = bcrypt.o blowfish.o |
19 | DLIB = bcrypt_ext.so |
20 | OS ?= $(strip $(shell uname -s | tr '[:upper:]' '[:lower:]')) |
21 | ifeq ($(OS),darwin) |
22 | DLIB = bcrypt_ext.dylib |
23 | CFLAGS += -dynamiclib |
24 | endif |
25 | |
26 | all: $(OBJS) |
27 | cc -shared -o $(DLIB) $(OBJS) |
28 | install: |
29 | install $(DLIB) "../../lib/" |
30 | clean: |
31 | $(RM) $(OBJS) bcrypt_ext.so |
32 | MAKEFILE |
33 | end |
34 | exit 0 |
35 | else |
36 | require "mkmf" |
37 | dir_config("bcrypt_ext") |
38 | create_makefile("bcrypt_ext") |
39 | end |
40 |
Built with git-ssb-web