mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
a1b57d0add
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
31 lines
711 B
Ruby
31 lines
711 B
Ruby
require 'mkmf'
|
|
|
|
def etc_grep_header(field)
|
|
f = open("conftest.c", "w")
|
|
f.print <<EOF
|
|
#include <pwd.h>
|
|
EOF
|
|
f.close
|
|
begin
|
|
if xsystem("#{CPP} | egrep #{field}")
|
|
$defs.push(format("-D%s", field.upcase))
|
|
end
|
|
ensure
|
|
system "rm -f conftest.c"
|
|
end
|
|
end
|
|
|
|
have_library("sun", "getpwnam") # NIS (== YP) interface for IRIX 4
|
|
a = have_func("getlogin")
|
|
b = have_func("getpwent")
|
|
c = have_func("getgrent")
|
|
if a or b or c
|
|
etc_grep_header("pw_gecos")
|
|
etc_grep_header("pw_change")
|
|
etc_grep_header("pw_quota")
|
|
etc_grep_header("pw_age")
|
|
etc_grep_header("pw_class")
|
|
etc_grep_header("pw_comment") unless /cygwin/ === RUBY_PLATFORM
|
|
etc_grep_header("pw_expire")
|
|
create_makefile("etc")
|
|
end
|