diff options
Diffstat (limited to 'ext/pty/extconf.rb')
| -rw-r--r-- | ext/pty/extconf.rb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/ext/pty/extconf.rb b/ext/pty/extconf.rb index 4379177755..ae2cb45d3c 100644 --- a/ext/pty/extconf.rb +++ b/ext/pty/extconf.rb @@ -3,19 +3,26 @@ require 'mkmf' $INCFLAGS << " -I$(topdir) -I$(top_srcdir)" -if /mswin|mingw|bccwin|nacl/ !~ RUBY_PLATFORM +if /mswin|mingw|bccwin/ !~ RUBY_PLATFORM have_header("sys/stropts.h") have_func("setresuid") have_header("libutil.h") - have_header("util.h") # OpenBSD openpty have_header("pty.h") have_header("pwd.h") - have_library("util", "openpty") - if have_func("posix_openpt") or - have_func("openpty") or + if /openbsd/ =~ RUBY_PLATFORM + have_header("util.h") # OpenBSD openpty + util = have_library("util", "openpty") + end + openpt = have_func("posix_openpt") + if openpt + have_func("ptsname_r") or have_func("ptsname") + end + if openpt or + (util or have_func("openpty")) or have_func("_getpty") or - have_func("ptsname") or have_func("ioctl") + have_macro("HAVE_FCHMOD") or have_func("fchmod") + have_macro("HAVE_FCHOWN") or have_func("fchown") create_makefile('pty') end end |
