diff --git a/ext/extconf.rb b/ext/extconf.rb index 9a9b0208b..160d08c34 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -139,6 +139,15 @@ def manual_ssl_config when /aix/ CONFIG['LDSHARED'] = "$(CXX) -shared -Wl,-G -Wl,-brtl" +when /cygwin/ + # For rubies built with Cygwin, CXX may be set to CC, which is just + # a wrapper for gcc. + # This will compile, but it will not link to the C++ std library. + # Explicitly set CXX to use g++. + CONFIG['CXX'] = "g++" + # on Unix we need a g++ link, not gcc. + CONFIG['LDSHARED'] = "$(CXX) -shared" + else # on Unix we need a g++ link, not gcc. CONFIG['LDSHARED'] = "$(CXX) -shared" diff --git a/ext/fastfilereader/extconf.rb b/ext/fastfilereader/extconf.rb index 1c9b1b2af..07fe97905 100644 --- a/ext/fastfilereader/extconf.rb +++ b/ext/fastfilereader/extconf.rb @@ -77,6 +77,15 @@ def add_define(name) # on Unix we need a g++ link, not gcc. CONFIG['LDSHARED'] = "$(CXX) -shared -Wl,-G" +when /cygwin/ + # For rubies built with Cygwin, CXX may be set to CC, which is just + # a wrapper for gcc. + # This will compile, but it will not link to the C++ std library. + # Explicitly set CXX to use g++. + CONFIG['CXX'] = "g++" + # on Unix we need a g++ link, not gcc. + CONFIG['LDSHARED'] = "$(CXX) -shared" + else # on Unix we need a g++ link, not gcc. CONFIG['LDSHARED'] = "$(CXX) -shared"