-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild_all.sh
executable file
·49 lines (37 loc) · 1.22 KB
/
build_all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
LZ4_REV_NO=119
URL=http://lz4.googlecode.com/svn-history/r${LZ4_REV_NO}/trunk
# get lz4 sources from web
rm ext/lz4ruby/lz4.c; wget -P ext/lz4ruby/ $URL/lz4.c
rm ext/lz4ruby/lz4.h; wget -P ext/lz4ruby/ $URL/lz4.h
rm ext/lz4ruby/lz4hc.c; wget -P ext/lz4ruby/ $URL/lz4hc.c
rm ext/lz4ruby/lz4hc.h; wget -P ext/lz4ruby/ $URL/lz4hc.h
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
rm -f ext/lz4ruby/*.o
rm -f ext/lz4ruby/*.so
rm -rf tmp/*
rm -rf pkg/*
rm -rf target/*
rm -rf lib/1.8 lib/1.9 lib/*.jar
# compile & build .jar
rvm use jruby --default
rvm gemset use lz4-ruby
bundle exec rake build:jruby
# compile 1.8.7 native extensions for MinGW
rvm use 1.8.7 --default
rvm gemset use lz4-ruby
bundle exec rake cross compile RUBY_CC_VERSION=1.8.7
# compile 1.9.3 native extensions for MinGW
rvm use 1.9.3 --default
rvm gemset use lz4-ruby
bundle exec rake cross compile RUBY_CC_VERSION=1.9.3
# copy native extensions -> lib/1.x
rvm use 1.8.7 --default
rvm gemset use lz4-ruby
bundle exec rake cross compile RUBY_CC_VERSION=1.8.7:1.9.3
rm lib/lz4ruby.so
# build pre-compiled gem for MinGW
bundle exec rake build:cross
# build "Compile-It-Yourself" gem
rm -rf lib/1.8 lib/1.9
bundle exec rake build