blob: 0ae589cb0b60b56b1105a6a60e5a4077b5f5312d [file] [log] [blame]
Nicolas Noble524d7ed2016-02-05 16:35:48 -08001#!/bin/bash
Craig Tiller6169d5f2016-03-31 07:46:18 -07002# Copyright 2015, Google Inc.
Nicolas Noble524d7ed2016-02-05 16:35:48 -08003# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met:
8#
9# * Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# * Redistributions in binary form must reproduce the above
12# copyright notice, this list of conditions and the following disclaimer
13# in the documentation and/or other materials provided with the
14# distribution.
15# * Neither the name of Google Inc. nor the names of its
16# contributors may be used to endorse or promote products derived from
17# this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31set -ex
32
Nicolas "Pixel" Nobleff2e76e2016-02-06 03:36:18 +010033rm -rf ~/.rake-compiler
34
Nicolas Noble07854f72016-02-05 17:51:48 -080035CROSS_RUBY=`mktemp tmpfile.XXXXXXXX`
Nicolas Noble524d7ed2016-02-05 16:35:48 -080036
Alexander Polcynd490a9e2017-02-08 19:31:45 -080037curl 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 -080038
39patch $CROSS_RUBY << EOF
40--- cross-ruby.rake 2016-02-05 16:26:53.000000000 -0800
41+++ cross-ruby.rake.patched 2016-02-05 16:27:33.000000000 -0800
42@@ -133,7 +133,8 @@
43 "--host=#{MINGW_HOST}",
44 "--target=#{MINGW_TARGET}",
45 "--build=#{RUBY_BUILD}",
46- '--enable-shared',
47+ '--enable-static',
48+ '--disable-shared',
49 '--disable-install-doc',
50 '--without-tk',
51 '--without-tcl'
52EOF
53
54MAKE="make -j8"
55
Alexander Polcynd490a9e2017-02-08 19:31:45 -080056for v in 2.4.0 2.3.0 2.2.2 2.1.5 2.0.0-p645 ; do
57 ccache -c
Nicolas Noble524d7ed2016-02-05 16:35:48 -080058 rake -f $CROSS_RUBY cross-ruby VERSION=$v HOST=x86_64-darwin11
59done
60
Nicolas "Pixel" Noble700cae32016-02-06 01:52:38 +010061sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > $CROSS_RUBY
Nicolas "Pixel" Noble9d6de142016-02-06 03:31:16 +010062mv $CROSS_RUBY ~/.rake-compiler/config.yml