diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-08 10:00:43 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-08 10:00:43 +0000 |
commit | b8ff4a843e4dbf1fab1f033a660f80cccf6a095d (patch) | |
tree | 9516ab54f8cd4b5c5f2a0e97b0d1cb9567cba6c7 /ext/etc/extconf.rb | |
parent | d76fdc013bea0cd7881fb2d49e94264c834f374b (diff) | |
download | ruby-b8ff4a843e4dbf1fab1f033a660f80cccf6a095d.tar.gz |
* lib/mkmf.rb (have_struct_member): moved from ext/socket/extconf.rb.
* ext/socket/extconf.rb: use macro_defined? instead of egrep_cpp.
* ext/etc/extconf.rb: use have_struct_member.
* ext/etc/etc.c: add prefix HAVE_ST_ to PW_ macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/etc/extconf.rb')
-rw-r--r-- | ext/etc/extconf.rb | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/ext/etc/extconf.rb b/ext/etc/extconf.rb index b920d91a95..bf6890ca9d 100644 --- a/ext/etc/extconf.rb +++ b/ext/etc/extconf.rb @@ -1,22 +1,16 @@ require 'mkmf' -def etc_grep_header(field) - if egrep_cpp(field, "#include <pwd.h>\n") - $defs.push(format("-D%s", field.upcase)) - 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") + have_struct_member('struct passwd', 'pw_gecos', 'pwd.h') + have_struct_member('struct passwd', 'pw_change', 'pwd.h') + have_struct_member('struct passwd', 'pw_quota', 'pwd.h') + have_struct_member('struct passwd', 'pw_age', 'pwd.h') + have_struct_member('struct passwd', 'pw_class', 'pwd.h') + have_struct_member('struct passwd', 'pw_comment', 'pwd.h') unless /cygwin/ === RUBY_PLATFORM + have_struct_member('struct passwd', 'pw_expire', 'pwd.h') create_makefile("etc") end |