From d371e3583e3b1e0692f92343017b62d2628190ff Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 19 May 2011 00:07:25 +0000 Subject: * lib: revert r31635-r31638 and untabify with expand(1). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/mkmf.rb | 108 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 54 insertions(+), 54 deletions(-) (limited to 'lib/mkmf.rb') diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 2480cdd1b2..8cd601884c 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -299,11 +299,11 @@ end def xsystem command, opts = nil varpat = /\$\((\w+)\)|\$\{(\w+)\}/ - if varpat =~ command - vars = Hash.new {|h, k| h[k] = ''; ENV[k]} - command = command.dup - nil while command.gsub!(varpat) {vars[$1||$2]} - end + if varpat =~ command + vars = Hash.new {|h, k| h[k] = ''; ENV[k]} + command = command.dup + nil while command.gsub!(varpat) {vars[$1||$2]} + end Logging::open do puts command.quote if opts and opts[:werror] @@ -410,7 +410,7 @@ def cc_command(opt="") 'arch_hdrdir' => "#$arch_hdrdir", 'top_srcdir' => $top_srcdir.quote) RbConfig::expand("$(CC) #$INCFLAGS #$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_C}", - conf) + conf) end def cpp_command(outfile, opt="") @@ -418,7 +418,7 @@ def cpp_command(outfile, opt="") 'arch_hdrdir' => "#$arch_hdrdir", 'top_srcdir' => $top_srcdir.quote) RbConfig::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}", - conf) + conf) end def libpathflag(libpath=$DEFLIBPATH|$LIBPATH) @@ -547,7 +547,7 @@ end def try_static_assert(expr, headers = nil, opt = "", &b) headers = cpp_include(headers) try_compile(<#{member} - (char *)0; SRC $defs.push(format("-DHAVE_%s_%s", type.tr_cpp, member.tr_cpp)) @@ -1019,7 +1019,7 @@ end # def try_type(type, headers = nil, opt = "", &b) if try_compile(<<"SRC", opt, &b) - #{cpp_include(headers)} +#{cpp_include(headers)} /*top*/ typedef #{type} conftest_type; int conftestval[sizeof(conftest_type)?1:-1]; @@ -1077,7 +1077,7 @@ end def try_const(const, headers = nil, opt = "", &b) const, type = *const if try_compile(<<"SRC", opt, &b) - #{cpp_include(headers)} +#{cpp_include(headers)} /*top*/ typedef #{type || 'int'} conftest_type; conftest_type conftestval = #{type ? '' : '(int)'}#{const}; @@ -1217,18 +1217,18 @@ def convertible_int(type, headers = nil, opts = nil, &b) u = "unsigned " if signed > 0 prelude << "extern rbcv_typedef_ foo();" compat = UNIVERSAL_INTS.find {|t| - try_compile([prelude, "extern #{u}#{t} foo();"].join("\n"), opts, :werror=>true, &b) + try_compile([prelude, "extern #{u}#{t} foo();"].join("\n"), opts, :werror=>true, &b) } if compat - macname ||= type.sub(/_(?=t\z)/, '').tr_cpp - conv = (compat == "long long" ? "LL" : compat.upcase) - compat = "#{u}#{compat}" - $defs.push(format("-DTYPEOF_%s=%s", type.tr_cpp, compat.quote)) - $defs.push(format("-DPRI_%s_PREFIX=PRI_%s_PREFIX", macname, conv)) - conv = (u ? "U" : "") + conv - $defs.push(format("-D%s2NUM=%s2NUM", macname, conv)) - $defs.push(format("-DNUM2%s=NUM2%s", macname, conv)) - compat + macname ||= type.sub(/_(?=t\z)/, '').tr_cpp + conv = (compat == "long long" ? "LL" : compat.upcase) + compat = "#{u}#{compat}" + $defs.push(format("-DTYPEOF_%s=%s", type.tr_cpp, compat.quote)) + $defs.push(format("-DPRI_%s_PREFIX=PRI_%s_PREFIX", macname, conv)) + conv = (u ? "U" : "") + conv + $defs.push(format("-D%s2NUM=%s2NUM", macname, conv)) + $defs.push(format("-DNUM2%s=NUM2%s", macname, conv)) + compat end end end @@ -1239,10 +1239,10 @@ end # pointer. def scalar_ptr_type?(type, member = nil, headers = nil, &b) try_compile(<<"SRC", &b) # pointer - #{cpp_include(headers)} +#{cpp_include(headers)} /*top*/ volatile #{type} conftestval; - #{MAIN_DOES_NOTHING} +#{MAIN_DOES_NOTHING} int t() {return (int)(1-*(conftestval#{member ? ".#{member}" : ""}));} SRC end @@ -1251,10 +1251,10 @@ end # pointer. def scalar_type?(type, member = nil, headers = nil, &b) try_compile(<<"SRC", &b) # pointer - #{cpp_include(headers)} +#{cpp_include(headers)} /*top*/ volatile #{type} conftestval; - #{MAIN_DOES_NOTHING} +#{MAIN_DOES_NOTHING} int t() {return (int)(1-(conftestval#{member ? ".#{member}" : ""}));} SRC end @@ -1266,7 +1266,7 @@ def have_typeof? $typeof = %w[__typeof__ typeof].find do |t| try_compile(<>$(INSTALLED_LIST)\n" + mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n" end end else @@ -2020,17 +2020,17 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""} files = install_files(mfile, i, nil, srcprefix) or next for dir, *files in files unless dirs.include?(dir) - dirs << dir - mfile.print "pre-install-rb#{sfx}: #{dir}\n" + dirs << dir + mfile.print "pre-install-rb#{sfx}: #{dir}\n" end for f in files - dest = "#{dir}/#{File.basename(f)}" - mfile.print("install-rb#{sfx}: #{dest} #{dir}\n") - mfile.print("#{dest}: #{f}\n") - mfile.print("\t$(Q) $(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D#{sep})\n") - if defined?($installed_list) and !$extout - mfile.print("\t@echo #{dest}>>$(INSTALLED_LIST)\n") - end + dest = "#{dir}/#{File.basename(f)}" + mfile.print("install-rb#{sfx}: #{dest} #{dir}\n") + mfile.print("#{dest}: #{f}\n") + mfile.print("\t$(Q) $(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D#{sep})\n") + if defined?($installed_list) and !$extout + mfile.print("\t@echo #{dest}>>$(INSTALLED_LIST)\n") + end if $extout mfile.print("clean-rb#{sfx}::\n") mfile.print("\t@-$(RM) #{fseprepl[dest]}\n") -- cgit v1.2.3