diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-23 09:26:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-23 09:26:53 +0000 |
commit | eb5a52e0706c7321eaf04f1c3240618532db8ca3 (patch) | |
tree | c7535f1c700e1b070efa8bd26e7a2b1146bd6722 /ext/io/wait/extconf.rb | |
parent | 2436525ed8cd7b95a3a98173afd23804fedf6676 (diff) |
* ext/io/wait: imported.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/io/wait/extconf.rb')
-rw-r--r-- | ext/io/wait/extconf.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/io/wait/extconf.rb b/ext/io/wait/extconf.rb new file mode 100644 index 0000000000..0c1a870474 --- /dev/null +++ b/ext/io/wait/extconf.rb @@ -0,0 +1,28 @@ +require 'mkmf' +target = "io/wait" +unless defined?(checking_for) + def checking_for(msg) + STDOUT.print "checking for ", msg, "..." + STDOUT.flush + STDOUT.puts((r = yield) ? "yes" : "no") + r + end +end +unless defined?(macro_defined?) + def macro_defined?(macro, src, opt="") + try_cpp(src + <<"SRC", opt) +#ifndef #{macro} +# error +#endif +SRC + end +end + +unless /djgpp|mswin|mingw|human/ =~ RUBY_PLATFORM + fionread = %w[sys/ioctl.h sys/filio.h].find do |h| + checking_for("FIONREAD") {macro_defined?("FIONREAD", "#include <#{h}>\n")} + end + exit 1 unless fionread + $defs << "-DFIONREAD_HEADER=\"<#{fionread}>\"" + create_makefile(target) +end |