diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-19 19:06:18 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-19 19:06:18 +0900 |
commit | 6180f1fede487bf5dfdd00cbae2ee7f2b4613a7e (patch) | |
tree | dc40a568f327ec805dbd13b4e31b311083e8e7fc | |
parent | 6045ff64e3c310cd24f5e49e088610249d4cf24f (diff) | |
download | ruby-6180f1fede487bf5dfdd00cbae2ee7f2b4613a7e.tar.gz |
Added link_command for C++
-rw-r--r-- | lib/mkmf.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index e671ac90e2..eabccd48eb 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -2792,6 +2792,11 @@ realclean: distclean CONFTEST_CXX = "#{CONFTEST}.#{config_string('CXX_EXT') || CXX_EXT[0]}" + TRY_LINK_CXX = config_string('TRY_LINK_CXX') || + ((cmd = TRY_LINK.gsub(/\$\(C(?:C|(FLAGS))\)/, '$(CXX\1)')) != TRY_LINK && cmd) || + "$(CXX) #{OUTFLAG}#{CONFTEST}#{$EXEEXT} $(INCFLAGS) $(CPPFLAGS) " \ + "$(CXXFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)" + def have_devel? unless defined? @have_devel @have_devel = true @@ -2809,6 +2814,11 @@ realclean: distclean RbConfig::expand("$(CXX) #$INCFLAGS #$CPPFLAGS #$CXXFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_CXX}", conf) end + + def link_command(ldflags, *opts) + conf = link_config(ldflags, *opts) + RbConfig::expand(TRY_LINK_CXX.dup, conf) + end end end |