1999-01-19 23:59:39 -05:00
|
|
|
require 'mkmf'
|
|
|
|
|
|
|
|
def etc_grep_header(field)
|
2001-06-05 00:43:17 -04:00
|
|
|
if egrep_cpp(field, "#include <pwd.h>\n")
|
|
|
|
$defs.push(format("-D%s", field.upcase))
|
1999-01-19 23:59:39 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
1998-01-16 07:13:05 -05:00
|
|
|
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
|
1999-01-19 23:59:39 -05:00
|
|
|
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")
|
1999-08-24 04:21:56 -04:00
|
|
|
etc_grep_header("pw_comment") unless /cygwin/ === RUBY_PLATFORM
|
1999-01-19 23:59:39 -05:00
|
|
|
etc_grep_header("pw_expire")
|
1998-01-16 07:13:05 -05:00
|
|
|
create_makefile("etc")
|
|
|
|
end
|