diff options
Diffstat (limited to 'ext/pty/extconf.rb')
| -rw-r--r-- | ext/pty/extconf.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/pty/extconf.rb b/ext/pty/extconf.rb new file mode 100644 index 0000000000..ae2cb45d3c --- /dev/null +++ b/ext/pty/extconf.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +require 'mkmf' + +$INCFLAGS << " -I$(topdir) -I$(top_srcdir)" + +if /mswin|mingw|bccwin/ !~ RUBY_PLATFORM + have_header("sys/stropts.h") + have_func("setresuid") + have_header("libutil.h") + have_header("pty.h") + have_header("pwd.h") + 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("ioctl") + have_macro("HAVE_FCHMOD") or have_func("fchmod") + have_macro("HAVE_FCHOWN") or have_func("fchown") + create_makefile('pty') + end +end |
