From 2283ff6638739da590332bd987380205996a0e27 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 29 Jan 2016 06:49:46 +0100 Subject: [PATCH] Fixing dll hell. --- src/ruby/ext/grpc/extconf.rb | 5 +++++ third_party/rake-compiler-dock/Dockerfile | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb index 9fad5b9904bc7..b7a6d71d25074 100644 --- a/src/ruby/ext/grpc/extconf.rb +++ b/src/ruby/ext/grpc/extconf.rb @@ -109,6 +109,11 @@ $CFLAGS << ' -Werror ' $CFLAGS << ' -Wno-format ' +case RUBY_PLATFORM +when /mingw|mswin/ + $LDFLAGS << ' -static ' +end + subdir = RUBY_VERSION.sub(/\.\d$/,'') output = File.join('grpc', 'grpc') puts 'Generating Makefile for ' + output diff --git a/third_party/rake-compiler-dock/Dockerfile b/third_party/rake-compiler-dock/Dockerfile index 11a6bd7796594..435a0926dce61 100644 --- a/third_party/rake-compiler-dock/Dockerfile +++ b/third_party/rake-compiler-dock/Dockerfile @@ -93,6 +93,9 @@ RUN mv /opt/mingw/mingw32/bin/i686-w64-mingw32-strip /opt/mingw/mingw32/bin/i686 RUN find / -name rbconfig.rb | while read f ; do sed -i 's/0x0501/0x0600/' $f ; done RUN find / -name win32.h | while read f ; do sed -i 's/gettimeofday/rb_gettimeofday/' $f ; done RUN sed -i 's/defined.__MINGW64__.$/1/' /usr/local/rake-compiler/ruby/i686-w64-mingw32/ruby-2.0.0-p645/include/ruby-2.0.0/ruby/win32.h +RUN find / -name libwinpthread.dll.a | while read f ; do rm $f ; done +RUN find / -name libwinpthread-1.dll | while read f ; do rm $f ; done +RUN find / -name *msvcrt-ruby*.dll.a | while read f ; do n=`echo $f | sed s/.dll//` ; mv $f $n ; done # Install SIGINT forwarder COPY build/sigfw.c /root/