summaryrefslogtreecommitdiff
path: root/ext/tk/extconf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-08 03:53:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-08 03:53:28 +0000
commit333034eacd1af0701b5f3d4696ea48d79034be34 (patch)
tree13332038abb5f634bd9ba1aaa7f3f51d9d6b6d01 /ext/tk/extconf.rb
parentccb6e802afbda172b2d560eab3e979e289d9365e (diff)
tk/extconf.rb: progress
* ext/tk/extconf.rb (progress): print progress messages only if Logging is quiet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/extconf.rb')
-rw-r--r--ext/tk/extconf.rb35
1 files changed, 22 insertions, 13 deletions
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index fc6d04b58a..4571953d4b 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -127,6 +127,15 @@ def maybe_64bit?
/64|universal|s390x/ =~ RUBY_PLATFORM
end
+if defined?(Logging.quiet) and Logging.quiet
+ def progress(s)
+ print(s)
+ end
+else
+ def progress(s)
+ end
+end
+
def check_tcltk_version(version)
return [nil, nil] unless version.kind_of? String
@@ -757,7 +766,7 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file]
dir.strip.chomp('/')
end
}.each{|dir|
- print("."); progress_flag = true # progress
+ progress("."); progress_flag = true
# print("check #{dir} ==>");
if dir.kind_of? Array
tcldir, tkdir = dir
@@ -1182,7 +1191,7 @@ def find_tcl(tcllib, stubs, version, *opt_paths)
end
}
- print("\n") # progress
+ progress("\n")
[false, nil, nil, nil]
end
@@ -1321,7 +1330,7 @@ def find_tk(tklib, stubs, version, *opt_paths)
end
}
- print("\n") # progress
+ progress("\n")
[false, nil, nil, nil]
end
@@ -1402,7 +1411,7 @@ def find_tcltk_header(tclver, tkver)
else
major = minor = nil
end
- print(".") # progress
+ progress(".")
if major && minor
# version check on tcl.h
version_check = proc {|code|
@@ -1445,7 +1454,7 @@ def find_tcltk_header(tclver, tkver)
version_check = nil
end
have_tcl_h = paths.find{|path|
- print(".") # progress
+ progress(".")
inc_opt = " -I#{path.quote}"
if try_header("tcl", inc_opt, &version_check)
($INCFLAGS ||= "") << inc_opt
@@ -1469,7 +1478,7 @@ def find_tcltk_header(tclver, tkver)
else
major = minor = nil
end
- print(".") # progress
+ progress(".")
if major && minor
# version check on tk.h
version_check = proc {|code|
@@ -1512,7 +1521,7 @@ def find_tcltk_header(tclver, tkver)
version_check = nil
end
have_tk_h = paths.find{|path|
- print(".") # progress
+ progress(".")
inc_opt = " -I#{path.quote}"
if try_header(%w'tcl.h tk.h', inc_opt, &version_check)
($INCFLAGS ||= "") << inc_opt
@@ -1800,21 +1809,21 @@ print("check functions.")
ruby_enc_find_basename
".each do |func|
have_func(func, "ruby.h")
- print(".") # progress
+ progress(".")
end
-print("\n") # progress
+progress("\n")
# check libraries
unless is_win32?
print("check libraries.")
have_library("nsl", "t_open")
- print(".") # progress
+ progress(".")
have_library("socket", "socket")
- print(".") # progress
+ progress(".")
have_library("dl", "dlopen")
- print(".") # progress
+ progress(".")
have_library("m", "log", "math.h")
- print("\n") # progress
+ progress("\n")
end
$CPPFLAGS ||= ""
$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM