diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 1ae99257ce8d18..b681c1d9b3920f 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -2038,7 +2038,7 @@ def configuration(srcdir) ruby_headers = #{headers.join(' ')} RM = #{config_string('RM', &possible_command) || '$(RUBY) -run -e rm -- -f'} -RM_RF = #{'$(RUBY) -run -e rm -- -rf'} +RM_RF = #{config_string('RMALL', &possible_command) || '$(RUBY) -run -e rm -- -rf'} RMDIRS = #{config_string('RMDIRS', &possible_command) || '$(RUBY) -run -e rmdir -- -p'} MAKEDIRS = #{config_string('MAKEDIRS', &possible_command) || '@$(RUBY) -run -e mkdir -- -p'} INSTALL = #{config_string('INSTALL', &possible_command) || '@$(RUBY) -run -e install -- -vp'} @@ -2046,6 +2046,7 @@ def configuration(srcdir) INSTALL_DATA = #{config_string('INSTALL_DATA') || '$(INSTALL) -m 0644'} COPY = #{config_string('CP', &possible_command) || '@$(RUBY) -run -e cp -- -v'} TOUCH = exit > +POSTLINK = #{config_string('POSTLINK')} #### End of system configuration section. #### @@ -2382,6 +2383,9 @@ def create_makefile(target, srcprefix = nil) if defined?($installed_list) mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n" end + unless CONFIG['dsymutil'].to_s.empty? + mfile.print "\tcp -r #{f}.dSYM/ #{dir}/$(DLLIB).dSYM/\n" + end end mfile.print "clean-static::\n" mfile.print "\t-$(Q)$(RM) $(STATIC_LIB)\n" @@ -2764,6 +2768,7 @@ def MAIN_DOES_NOTHING(*refs) clean-so:: clean: clean-so clean-static clean-rb-default clean-rb \t\t-$(Q)$(RM) $(CLEANLIBS#{sep}) $(CLEANOBJS#{sep}) $(CLEANFILES#{sep}) .*.time +\t\t-$(Q)$(RM_RF) *.dSYM distclean-rb-default:: distclean-rb:: diff --git a/template/Makefile.in b/template/Makefile.in index fae425d1c5f039..4466e70c765d14 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -477,7 +477,7 @@ clean-local:: enc/encinit.c enc/encinit.$(OBJEXT) $(pkgconfig_DATA) \ ruby-runner.$(OBJEXT) ruby-runner.h \ || $(NULLCMD) - -$(Q)$(RMALL) exe/ *.dSYM + -$(Q)$(RMALL) exe/ *.dSYM $(EXTOUT)/$(arch)/*.dSYM distclean-local:: $(Q)$(RM) \ diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb index 5652d863316ea0..7616b1596a5fea 100644 --- a/test/rubygems/test_gem_installer.rb +++ b/test/rubygems/test_gem_installer.rb @@ -1422,11 +1422,7 @@ def test_find_lib_file_after_install write_file File.join(@tempdir, "extconf.rb") do |io| io.write <<-RUBY require "mkmf" - - CONFIG['CC'] = '$(TOUCH) $@ ||' - CONFIG['LDSHARED'] = '$(TOUCH) $@ ||' - $ruby = '#{Gem.ruby}' - + $LIBPATH << #{@current_dir.dump} # to link with libruby without needing it installed create_makefile("#{@spec.name}") RUBY end @@ -1435,7 +1431,6 @@ def test_find_lib_file_after_install write_file File.join(@tempdir, "a.c") do |io| io.write <<-C - #include void Init_a() { } C end @@ -1508,22 +1503,23 @@ def test_install_extension_flat @spec.require_paths = ["."] @spec.extensions << "extconf.rb" + @spec.files += %W[depend #{@spec.name}.c] write_file File.join(@tempdir, "extconf.rb") do |io| io.write <<-RUBY require "mkmf" - - CONFIG['CC'] = '$(TOUCH) $@ ||' - CONFIG['LDSHARED'] = '$(TOUCH) $@ ||' - $ruby = '#{Gem.ruby}' - + $LIBPATH << #{@current_dir.dump} # to link with libruby without needing it installed create_makefile("#{@spec.name}") RUBY end # empty depend file for no auto dependencies - @spec.files += %W[depend #{@spec.name}.c].each do |file| - write_file File.join(@tempdir, file) + write_file File.join(@tempdir, "depend") + + write_file File.join(@tempdir, "#{@spec.name}.c") do |io| + io.write <<-C + void Init_#{@spec.name}() { } + C end so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")