blob: c2240ce97611c2b8a2d2540346ea245bd52831cc [file] [log] [blame]
Nicolas Noble524d7ed2016-02-05 16:35:48 -08001#!/bin/bash
Jan Tattermusch7897ae92017-06-07 22:57:36 +02002# Copyright 2015 gRPC authors.
Nicolas Noble524d7ed2016-02-05 16:35:48 -08003#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02004# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
Nicolas Noble524d7ed2016-02-05 16:35:48 -08007#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02008# http://www.apache.org/licenses/LICENSE-2.0
Nicolas Noble524d7ed2016-02-05 16:35:48 -08009#
Jan Tattermusch7897ae92017-06-07 22:57:36 +020010# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Nicolas Noble524d7ed2016-02-05 16:35:48 -080015
16set -ex
17
Nicolas "Pixel" Nobleff2e76e2016-02-06 03:36:18 +010018rm -rf ~/.rake-compiler
19
Nicolas Noble07854f72016-02-05 17:51:48 -080020CROSS_RUBY=`mktemp tmpfile.XXXXXXXX`
Nicolas Noble524d7ed2016-02-05 16:35:48 -080021
Alexander Polcynd490a9e2017-02-08 19:31:45 -080022curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v1.0.3/tasks/bin/cross-ruby.rake > $CROSS_RUBY
Nicolas Noble524d7ed2016-02-05 16:35:48 -080023
24patch $CROSS_RUBY << EOF
25--- cross-ruby.rake 2016-02-05 16:26:53.000000000 -0800
26+++ cross-ruby.rake.patched 2016-02-05 16:27:33.000000000 -0800
27@@ -133,7 +133,8 @@
28 "--host=#{MINGW_HOST}",
29 "--target=#{MINGW_TARGET}",
30 "--build=#{RUBY_BUILD}",
31- '--enable-shared',
32+ '--enable-static',
33+ '--disable-shared',
34 '--disable-install-doc',
35 '--without-tk',
36 '--without-tcl'
37EOF
38
39MAKE="make -j8"
40
Alexander Polcynd490a9e2017-02-08 19:31:45 -080041for v in 2.4.0 2.3.0 2.2.2 2.1.5 2.0.0-p645 ; do
42 ccache -c
Nicolas Noble524d7ed2016-02-05 16:35:48 -080043 rake -f $CROSS_RUBY cross-ruby VERSION=$v HOST=x86_64-darwin11
44done
45
Nicolas "Pixel" Noble700cae32016-02-06 01:52:38 +010046sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > $CROSS_RUBY
Nicolas "Pixel" Noble9d6de142016-02-06 03:31:16 +010047mv $CROSS_RUBY ~/.rake-compiler/config.yml